Fork me on GitHub
#datomic
<
2017-08-31
>
georgek00:08:38

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 io.netty.channel.epoll.EpollEventLoop.<init> (EpollEventLoop.java:84) java.lang.RuntimeException: java.lang.reflect.InvocationTargetException Throwables.java:160 com.google.common.base.Throwables.propagate NettyUtil.java:136 com.datastax.driver.core.NettyUtil.newEventLoopGroupInstance NettyOptions.java:96 com.datastax.driver.core.NettyOptions.eventLoopGroup Connection.java:713 com.datastax.driver.core.Connection$Factory.<init> Cluster.java:1381 com.datastax.driver.core.Cluster$Manager.init Cluster.java:163 com.datastax.driver.core.Cluster.init Cluster.java:334 com.datastax.driver.core.Cluster.connectAsync Cluster.java:309 com.datastax.driver.core.Cluster.connectAsync Cluster.java:251 com.datastax.driver.core.Cluster.connect And from the cassandra log: INFO [main] 2017-08-30 18:12:36,574 CassandraDaemon.java:527 - 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 Message.java:619 - Unexpected exception during request; channel = [id: 0xc819135d, L:/127.0.0.3:9042 ! R:/127.0.0.1:57026] io.netty.channel.unix.Errors$NativeIoException: syscall:read(...)() failed: Connection reset by peer at io.netty.channel.unix.FileDescriptor.readAddress(...)(Unknown Source) ~[netty-all-4.0.44.Final.jar:4.0.44.Final] INFO [MigrationStage:1] 2017-08-30 18:14:31,868 ColumnFamilyStore.java:406 - Initializing datomic.datomic INFO [HANDSHAKE-/127.0.0.3] 2017-08-30 18:18:10,274 OutboundTcpConnection.java:560 - Handshaking version with /127.0.0.3 WARN [Native-Transport-Requests-2] 2017-08-30 18:18:10,277 FBUtilities.java:336 - 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?

georgek01:08:27

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

laujensen11:08:17

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

https://github.com/dazld/awesome-datomic - would be cool if others would like to contribute, or it'll just end up being my list of bookmarks 🙂

gdeer8116:08:52

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

hmaurer18:08:15

I am planning on using it on google cloud

hmaurer18:08:44

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

ljosa19:08:28

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?

gdeer8122:08:04

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

hmaurer22:08:30

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

ljosa17:08:07

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?

gdeer8117:08:55

I'd set :no-history on that attribute

ljosa18:08:31

it won't see a ton of churn

gdeer8118:08:00

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

marshall19:08:07

@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

ljosa19:08:50

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

dimovich22:08:34

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

hmaurer22:08:09

@dimovich which uses of Buddy in particular?

dimovich22:08:35

@hmaurer for a webapp, I need to authenticate users

hmaurer22:08:35

@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.

hmaurer22:08:37

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))))

donaldball00:09:34

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.

hmaurer22:08:42

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)]
    user))

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

johnj23:08:41

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?

hmaurer15:09:54

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

val_waeselynck18:09:43

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