Intro to Datomic datomic.com @stuartsierra thinkrelevance.com
What is Datomic?
What is Datomic? • A new database • Distributed reads • ACID transactions
What is Datomic? • Non-relational data model • Incorporates time • Declarative query language
Where can I use it? • Runs on the JVM • Peer library: Java and Clojure • ReST -ful API for non-JVM languages
Datomic Free Edition • Always free, redistributable • 1 transactor , up to 2 peers • Local memory or filesystem storage • Easy migration to Datomic Pro
Datomic Pro Edition • License by number of peers • High-availability transactor • Multiple distributed storage services • Integrated memcached
Data Model
Fact • One piece of information • About one thing • At a specific point in time • An immutable value
Database • A collection of facts • At a specific point in time • An immutable value
Entity • A collection of facts about one thing • Can be viewed as a map • Traversable as a graph
Fact = Datom Entity Attribute Value Time 21005 :name "Stuart" 400 21005 :nerd-level 6.8 400 21005 :name "Frodo" 421 21005 :nerd-level 9.6 421
Database as of now Entity Attribute Value Time 21005 :name "Stuart" 400 21005 :nerd-level 6.8 400 21005 :name "Frodo" 421 21005 :nerd-level 9.6 421
Database as of t=400 Entity Attribute Value Time 21005 :name "Stuart" 400 21005 :nerd-level 6.8 400 21005 :name "Frodo" 421 21005 :nerd-level 9.6 421
Database as History Entity Attribute Value Time 21005 :name "Stuart" 400 21005 :nerd-level 6.8 400 21005 :name "Frodo" 421 21005 :nerd-level 9.6 421
Datomic Architecture
Datomic Components Peer Library Transactor Storage Service
Peer Library Your Application • Included in your app Peer • Executes queries locally Library Transactor Storage Service
Peer Library Your Application • Reads data from storage Peer • Caches locally Library cache Transactor Storage Service
Scale Horizontally Your Application Your Application Your Application Peer Peer Peer Library Library Library cache cache cache Transactor Storage Service
Transactor Your Application Peer Library • Standalone system • Scales vertically Transactor Storage Service
Transactor Your Application Peer Library • Standalone system • Hot standby for failover Transactor Storage Service
Transactor Your Application Peer Library • Coordinates writes • Guarantees ACID transactions Transactor Storage Service
Transactor Your Application Peer Library • Writes transaction log to storage • Generates indexes Transactor Storage Service
Transactor Your Application Your Application Your Application Peer Peer Peer Library Library Library cache cache cache • Broadcasts live updates Transactor Storage Service
Storage Your Application Peer Library • Provided as a service • Many different back-ends Transactor Storage Service
Local Storage Your Application Peer Library • Memory • Filesystem Transactor Storage Service
Nearby Storage Your Application Peer Library • SQL database PostgreSQL Transactor Storage Service
Distributed Storage Your Application • DynamoDB Peer • Infinispan Library • Riak • Couchbase Transactor Storage Service
Datomic Components Your Application Your Application Your Application Peer Peer Peer Library Library Library Transactor Storage Service
ACID Writes Your Application Your Application Your Application Peer Peer Peer Library Library Library Transactions Transactor Storage Service Transactions & Indexes
Live Updates Your Application Your Application Your Application Peer Peer Peer Library Library Library Live updates Transactor Storage Service
Distributed Reads Your Application Your Application Your Application Peer Peer Peer Library Library Library Reads Transactor Storage Service
Local Caches Your Application Your Application Your Application Peer Peer Peer Library Library Library cache cache cache Reads Transactor Storage Service
Shared Memcached Your Application Your Application Your Application Peer Peer Peer Library Library Library cache cache cache Reads Memcached Transactor Storage Service
Datomic.com • @datomic_team • Google Group “Datomic” • @stuartsierra • thinkrelevance.com • clojure.com
Recommend
More recommend