the impedance mismatch is our fault
play

The Impedance Mismatch is Our Fault Stuart Halloway Datomic Team, - PowerPoint PPT Presentation

The Impedance Mismatch is Our Fault Stuart Halloway Datomic Team, Clojure/core, Relevance 1 All information in the database is to be represented in only one way, namely by values in column positions within rows of tables.


  1. The Impedance Mismatch is Our Fault Stuart Halloway Datomic Team, Clojure/core, Relevance 1

  2. All information in the database is to be represented in only one way, namely by values in column positions within rows of tables. http://en.wikipedia.org/wiki/Codd%27s_12_rules 2

  3. OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them. http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en 3

  4. “...Essentially the ORM can handle about 80-90% of the mapping problems...” http://java.dzone.com/articles/martin-fowler-orm-hate 4

  5. “...I think NoSQL is technology to be taken very seriously....” http://java.dzone.com/articles/martin-fowler-orm-hate 5

  6. “...Not all problems are technically suitable for a NoSQL database...” http://java.dzone.com/articles/martin-fowler-orm-hate 6

  7. “...early successes yield a commitment to use O/R-M...” http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx 7

  8. “...the Slippery Slope...” http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx 8

  9. “...the Last Mile Problem...” http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx 9

  10. Code Phrases for “I Give Up” • “use ORM for the 80% case” • “polyglot persistence” • “right tool for the job” • “use NoSQL where appropriate” • “hybrid approach” 10

  11. Don’t Give Up! Mainstream OO and RDBMS approaches are hopelessly complected. If you simplify them, you will find the building blocks for a general-purpose approach to data 11

  12. OO RDBMS object at a time set at a time processing dictionaries rectangles structure navigation query access over here over there location 12

  13. DRY vs. Rectangular • join table • person table • club table “People can belong to • id key in person table multiple clubs” • person key in join table • club key in join table • id key in club table 13

  14. The “Over There” Problem “the query can be decorated with spans that instruct the persistence layer to fetch related objects at the same time ." http://www.codeproject.com/Articles/20849/ORM-as-Vietnam-of-Computer-Science-A-Response 14

  15. The “Over There” Problem "RoR and the ActiveRecord pattern have deservedly earned a reputation as dbms resource hogs for this reason. Optimized ActiveRecord design is more often than not suboptimal SQL design, because it encourages SQL statement decomposition ." http://stackoverflow.com/questions/404083/is-orm-still-the-vietnam-of-computer-science 15

  16. OO RDBMS processing object at a time set at a time dictionaries rectangles structure navigation query access over here over there location no no programmable? coordinated coordinated perception assist use of transactions action tx system 16

  17. Programmability of SQL? http://imgs.xkcd.com/comics/exploits_of_a_mom.png 17

  18. Programmability of Java? // build generator for the new class String tname = tclas.getName(); ClassPool pool = ClassPool.getDefault(); CtClass clas = pool.makeClass(cname); clas.addInterface(pool.get("IAccess")); CtClass target = pool.get(tname); // add target object field to class CtField field = new CtField(target, "m_target", clas); clas.addField(field); // add public default constructor method to class CtConstructor cons = new CtConstructor(NO_ARGS, clas); cons.setBody(";"); clas.addConstructor(cons); http://www.ibm.com/developerworks/java/library/j-dyn0610/ 18

  19. Coordinating Perception is Insane • I don’t slow down when you watch me • Records are immutable • Reality is cumulative • new time requires new space 19

  20. Transactions are awesome 20

  21. OO RDBMS Imagine! object at a processing set at a time both time dictionaries rectangles any structure navigation query both access over here over there anywhere location no no yes programmable? coordinated coordinated values perception assist use of transactions any action tx system 21

  22. OO RDBMS Imagine! object at a processing set at a time both time dictionaries rectangles any structure navigation query both access over here over there anywhere location no no yes programmable? coordinated coordinated values perception assist use of transactions any action tx system 22

  23. Rebuilding 23

  24. Imagine! processing structure access location programmable? perception action 24

  25. Imagine! processing structure access location yes programmable? Everything is made of data perception action 25

  26. Imagine! processing structure access anywhere location yes programmable? Data is immutable values perception action 26

  27. Imagine! processing structure access anywhere location The fundamental yes programmable? unit of data is the datom: values perception E / A / V / T action 27

  28. Imagine! processing dictionary structure access anywhere location A set of datoms has yes programmable? a 100% mechanical transformation to a values perception dictionary. action 28

  29. Imagine! processing structure dictionary rectangle access anywhere location A set of datoms has yes programmable? a 100% mechanical transformation to values perception rectangles . action 29

  30. Imagine! processing dictionary rectangle structure columns access anywhere location A set of datoms has yes programmable? a 100% mechanical transformation to values perception columns . action 30

  31. Imagine! processing dictionary rectangle structure column graph access anywhere location A set of datoms has yes programmable? a 100% mechanical transformation to a values perception graph . action 31

  32. Imagine! processing dictionary rectangle structure column graph entity access anywhere location A set of datoms has yes programmable? a 100% mechanical transformation to an values perception entity. action 32

  33. Stop Abusing Documents 33

  34. Imagine! processing any structure query access anywhere!! location Datalog has yes programmable? power equivalent to the relational values!! perception algebra action 34

  35. Imagine! set at a time processing any structure query access anywhere!! location yes programmable? Datalog is set-at-a-time values!! perception action 35

  36. Imagine! set at a time, processing tuple at a time any structure query access anywhere!! location yes programmable? core.logic is tuple at a time values!! perception action 36

  37. Imagine! set or tuple at a time processing entity at a time any structure query access navigation anywhere!! location Entity provides yes programmable? generic, lazy values!!!! perception traversal action 37

  38. Imagine! processing any any structure any access anywhere!! location yes programmable? serialized transactions values!!!! perception ACID and easy transactions action 38

  39. Imagine! processing any any structure any access anywhere location transaction functions yes!! programmable? pure functions composable values!!!!!! perception installed in db transactions run anywhere action transaction fns 39

  40. bonus round Imagine! processing any any structure any access anywhere location yes!! programmable? values!!!!!! perception action txes, tx fns 40

  41. bonus round Imagine! processing any time model any structure any access anywhere location yes!! programmable? db.asOf(lastMonth) values!!!!!! perception action txes, tx fns 41

  42. bonus round Imagine! processing any time model any structure scale read and query horizontally any access anywhere location yes!! programmable? values!!!!!! perception action txes, tx fns 42

  43. bonus round Imagine! processing any time model any structure scale read and query horizontally any access “what if” queries anywhere location yes!! programmable? values!!!!!! perception db.with(newData) action txes, tx fns 43

  44. bonus round Imagine! processing any time model any structure scale read and query horizontally any access “what if” queries anywhere location multi-source queries yes!! programmable? values!!!!!! perception action txes, tx fns 44

  45. Imagine! you can play the home game! processing ? simplify structure ? access ? program with values anywhere location fill in your own answers programmable? ? values perception action ? ?? ? 45

  46. "I think that if you if you're going to dump on something in the way many people do about ORMs, you have to state the alternative" http://java.dzone.com/articles/martin-fowler-orm-hate 46

  47. Thanks! @stuarthalloway 47

Recommend


More recommend