Fork me on GitHub
#datomic
<
2017-04-05
>
rnandan27311:04:06

Is it a option to use amazon s3 as a storage option ?

rnandan27311:04:28

as a file storage?

luke12:04:13

@rnandan273 It’s not built into Datomic as one of Datomic’s supported storages. However, it’s pretty common to write an application layer which stuffs larger blobs into S3 and stores content-addressed URIs in Datomic.

rnandan27312:04:06

@luke thanks for your response. I had a customer who is biased towards simpleDB from amazon, so was wondering if i can push datomic with s3 as file storage

luke12:04:41

You’ll still need one of Datomic's offical storages as well. But Amazon DynamoDB sounds like a solid choice for them, then?

rnandan27312:04:38

for them simpleDB is cost effective compared to DynamoDB

luke12:04:22

well all those equations will change when using Datomic, since Datomic stores index segments that are opaque to the underlying DB. It might be more or less expensive than “natively” using whatever storage you chose.

rnandan27312:04:17

the fact is many people don't know about datomic and sometimes i have to do an alternate solution to show the datomic version working better

misha13:04:46

@robert-stuttaford greetings! do you by any chance know how to solve this? https://clojurians.slack.com/archives/C07V8N22C/p1491395330746925

robert-stuttaford13:04:41

i believe they are tested in the order they are declared (in the vector)

robert-stuttaford13:04:59

i can’t speak to possible disparity between Datomic and datascript

misha13:04:13

if there is a hit on dynamic rule - it returns both result and default (there is a snippet in #datascript next to message above)

robert-stuttaford13:04:56

ah, i see. i’m not sure. perhaps one of the Datomic officials can tell you, @marshall or @jaret

misha13:04:55

thinking of it: if there are 2 results on the rule - both are returned as well, so reducing the query result outside a query is somewhat inevitable and is ok...

misha13:04:50

another option would be to add default to each rule implementation as soon, as any clause results to false (nil) - rule "shuts down" and is removed from result set.

camille18:04:05

Any guidance on how I can search for email addresses where I only have the domain name?

robert-stuttaford20:04:28

@camille: (d/q '[:find ?e :in $ ?pattern :where [?e :attr ?v] [(re-find ?pattern ?v]] db (re-pattern "@gmail.com"))

camille20:04:52

thanks @robert-stuttaford !

robert-stuttaford20:04:04

you can use re-pattern to build a regex dynamically from an input string, which is why i include it here despite it being unnecessary in this case

robert-stuttaford20:04:17

because you could just use a regex literal #"@gmail.com"

robert-stuttaford20:04:42

this leverages datalog’s ability to call out to arbitrary functions

camille20:04:26

oh great. i think i was looking for that literal

lvh20:04:36

Is there an equivalent of a gensym inside a rule? Like I have a rule that expands to a few statements and I care that it uses the same value for all matching datoms, but I want that to be invisible externally

lvh20:04:46

maybe that’s the default 🙂