Source layout

filewhat it does
src/datomic/api.cljthe public API
src/datomic/db.cljid-literal, the #db/id reader function
src/nitomic/db.cljdatabase values: covering indexes as nested persistent maps, the schema cache, as-of/since/history views
src/nitomic/tx.cljtransactions: expansion, tempid resolution and upsert, id allocation, index updates, schema installation
src/nitomic/query.cljDatalog, rules and aggregates
src/nitomic/pull.cljthe pull API
src/nitomic/entity.cljlazy entities (a deftype over ILookup/Seqable)
src/nitomic/storage.cljdurable storage in SQLite or PostgreSQL: the catalog, transaction log and queue, replay, locks and notifications
src/nitomic/transactor.cljthe transactor: serves a storage's queue and writes its log
src/nitomic/types.cljdatoms and tempids
src/nitomic/bootstrap.cljDatomic's bootstrap datoms

A database is an immutable map, so every database value stays valid. Its covering indexes ({e {a {v tx}}}, {a {e {v tx}}}, {a {v {e tx}}} and {v {a {e tx}}} for refs) make every bound prefix a hash lookup. The sorted orders that d/datoms promises are produced on demand. As in Datomic, query clauses run in the order written.