top | item 43434213

(no title)

tonsky | 11 months ago

It’s not as simple as you make it sound:

- Reliable communication is hard - Optimistic writes should on client are hard - Tracking subsets of data is hard (you don't want the entirety of Datomic on the client, do you?) - Permissions are hard in this model

Why didn't I implement it? Mostly comes down to free time. It's a hobby project and it's hard to find time for it. I also stopped writing web apps so immediate pressure for this went away.

discuss

order

avodonosov|11 months ago

> - Optimistic writes should on client are hard

This is out of scope - I don't mean a functional equivalent of instantdb. Just a database in browser.

> - Reliable communication is hard

The same, no special requirements. Just send a request, maybe retry several times (with increasing delays), and give up throwing an error.

> Tracking subsets of data is hard (you don't want the entirety of Datomic on the client, do you?)

That's the only thing really missing. And it doesn't seem hard. I think Datomic Peer just keeps a fixed number of index pages in cache. Pages missing in the cache are just retrieved from storage.

In result the cache keeps the working subset - the elements related to the entities needed for queries and entity api requests made by the application. Especially since the indexes are ordered (EAVT, AEVT, AVET, VAET), much of the data in the cache will be relevant to the application.

> - Permissions are hard in this model

Permission is a question, but there are useful applications where permission control is not needed.

Similar to what you say in another comment about conflict resolution: "Another misconception is that conflict resolution needs to be “solved” perfectly before any progress can be made. That is not true as well. You might have unhandled conflicts in your system and still have a working, useful, successful product."

Back in the day when DataScript first appeared and I was eager to see it working with larger-than-memory datasets (and maybe even reading data saved by Datomic by understanding its format), I wanted that to enable public to run queries (read-only) on a large database I was assembling, that didn't fit into memory.

In some applications all users may have equal write access to the document / data.

Server-side usage of DataScript could be another case that does not require permissions support in the DB. That's how Datomic itself is used.

I am not complaining, and understand there are limits on what people can do in free time. You did huge work on your open source projects. But I regretted that seemingly a small step to open DataScript to out-of-memory data, which I though would greatly expand its applicability, was missing.

Good luck with instantdb. Hopefully commercial success will allow to continue putting work in it and improve the tech landscape.