Fork me on GitHub

Hi, I'm trying to bootstrap datomic using cassandra underneath. I've locally set up a 3 node cluster using the tool ccm, configured a cass transactor and have been able to use the datomic shell to create a database using the uri. However in my lein project I'm seeing errors upon trying to get a connection or create a database: NoSuchFieldError DEFAULT_MAX_PENDING_TASKS<init> ( java.lang.RuntimeException: java.lang.reflect.InvocationTargetException com.datastax.driver.core.NettyUtil.newEventLoopGroupInstance com.datastax.driver.core.NettyOptions.eventLoopGroup com.datastax.driver.core.Connection$Factory.<init> com.datastax.driver.core.Cluster$Manager.init com.datastax.driver.core.Cluster.init com.datastax.driver.core.Cluster.connectAsync com.datastax.driver.core.Cluster.connectAsync com.datastax.driver.core.Cluster.connect And from the cassandra log: INFO [main] 2017-08-30 18:12:36,574 - Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it INFO [Native-Transport-Requests-1] 2017-08-30 18:13:57,297 - Unexpected exception during request; channel = [id: 0xc819135d, L:/ ! R:/]$NativeIoException: syscall:read(...)() failed: Connection reset by peer at Source) ~[netty-all-4.0.44.Final.jar:4.0.44.Final] INFO [MigrationStage:1] 2017-08-30 18:14:31,868 - Initializing datomic.datomic INFO [HANDSHAKE-/] 2017-08-30 18:18:10,274 - Handshaking version with / WARN [Native-Transport-Requests-2] 2017-08-30 18:18:10,277 - Trigger directory doesn't exist, please create it and try again. I've followed carefully all the datomic docs and, again, the local shell can create a database which I can see in the datomic console but nothing works when trying to connect via a lein project in the repl. Any ideas?


K, looked like the datomic docs are out of date on the driver they instruct you to use. Its listed as 3.1.0 and 3.3.0 appears to work fine


Is there anyway to force a transactor to start, even though it complains about “Requested object beyond end of cache at 14” ?

dazld13:08:17 - would be cool if others would like to contribute, or it'll just end up being my list of bookmarks 🙂


Is anyone using Datomic on a cloud platform other than AWS? For political reasons amazon is not an option where I work.


I am planning on using it on google cloud


(have exprimented a little with it but I don’t have a full setup yet)


The big question is which storage backend to use. With DynamoDB out of the question, you're left with Cassandra and SQL. Do you have operational experience with either Cassandra or a SQL database in the Google cloud?


I think the issue with google cloud is the lack of long running sessions.


@U30H25RT6 the fact that google cloud storage isn’t supported by the backup protocol is also annoying


I have a use case where it would make sense to have up to ~100,000 values for a multivalued string attribute. Is there a limit on the number of values? Should I expect slowness or other practical problems?


I'd set :no-history on that attribute


it won't see a ton of churn


oh, I guess I didn't understand the question fully before I replied


@ljosa There shouldn’t be any specific issue other than if you, i.e. pull * on that attribute you will get a lot back, so it could slow things down in that respect


cool, then we'll try it out in dev. thanks!


does anybody have some good examples of buddy+datomic projects?


@dimovich which uses of Buddy in particular?


@hmaurer for a webapp, I need to authenticate users


@dimovich I havent used buddy (clojure beginner here) but I doubt it is tied to a particular database backend. Just looking quickly at the doc it seems that it lets you define your own auth functions, in which you are free to make calls to Datomic.


Take what I say with a grain of salt, but for example you could first define a function which fetches a user from Datomic, like this:

(defn- get-by-credentials [db username password]
  (let [query '[:find ?e
                :in $ ?username ?password
                :where [?e :user/username ?username]
                       [?e :user/password ?password]]]
    (ffirst (datomic/q query db username password))))


Note of course that regardless of the underlying storage medium, you should never store a password in cleartext, it should always be salted and securely hashed.


Then, assuming you are using Http-Basic auth:

(require '[buddy.auth.backends :as backends])

(defn my-authfn
  [request authdata]
  (let [db (:db request)
         username (:username authdata)
         password (:password authdata)
         user (get-by-credentials db username password)]

(def backend (backends/basic {:realm "MyApi"
                              :authfn my-authfn}))


Why doesn't datomic also refers to itself as a time-series DB? Doesn't being immutable and being able to query data by time make it a time-series DB too?


@U06GS6P1N out of curiosity, do you have a preferred approach to version data? especially when versioning relationships


@hmaurer not really. I don't have a one size fits all answer, I do it in an ad hoc way.