datomic
play

Datomic A modern database Databases Perks Declarative Query - PowerPoint PPT Presentation

Datomic A modern database Databases Perks Declarative Query Language (e.g. SQL) Indexes Transactions (ACI) Durability (D) What are the Problems? Query as Strings Query Power "over there" Update in Place


  1. Datomic A modern database

  2. Databases Perks • Declarative Query Language (e.g. SQL) • Indexes • Transactions (ACI) • Durability (D)

  3. What are the Problems? • Query as Strings • Query Power "over there" • Update in Place • Inflexibility in Data Modeling • Reaction by Polling.

  4. Datomic • Database by Rich Hickey, creator of Clojure. • Proposition to solve the preceding Problems. • ../ while retaining the Perks.

  5. Clojure Crash Course • Atomic Literals: Numbers, Strings, Keywords • Symbols and Definitions • Functions • Composite Literals: Vectors, Maps • Atoms and References

  6. State in Clojure State transition F F F as pure function v1 v2 v3 v4 State Identity as immutable value as succession of states Observers

  7. State in Datomic Tx Tx Tx Transations d1 d2 d3 d4 State Database as immutable value as succession of states Observers

  8. Architecture Peer App Server Peer Library App Query Live Comm Cache Index Transactor Storage Service Trans- Indexing actions

  9. Facts Entity Id Attribute Value Transaction 17592186049940 :artist/name "Mani Matter" 13194139538829 17592186049213 :artist/name "Walter Wegmüller" 13194139538101 17592186047069 :artist/name "Krokodil" 13194139535943 ;e a v t added? [17592186049940 94 "Mani Matter" 13194139538829 true] [17592186049213 94 "Walter Wegmüller" 13194139538101 true] [17592186047069 94 "Krokodil" 13194139535943 true]

  10. Entity Entity Id Attribute Value Transaction 17592186049940 :db/id 17592186049940 13194139538829 17592186049940 :artist/name "Mani Matter" 13194139538829 17592186049940 :artist/type :artist.type/person 13194139538829 17592186049940 :artist/gender :artist.gender/male 13194139538829 17592186049940 :artist/startYear 1936 13194139538829 17592186049940 :artist/endYear 1972 13194139538829

  11. Entity { :db/id 17592186049940 
 :artist/name "Mani Matter" 
 :artist/type :artist.type/person 
 :artist/country :country/CH 
 :artist/gender :artist.gender/male 
 :artist/startYear 1936 
 :artist/endYear 1972}

  12. Schema / Attribute { :db/id 94 
 :db/ident :artist/name 
 :db/valueType :db.type/string 
 :db/cardinality :db.cardinality/one 
 :db/index true 
 :db/doc "The artist's name" }

  13. Indexes (covering) Type Ordering Usage Log Tx Order Log EAVT Entity Attribute Value Tx Search by entity AEVT Attribute Entity Value Tx Column Store AVET Attribute Value Entity Tx (optional) Search by value VAET Value Attribute Entity Tx (optional) Reference Navigation

  14. Queries: Datalog [ :find ?e 
 :where [?e :artist/country :country/CH ]] =? #| [17592186049940] 
 [17592186047989] 
 [17592186047069] 
 [17592186049213] 
 [17592186050318] 
 [17592186046896]}

  15. Queries: Datalog • Data-Driven • Declarative • Unification • Many Features: Rules, Aggregate, Ranges, ../

  16. Entity API and Pull API • Entity API • Lazy • Navigable • Pull API • Declarative • Data-Driven • Hierarchical

  17. Transactions Operation Entity Id Attribute Value :db/add 17592186049940 :artist/name "Mani Matter" :db/add 17592186049940 :artist/type :artist.type/person :db/add 17592186049940 :artist/gender :artist.gender/male :db/remove 17592186046681 :artist/name "Prince" ̊ " ̵ :db/add 17592186046681 :artist/name " Ƭ ̬

  18. Transactions • Data-Driven • Reified • Before/After Database Values • Subscription to Transaction Queue

  19. Caveats • Data Migration • Proprietary Software

  20. Resources • Datomic -. http: /0 www.datomic.com • The Value of Values -. https: /0 www.youtube.com/ watch?v=-6BsiVyC1kM • Deconstructing the Database -. https: /0 www.youtube.com/watch?v=Cym4TZwTCNU • ¿Where is my data? -. https: /0 www.youtube.com/watch? v=i3HDKNzZ5iw&index=6&list=PLZdCLR02grLoBx0Y5ZrpdmLx c160PIwzQ • Out of the Tar Pit; Moseley and Marks (2006)

  21. Thank you @stanhbb http: /0 www.meetup.com/zh-clj-Zurich-Clojure-User-Group/

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend