Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Time and Concurrency

Jason Lewis
September 30, 2015

Time and Concurrency

Presentation for Baltimore Innovation Week 2015 DevDay.
Original Reveal.js slides at http://decomplecting.org/time-and-concurrency

Jason Lewis

September 30, 2015
Tweet

More Decks by Jason Lewis

Other Decks in Programming

Transcript

  1. CONCURRENCY Really, ( > = t h i n g

    s 3 ) Concurrency Parallellism Distributed systems ...
  2. Even in the simplest web application, we need to consider

    at least 3 things: the server, the browser, and the user.
  3. Code Sharing ( d e f n s t r

    - > i n t [ s ] # ? ( : c l j ( j a v a . l a n g . I n t e g e r / p a r s e I n t s ) : c l j s ( j s / p a r s e I n t s ) ) )
  4. DATOMIC EAVT tuple store database. ACID transactions. Immutable data =

    strong consistency + horizontal read scalability. Writes are not update-in-place; all data is retained by default. Makes time part of the database itself.
  5. Since Datomic retains the history of the db state, we

    can query the db as-of any given point in time. Since it treats the db as a value, and uses the same persistent data structures as Clojure itself, we can also query the future, by joining arbitrary data to a given db value.
  6. IT GETS BETTER... ( q ' [ : f i

    n d ? t i t l e : w h e r e [ ? e : m o v i e / y e a r 1 9 8 7 ] [ ? e : m o v i e / t i t l e ? t i t l e ] ] ) Datomic's datalog queries are just vectors, which means they can be passed around like any other of Clojure's persistent data structures... even from the browser to the server.
  7. Pure functions acting on immutable data structures shared between client

    and server. Peers keep a hot copy of the db as a value in memory Reads and writes are orthogonal