Fork me on GitHub

[(missing? $ _ :offer/function ?fid)] works? I'm surprised


what is :offer/function?


:functions/functiontypeid and :functiontype/functiontypeid are meant to be joined by value?


I think you may want (not [_ :offer/function ?fid]) instead of missing?, but it's not clear to me what the relationships are and what you want do to


missing? has only 3 arguments: db, entity, and attribute


using it with 4 makes no sense


That's why I wouldn't expect this to work at all


Hey all, I recall seeing an open-source project mentioned here that would save and restore a datomic database in memory (for use in writing tests). I've forgotten the name of it and my google-fu is failing me, can anyone help me?


Hi, I am considering using datomic for the first time (hurray!)


Can someone please remind me whether using datomic, my code needs to have a say about how data is stored, or whether it only needs to suffice with pushing and querying data (datalog?) letting datomic figure how to "best" store the data on the given storage backend being used?


@matan I am new to Datomic too but I’ll try to answer your question. Your code does not “have a say in how the data is stored” on a low level. When you commit a transaction, the Datomic transactor will store that transaction in the backend storage, and periodically update the indexes. There are, if I recall correctly, 4 types of indexes, each of which optimises querying the data in specific ways.


As far as I understand, your data is stored in the exact same way on all backend storages: as binary blobs of “segments” of the index


So Datomic will not try to take advantage of Postgresql’s or DynamoDB’s query features. Instead it will store its data in raw, compressed binary blobs. When you do a query, it will fetch the relevant blobs from the index and execute your query locally, in the peer


Now, you can define some attributes as “indexed”. You will have to read on exactly what this does as I am not familiar with it, but roughly speaking I think it indicates that those attributes should be stored in the AVET index (one of the 4 indexes), and access to those attributes will therefore have better performance


That’s about it in terms of control on how the data is stored, as far as I know


@matan Backend storage is (from datomic's POV) nearly a pure key+value store of string keys to binary blobs. The store must support atomic updates. No store-specific features are used beyond that.