Architecture - kovasb/session GitHub Wiki
notes on architecture
Session is a Datastructure
A Datomic database, built up by the Session UI or other processes.
Defined by a Datomic schema
Purpose: convey sequences of computations
record sequence of computations (request and result pairs)
store the location of values, so that user code doesn't need to think/talk about places
allow for annotation of computations, via user and ecosystem-defined schema attributes
provide transaction stream for services to listen and react to
services speak to session via transactions, but can be or do anything (storage, hadoop, queues, etc)
Services interact via the Session datastructure
UI transacts a request, evaluator listens to transaction stream to detect it and take action.
Evaluator transacts a result, UI finds it in the tx stream and pushes it into the UI
Don't store large data directly
Instead coordinate the evaluator service with the storage service. (work in progress)
UI is simple wrapper of the Session datastructure
Represent UI elements as edn data
User-created content and session UI made of the "same stuff"
Perceive session and user content without relying on reproducing/reinitializing state
Stateless, as much as possible
Stateful UI can store its own state in datomic, with its own attributes
UI should reflect the current state of database
modulo new user input which waiting to be transacted
stream transactions into UI and update display as needed
because we have history, can recover previous version of session