Physics Derivation Graph navigation Sign in

moving from local terminal interface with CSV to web interface with a database backend

Published 2015-11-30T16:09:00Z by Physics Derivation Graph

The existing Physics Derivation Graph is centered on command-line input with PNG output. Recently I've been exploring use of d3js as a web frontend.

I'm considering moving the Physics Derivation Graph to something which supports a web frontend connected to a hosted database backend. No command-line interaction or installation required.

I've been using CSV to store the data because it is the most common format. That works fine as long as the PDG is local and command-line driven. Now I want to move to a website, (ie openshift -- )
I've set up a Django cartridge

I realized I don't need to sketch a design for the PDG web interface. Instead, I can start with determining minimum functionality:
I've used Flask previously, but I think the functionality I want is sufficiently complex that Flask wouldn't be enough.

I don't know whether I could continue to use the existing CSV as a backend storage. At this point I don't need scalability in terms of user latency or amount of data.

Vision: enable users of the PDG to interact with content in a web interface

Goal: use Django on Openshift to enable authentication, storage of content, and manipulating content


  1. Flask local instance
  2. Flask read values from database - CSV
  3. convert PDG CSV to local SQL database
  4. read from local SQL database
  5. write to local SQL database -
  6. Flask read values from database - SQL
  7. Django local instance
  8. Django local instance read values from database
  9. Django local instance write values from database
  10. Django on Openshift -
  11. Django on Openshift read values from database
  12. Django on Openshift write values from database
  13. Django on Openshift write values from database by authenticated user

Database choices



SQLite only supports a single writer at a time (meaning the execution of an individual transaction). SQLite locks the entire database when it needs a lock (either read or write) and only one writer can hold a write lock at a time.
SQLite 3.7.0 added a new journal mode called Write Ahead Locking that supports concurrent reading while writing.