As this is my first post on this forum: Hi!
In my work developing custom web applications for small customers I’m finding that these web apps are more and more used from mobile devices, with sometimes flaky or non-existent Internet connections, the ideal solution to that problem is to build these applications as an offline-first webapp.
This means that ideally I would have a database in the browser that would at least give me enough query power to do CRUD like applications: getting a list (sorting and filtering), insert, update and delete, joins… (think for example Django Admin).
Then the databases would need to be synchronized with each other. I first looked into solutions like PouchDB to do that, but while researching I was coming to the conclusion that it would be much simpler to describe all changes to the database as a stream of events of schema and data changes (as in event sourcing). This would solve the synchronization problem: clients would get all the events since the last synchronization and afterwards append the uncommitted locally generated events to the stream; and do some conflict detection in between (see CQRS). I’ve found some ready to use event stream servers that could be used out of the box (although of course one could implement it fairly easily in PureScript or Haskell some day).
So what’s left to do would be to define a DSL for schema and data. I was thinking of something fairly simple as the GraphQL schema language. That would be generic enough that a “backend” could be implemented in everything from IndexedDB to relational databases. As somebody who likes types I would want to keep a typed schema.
As you can see this becomes quite a project on itself, but I think that it would be manageable to build this in PureScript.
So here comes my first question: Am I making sense? Is something like this already done? Would you like to help on this project?
 My inspiration came from ACID state (Haskell), Postgres WAL log, Martin Kleppmann, Greg Young, and I’ve found https://debezium.io/ in the meanwhile, and probably many others.
migration :: Schema V1 -> Schema V2 etc.
 Free software and developed in the open of course!