-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Status quo
In special-measure, the pulses are all stored in one struct, ordered and accessible by their IDs. There is one global database struct in which the default pulses are stored. For a new experiment, the user has to work with his local copy where he overwrites unneeded IDs. When the experiment has been finished, the user saves the whole database file and its report into a folder.
Desired Improvements
- Better structure inside of the database
- Space efficiency
- Allow easy replication of experiments, even when pulses in the main database change
- Automated generation of folder structure for each experiment
Solution proposals
Relational database (SQL)
The main database could be rewritten into a SQL-Database. These databases only store basetypes and references, therefore additional steps are necessary to store arbitrary objects.
- Pickling:
The pulse will be divided in its subcomponents, until there are just basetypes. These subcomponents will then be referenced. - Object-Relational-Mapping (like SQLAlchemy or SQLObject)
Prewritten wrapper around the SQL-Database with different approaches:- Store object outside of the object and reference it (SQLAlchemy)
- Automated dynamic pickling with table generation (SQLObject)
Folder structure and XML-Representations
The main database can be represented in the XML-Format. This format is the standard for data exchange. For each experiment, we generate a subfolder in which the relevant data (pulse, measurements, documentation) will be stored. The pulse file may reference the main database and stores the composition of subpulses.
Comparison of the proposals
| Criteria | SQL | XML |
|---|---|---|
| Space efficiency | stores only basetypes and references | one big string storing variable names, structure and values as string |
| Speed efficiency | optimized for big databases with 100.000+ | Needs to be parsed for each operation |
| Human readability | not readable as is, but exportable | easy to read and understand |
| Package dependency (python) | pickling already included (sqlite), ORM needs additional third party packages: SQLObject (LGPL), SQLAlchemy (MIT) | included |
So, in the end, we have the trade-off between having a performant database and having an easy one.
Which setup do you think will fulfill your needs?