Fork me on GitHub
#datomic
<
2018-03-23
>
folcon12:03:12

@marshall Ok, so I might have figured out a work around. I can address and query different datomic databases, so I’m going to try the model of each user having a separate datomic db on the same store. Is there a flaw with this design?

marshall13:03:51

@folcon how many databases are you thinking?

folcon13:03:13

well in our trial period we might end up with a few hundred users

marshall13:03:07

Datomic On-Prem is designed to have a single primary db behind the transactor. a few ‘housekeeping’ dbs in addition would be OK, but having many dozens of active databases isn’t recommended

marshall13:03:10

@folcon one second - I had a chance to look at the REST api and was able to run the query I wrote yesterday

marshall13:03:12

[:find ?filtecount 
 :in $ 
 :where [(datomic.api/filter $ (fn [_ datom] (< 20 (.e datom)))) ?f_db] 
        [(datomic.api/q (quote [:find (count ?ents) 
                                :where [?ents :db/doc]]) ?f_db) [[?filtecount]]]] 

marshall13:03:29

@folcon ^ the cast issue was from passing a function as an arg

marshall13:03:34

if you put it inline in the query it works fine

folcon13:03:02

Hmm, that limitation is rather irritating, here I thought I’d found a the perfect way to ensure user data remained separate while still being able to query across it :(…

marshall13:03:36

you should still be able to do that; you can parameterize constants inside the function (i believe)

folcon13:03:50

ok, I’m currently in the middle of something else, but I’ll be able to give that a go in an hour and a half :)… Definitely going to give that a shot. Thank you!

folcon13:03:29

I’m concerned that if I can’t pass the function as a parameter I’m going to have to do query mangling with strings/datastructures

marshall13:03:42

what language are you coming from?

marshall13:03:31

i believe i was mistaken - you can’t parameterize constants within the nested filter predicate I dont think

folcon13:03:34

My backend is python based

folcon15:03:54

frontend clojurescript 🙂

folcon16:03:07

Thanks, I’m going to unpack this and see if I can work out how to get the rest of my queries to use this filtering technique :)…

James Vickers23:03:02

What storage services do most people seem to use for on-prem? Do a lot of you use Cassandra or is it pretty much all SQL?