How do Datomic users cope without compound indexes?

At Datomic, how do you efficiently complete queries such as β€œfind all people living in Washington older than 50 years old” (city and age may vary)? Relational databases and most NoSQL databases use composite indexes for this purpose; To my knowledge, Datomic does not support anything like this.

I built several, say, medium-sized web applications, and none of them will run fast enough, if not for composite indexes. How do Datomic users deal with this? Or are they just playing with data sets small enough not to suffer from this? Did I miss something?

+5
source share
3 answers

I wrote a library to handle this: https://github.com/arohner/datomic-compound-index

+2
source

This problem and its solution are not identical in Datomic due to the data structure (dates) in Datomic. There are two characteristics / performance strategies that can add several shades to this:

(1) When you retrieve data in Datomic, you get the entire sheet segment from the index tree (rather than a single item) - segments consist of potentially many thousands of dates. Then it is automatically cached, so you do not need to access the network to get more data.

, .. , , , , EAVT AEVT , . , ( ).

(2) Partitions . ( ) , . , , , .

+2

2019-06-28: 0.9.5927 (Datomic On-Prem)/480-8770 (Datomic Cloud), Datomic , .

0

Source: https://habr.com/ru/post/1547064/


All Articles