Warning
This all works, but ultimately I decided not to use it in lieu of one big spreadsheet like I used to.
Data Journal is the latest iteration of my long-running quantified self project. This iteration of the whole Life Tracker/Personal Data Warehouse. It’s not technically a total re-write of my previous project, but it’s pretty darn close.
Tldr
- Data Journal is a system for capturing, maintaining, & using event-based data
- Data Journal is a set of data shapes (i.e. regular objects) & tools for operating on them
- A
DataJournalis comprised of arrays ofEntrys andDefs, where:
- A
Defis a definition of a known key/value pair that may exist onEntrys- An
Entryis an event that happened in a give time period, containing zero-to-many keys/value pairs described byDefsDataJournals can be:
- merged together without duplication
- modified (via
transactions)- queried (via
querys)- The PDW is a system for managing multiple
DataJournals, stored across disparate databases and/or files
A few more details:
- The Data Journal code is not class-oriented.
- All data shapes can be serialized to and parsed from JSON without data loss
- No “instances of class” are required, everything is based on regular objects
- Classes are used as namespaces for related functions
- A
DataJournalis comprised of an array ofEntrys and an array ofDefs- Metadata properties of elements (i.e.
Entrys andDefs) start with an underscore
- Metadata properties of elements (i.e.
- A
Defdefines known key/value pairs that may exist onEntrys- A
Defmust contain_id,_updated, and_typekeys Defs may have other keys as wellDef._idvalues cannot start with an underscore
- A
- An
Entryis a record of something that happened at some point in time- An
Entrymust contain_id,_updated, and_periodkeys - An
Entrymay have other keys as well - An
Entrytypically contains one or many entry “points”, which have an associatedDef- An entry point is a key/value pair on an
Entrywhose key is aDef._id
- An entry point is a key/value pair on an
- An
- Merging two or more
DataJournals will only keep one copy of each element based on its_id, in the case where multiple copies exist, it will only keep the one with the largest_updatedvalue (i.e. the newest one is kept) - Data Journals may be written to (via
transaction) or read from (viaquery) using regular objects- A
Transactionmay update elements viacreate,replace,modify, ordeletecreate- will always create & not look for existing data with the same
.
- will always create & not look for existing data with the same
replace- if the
_idis not in theDataJournal, will create it - if the existing
_idin the journal is older, will fully replace it - if the existing
_idin the journal is newer, will not affect it at all
- if the
modify- if the
_idis not in theDataJournal, will create it - if the existing
_idis older, it will retain any keys not explicitly overwritten by the modification - if the existing
_idis newer, will not affect it at all
- if the
delete- will always mark the matching element
_idas_deleted = true
- will always mark the matching element
- A
Queryis an object full ofEntry-filtering parameters
- A
- Other utility classes operating on
DataJournals do exist, but are decoupled from each other and the Data Journal code does not depend on them.- Examples:
Summarizer,Validator,Overviewer,Aliaser, and a host ofTranslators andConnectors which allow for reading/writing from static files and databases, respectively
- Examples:
Main Concepts via Picture
Data Shapes

Main Processes

Connectors, Translators, & Utilities

