Fork me on GitHub
#datomic
<
2017-06-30
>
favila13:06:55

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

favila13:06:21

what is :offer/function?

favila13:06:37

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

favila13:06:21

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

favila13:06:13

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

favila13:06:24

using it with 4 makes no sense

favila13:06:44

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

timgilbert15:06:28

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?

matan20:06:13

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

matan20:06:28

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?

hmaurer21:06:00

@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.

hmaurer21:06:41

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

hmaurer21:06:35

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

hmaurer21:06:38

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

hmaurer21:06:57

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

favila21:06:07

@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.