Fork me on GitHub
#datomic
<
2018-12-03
>
PB02:12:46

Anyone know where I can find examples of ions with a ring/pedestal handler?

rnandan27308:12:21

How do we justify Datomic vs Amazon QLDB. Some features look similar. Any ideas?

4
jeroenvandijk09:12:04

Maybe you can elaborate on how they look similar? I don't see the similarities so much

rnandan27309:12:01

@jeroenvandijk immutable, history, sure datomic supports rich querying capabilities,

jeroenvandijk10:12:57

I would surely miss those rich querying capabilities, the flexible data modelling, integration with Clojure etc. I would also be very curious for the first production experience reports on the new Database and how people are using it.

val_waeselynck12:12:19

Writes expressiveness and speculative writes are also a big deal

Chris Bidler12:12:24

I hope this doesn’t come across as overly cynical; I haven’t had my coffee yet this morning. That said, if someone is asking you to “justify” Datomic over QLDB as a choice for your system of record, my immediate tack would be to investigate why I was stuck trying to get all my architecture decisions past someone whose default position is “but AWS service exists and it’s close, use that.”

jeroenvandijk12:12:36

I think the reverse question is more in order at the moment. That begin said, I wouldn't feel the need to justify anything lol 🙂

Chris Bidler12:12:49

The second thing I would say, though, is “QLDB is clearly, both in terms of released features and in terms of AWS’ own documentation about it, meant to be the backing store for an immutable ledger, e.g., a managed, centralized deployment of “blockchain!“. We aren’t building “blockchain!” with this effort, are we? Please tell me because if we are I need to go short my RSUs.”

potetm12:12:35

qldb appears to be indexed

potetm12:12:42

not the same a blockchain

potetm12:12:10

Also: All of your decisions should be justifiable compared to other options.

potetm12:12:22

There’s nothing wrong with someone asking questions. Those are usually helpful when trying to think through your options.

jeroenvandijk12:12:49

My first answer would be they are two different things and you should try both to see the difference, if you don't see the difference already. I would for instance have to try QLDB to fully understand it's implications

Chris Bidler12:12:04

@potetm I was being snarky and reading perhaps too much into the original question’s formulation of “How do I justify Datomic vs. QLDB” - which seems to me to describe less an honest question and more a “nobody ever got fired for buying AWS” reaction

Chris Bidler12:12:57

And my dim view of all things ledger-y is of course also just snark and deep suspicion of hype. There are plenty of great applications for ledgers and I’m sure that if the OP is building one of those, QLDB is in the running for a backing technology of choice. My initial take was that either they aren’t and someone is asking them, essentially, “but you said Datomic is great because it’s immutable; well this new QLDB thing is immutable too, so why can’t we use that instead?” or that they are building a ledger and then my question is “do you know why you need a ledger for this application or are you on the ’chain train?” 😇

cjsauer15:12:17

I don’t think being indexed disqualifies QLDB as not being a blockchain technology necessarily (see nanocurrency). From the surface, it seems like one of the main practical differences between using Datomic or QLDB is the ability to cryptographically verify your ledger history out of the box. If the application needs this sort of functionality it might be worthwhile to forego the read/write expressiveness etc that Datomic offers and use something more tailor fit for that use case.

cjsauer15:12:16

That said, this could probably be implemented on top of Datomic, but that’s additional development effort.

cjsauer15:12:32

Datomic’s datom limit may also be something to consider when choosing Datomic

Joe Lane16:12:52

@cjsauer What Datom limit are you referring to? Can you add a reference to where you read this?

cjsauer16:12:02

@joe.lane I’ve heard that larger databases can become problematic, but according to this post it isn’t a “hard” limit: https://forum.datomic.com/t/datomic-cloud-datom-limits/473

cjsauer16:12:11

HCA gave a talk at this year’s Conj that showed how they were hot swapping Datomic databases after they had “filled up”. But as @marshall says in that post, it may be a “data shape/usage” constraint.

Joe Lane16:12:41

Hmm, I must have missed that part of the conj. I’ve run multi-tenant datomic cloud databases in production and its pretty seamless.

Joe Lane16:12:10

Thanks for the reference, was the talk referring to on-prem or cloud?

Alex Miller (Clojure team)16:12:51

I think it was on-prem, and a lot of the things they were encountering are unlikely to be issues w/cloud

cjsauer16:12:24

Yeah I believe it was on-prem as well, but don’t quote me.

cjsauer16:12:43

> a lot of the things they were encountering are unlikely to be issues w/cloud This is good to know. Do you have a specific example @alexmiller? I ask so that I don’t propagate any misinformation regarding the latest and greatest.

Alex Miller (Clojure team)16:12:15

well with db size, a single cloud system can support many dbs, so the size thing has more ways to mitigate

Alex Miller (Clojure team)16:12:29

and I think they were talking about restart time or something, which is a non-issue

Alex Miller (Clojure team)16:12:38

sorry, I didn’t catch the whole talk

cjsauer16:12:45

That makes sense. Hot swapping to a new db might just be a config change in Cloud.

Alex Miller (Clojure team)19:12:55

I don’t think you even need to do that - one cloud instance can host many dbs so don’t think you need to change any config at all, just prob an app issue.

grzm19:12:42

Talking with @marshall at the Conj, I recall him mentioning a potential issue using the new aws api with Datomic cloud until the next version of Datomic is released, though I think it was limited in scope. I don’t remember the details, however. Can anyone fill in the gaps in my memory?

marshall19:12:06

That’s Correct. The currently available release of Cloud uses an older version of an http client that will not work with aws-api

marshall19:12:45

Thus you can’t run the aws-api in ions right now

grzm19:12:40

Thanks, @marshall for confirming. Any word from AWS on when the next version might drop?

marshall19:12:01

i don’t have an update there

marshall19:12:05

as soon as possible

👍 8
💯 8
Jonathan21:12:45

@solussd I saw your thread about no such var errors in datomic client api from few weeks ago

Joe R. Smith21:12:27

hmm, do you have a link? I must have gotten past it.

Joe R. Smith21:12:00

oh, here in the datomic channel

Joe R. Smith21:12:09

That was someone elses issue, iirc.

Jonathan21:12:09

Did you ever find a resolution there? I’m having a very similar issue with a basic datomic connection

Jonathan21:12:13

For dependencies I have

[[org.clojure/clojure "1.8.0"]
                 [com.datomic/client-pro "0.8.28"]
                 [com.datomic/client-impl-shared "0.8.28"]]

Jonathan21:12:48

And then I require like

(ns datomic-client-example.core
  (:require  [datomic.client.api :as client-api]))

Jonathan21:12:43

And then do this,

(def cfg {:server-type :peer-server
          :access-key "..."
          :secret "..."
          :endpoint "localhost:9001"})
(client-api/client cfg)

Jonathan21:12:08

the first time the error was CompilerException java.lang.RuntimeException: No such var: p/recent-db, compiling:(datomic/client/api/async.clj:101:9)

marshall21:12:12

Take out the dep on client-impl-shared

Jonathan21:12:32

but now it’s CompilerException java.lang.Exception: namespace 'datomic.client.api.async' not found, compiling:(datomic/client/api/sync.clj:16:1) every time

marshall21:12:41

@jonathan617 Take out the dep on client-impl-shared

marshall21:12:52

And restart your repl

Jonathan21:12:28

@marshall thanks, I did that, and now it does this

datomic-client-example.core=> (client-api/client cfg)
2018-12-03 15:57:14.299:INFO::nREPL-worker-0: Logging initialized @11630ms

CompilerException java.lang.RuntimeException: Unable to resolve symbol: int? in this context, compiling:(datomic/client/impl/shared.clj:349:13)
datomic-client-example.core=> (client-api/client cfg)

CompilerException java.lang.Exception: namespace 'datomic.client.impl.shared' not found, compiling:(datomic/client/api/sync.clj:16:1)
datomic-client-example.core=>

marshall21:12:01

That client version may require clojure 1.9 not sure

Jonathan22:12:10

oh geez let me try that

Jonathan22:12:18

yep that was it

👍 4
Jonathan22:12:24

thanks 🙂

steveb8n22:12:17

Q: do component entities maintain a sort order? I suspect so and I want to rely on it but I can’t find any docs on this

Joe Lane23:12:08

@dustingetz (and anyone who cares) I just used that library in combination with https://github.com/walmartlabs/lacinia-pedestal to serve graphql from api-gateway using pedestal for interceptors and web related stuff and then lacinia-pedestal for my resolvers and gql stuff. Datomic cloud for the database the resolvers work upon. Works against apigw with curl but graphiql doesn’t work because apigw hasn’t released their new websocket support yet. Soon I’m sure. That being said, because I’m using pedestal I can run graphiql locally and have this whole stack running on my laptop (except for datomic cloud of course, may be able to mock it but haven’t invested in that yet.)

steveb8n23:12:08

@joe.lane that’s good to know. I’m using AppSync with Ions but I suspect lacinia-pedestal might have less overall complexity. I’m curious why graphiql needs websocket support? I’m using it in my re-frame client and I don’t see any websocket requests

steveb8n23:12:15

do you mean for subscriptions?

Joe Lane23:12:32

The lower complexity is exactly why I wanted to do this.

Joe Lane23:12:43

I’ll confirm the behavior

Joe Lane23:12:50

Can I ask what re-frame client you’re using?

Joe Lane23:12:56

I’ve been eyeing re-graph

steveb8n23:12:24

I’m currently using artemis but I’m gonna spike re-graph and sub-graph as a replacement - again to reduce complexity. artemis does not appear to be originally designed for re-frame

steveb8n23:12:45

and using shadow-cljs to add graphiql via npm

Joe Lane23:12:44

Once apigateway releases websocket support (🤞 soon) I’ll probably write my own subscription streamer and have a serverless graphql stack.

Joe Lane23:12:34

I think my problem is that I’m not serving the assets from the right place, thanks for the feedback. I saw websocket errors and assumed thats why it wasn’t working. Just confirmed I get those locally as well so I may be able to still get it to work!

steveb8n23:12:03

agreed, it should work. it could be the first request which is an OPTIONS instead of a GET that is breaking via apigw

steveb8n23:12:28

I think that request reads the meta-data for your GQL schema

steveb8n23:12:07

I’d really like to know if you can make that work. it’ll be one more data-point to convince me to switch over

Joe Lane23:12:52

I’m gonna hack on this, will let you know tomorrow or later tonight.

Joe Lane23:12:14

I think its possible, i’m just not correctly exposing the assets directory

steveb8n23:12:28

great thanks. btw if you need subscriptions sooner, you could always use AppSync just for the subs and accept the extra complexity in a constrained area

steveb8n23:12:49

although I haven’t tried appsync subscriptions with Ions so not sure if it works

Joe Lane23:12:52

graphiql is being included from lacinia-pedestal on my behalf. Its configured on rn but I can turn it off in prod mode.

Joe Lane23:12:45

appsync + ions works, the subscriptions only work if you mutate through appsync though. Thats why I want this to be backed by lacinia, my ions can then send outbound updates if changes occur outside the purview of appsync’s graphql api.

👍 4