SlideShare a Scribd company logo
Introduction to Datomic
Siva Jagadeesan
“there’s an another
database!”
• what do you think of first?
The job of a database
•Coordination
•Consistency
•Indexing
•Storage
•Queries
The traditional world
• Place-oriented-programming (PLOP)	

• designed decades ago	

• tiny RAM, tiny disks	

• Collocated components	

• Difficult to scale	

• Necessitates application-level sharding
The dreaded update-in-place
sharding
• lose 	

• consistency	

• transactions	

• queries
key-value stores
• lose	

• querying	

• really just storage systems	

• not “databases”
Deconstruction
• relocate subsystems	

• separate services each do one thing	

• simplification
Datomic architecture
• Peers	

• Transactors	

• Storage services
The new world
Benefits
• Separating reads and writes	

• applications only read from storage	

• transactor 	

• handles transactions 	

• provides consistency	

• reflects changes to peers
Benefits
• Integrated data distribution	

• built-in in-memory caches	

• self-tunes to working set	

• automatic
Benefits
• Peers each have a query engine 	

• Datalog	

• simple rules and data patterns	

• declarative: implicit joins	

• declarative: meaning is evident	

• locality: datomic db and app data
Benefits
• Elasticity	

• as elastic as peers
Benefits
• Cloud ready	

• commodity hardware	

• resilient to failures
Data model
• Immutable data	

• remember everything	

• things don’t actually “change”	

• audit everything	

• automatic
Data model
• Facts-oriented (vs. PLOP)	

• Atomic Data	

• datoms	

• entity, attribute, value, transaction	

• Not embedded into strucures
Data model
• Minimal Schema	

• at the datom level	

• directly supports cardinality	

• avoid rigidity	

• even other “schema-free” documents
impose their structure into apps	

• Hickey:“nothing pivots like a datom”
Programming model
• Peer embedded in your application	

• Pulls indexes or data segments as needed	

• Caches locally, gets updates from transactor
Programming model
• No strings-based query language	

• Data-structure-driven	

• Lists and maps	

• Easy to generate and test
Programming model
• Transactional	

• Totally ordered	

• First class: peers get a queue of all transactions	

• Can use them in queries	

• Facilitates event-driven triggers without polling	

• Annotated transactions
Programming model
• Datalog	

• deductive query system	

• facts = datomic db	

• can also include other app data	

• extensible through custom functions that
queries can use
Programming model
• Consistent	

• without impeding other threads or peers	

• reads/queries without transactions	

• through immutability	

• db as a value
Programming model
• Time	

• as-of queries	

• windowed queries
The so-what
• Simplicity	

• consistency	

• built-in caching	

• no manual sharding	

• configuration-free	

• cloud-scale
The so-what
• Evolvability	

• datom-level schema	

• application free to change “structural”
thinking
The so-what
• Local query power	

• each peer has full query engine	

• the db is effectively local	

• isolation from others: 	

• e.g. - analytics usage won’t bog down
transaction processing
The so-what
• Multiple storage choices	

• in-memory for developing, unit-testing	

• RDBMS backend possible (behind firewall,
etc)	

• Distributed storage services for
redundancy and unlimited read scaling	

• backup/restore tools available
The so-what
• Integrated mem-cache support	

• local caches can be backed by OTS mem-
cache cluster	

• datomic is a “good citizen” user
The so-what
• Leverage datalog against multiple sources	

• datomic db	

• application data
The so-what
• Travel through time	

• audits	

• bug-resolution
Schema def
{:db/id {:part :db.part/db, :idx -1000001},	

:db/ident :user/login,	

:db/valueType :db.type/string,	

:db/cardinality :db.cardinality/one,	

:db/fulltext true,	

:db/doc "the login handle of a user",	

:db.install/_attribute :db.part/db}
Schema def
{:db/id {:part :db.part/db, :idx -1000003},	

:db/ident :user/friends,	

:db/valueType :db.type/ref,	

:db/cardinality :db.cardinality/many,	

:db/fulltext false,	

:db/doc "the friends of a user",	

:db.install/_attribute :db.part/db}
transactions
[:db/add entity-id attribute value]
[:db/retract entity-id attribute value]
{:db/id entity-id!
attribute value!
attribute value!
... }
[:db.fn/retractEntity entity-id]
identities
{:part :db.part/user, :idx -1000026}
{:db/id 17592186045420}
queries
[:find ?e :in $ ?email !
:where !
[?e :person/email ?email]]
[:find variables :where clauses]
[:find ?e ?x !
:where !
[?e :age 42] [?e :likes ?x]]
queries
• lots more	

• pattern matching	

• logic programming	

• multiple data-sources
demonic
• datomic helper	

• work at the data-structure level	

• supports graphs: nested maps	

• only writes dirty data	

• “demarcations” as “batched datomic
transactions”	

• unit-testing support
Questions

More Related Content

PDF
Datomic – A Modern Database - StampedeCon 2014
PDF
The power of datomic
PPTX
Azure DocumentDB 101
PPTX
Azure DocumentDB
PPTX
Cool NoSQL on Azure with DocumentDB
PDF
SDEC2011 NoSQL Data modelling
PPTX
MongoDB
PPTX
NoSQL Tel Aviv Meetup#1: NoSQL Data Modeling
Datomic – A Modern Database - StampedeCon 2014
The power of datomic
Azure DocumentDB 101
Azure DocumentDB
Cool NoSQL on Azure with DocumentDB
SDEC2011 NoSQL Data modelling
MongoDB
NoSQL Tel Aviv Meetup#1: NoSQL Data Modeling

What's hot (20)

PPTX
Data Modeling for NoSQL
PPTX
Javascript on Server-Side
PPT
MongoDB - An Agile NoSQL Database
PPTX
BGOUG 2012 - Drag & drop and other stuff - Using your database as a file server
PDF
Big Challenges in Data Modeling: NoSQL and Data Modeling
PPTX
Thinking in a document centric world with RavenDB by Nick Josevski
KEY
NoSQL: Why, When, and How
PPT
No sql Database
PDF
Nosql data models
PPT
5 Data Modeling for NoSQL 1/2
PPTX
Modeling JSON data for NoSQL document databases
PPT
9. Document Oriented Databases
PPTX
Selecting best NoSQL
PPTX
NOSQL Databases types and Uses
PDF
MongoDB for Coder Training (Coding Serbia 2013)
PPT
Student projects with open source CSQL
PPTX
Relational and non relational database 7
PPTX
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features
PPTX
NoSql Data Management
PDF
NoSQL Databases
Data Modeling for NoSQL
Javascript on Server-Side
MongoDB - An Agile NoSQL Database
BGOUG 2012 - Drag & drop and other stuff - Using your database as a file server
Big Challenges in Data Modeling: NoSQL and Data Modeling
Thinking in a document centric world with RavenDB by Nick Josevski
NoSQL: Why, When, and How
No sql Database
Nosql data models
5 Data Modeling for NoSQL 1/2
Modeling JSON data for NoSQL document databases
9. Document Oriented Databases
Selecting best NoSQL
NOSQL Databases types and Uses
MongoDB for Coder Training (Coding Serbia 2013)
Student projects with open source CSQL
Relational and non relational database 7
[PASS Summit 2016] Azure DocumentDB: A Deep Dive into Advanced Features
NoSql Data Management
NoSQL Databases
Ad

Similar to Introduction to datomic (20)

PPT
Datomic
PDF
Venturing into-datomic
PPTX
Navigating NoSQL in cloudy skies
PPTX
Introduction to Data Science NoSQL.pptx
PPTX
NoSQL.pptx
PPTX
cours database pour etudiant NoSQL (1).pptx
PPTX
Introduction to NoSql
PPTX
No sql distilled-distilled
PPT
No sql (1)
PPTX
Sql vs NoSQL
PPTX
unit2-ppt1.pptx
PPTX
Choosing your NoSQL storage
PPTX
NoSQL databases - An introduction
PPTX
Big Data Platforms: An Overview
PPT
NO SQL: What, Why, How
PDF
the rising no sql technology
PPTX
NOSQL PRESENTATION ON INTRRODUCTION Intro.pptx
PDF
Solr cloud the 'search first' nosql database extended deep dive
PDF
NoSQL Databases Introduction - UTN 2013
PDF
Oracle Week 2016 - Modern Data Architecture
Datomic
Venturing into-datomic
Navigating NoSQL in cloudy skies
Introduction to Data Science NoSQL.pptx
NoSQL.pptx
cours database pour etudiant NoSQL (1).pptx
Introduction to NoSql
No sql distilled-distilled
No sql (1)
Sql vs NoSQL
unit2-ppt1.pptx
Choosing your NoSQL storage
NoSQL databases - An introduction
Big Data Platforms: An Overview
NO SQL: What, Why, How
the rising no sql technology
NOSQL PRESENTATION ON INTRRODUCTION Intro.pptx
Solr cloud the 'search first' nosql database extended deep dive
NoSQL Databases Introduction - UTN 2013
Oracle Week 2016 - Modern Data Architecture
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Empathic Computing: Creating Shared Understanding
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation theory and applications.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Dropbox Q2 2025 Financial Results & Investor Presentation
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
The AUB Centre for AI in Media Proposal.docx
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Empathic Computing: Creating Shared Understanding
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MYSQL Presentation for SQL database connectivity
NewMind AI Weekly Chronicles - August'25 Week I
“AI and Expert System Decision Support & Business Intelligence Systems”
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation theory and applications.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation_ Review paper, used for researhc scholars
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

Introduction to datomic