Fork me on GitHub
#datomic
<
2018-01-10
>
timgilbert00:01:54

If the query bit is quoted, you need to pass your values into it, like:

(d/q '[:find
       (pull ?e [:job/doc-num num])
       :in $ num
       :where
       [?e :job/job-num "01"]]
     db (:job/filing-date :default ""))

souenzzo11:01:53

quote on '(:job/filing-date :default "")

conan13:01:29

I'm trying to run a transactor on Heroku. The transactor is up and running and my peer can connect to storage to retrieve the host and alt-host values, but it cannot connect to the transactor. I can't telnet to the transactor using its port either. Can anybody help with this? I suspect it's similar to running a dockerised setup. ActiveMQNotConnectedException AMQ119007: Cannot connect to server(s). Tried with all available servers. org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory (ServerLocatorImpl.java:799)

conan13:01:09

The full error looks like this:

ActiveMQNotConnectedException AMQ119007: Cannot connect to server(s). Tried with all available servers.  org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory (ServerLocatorImpl.java:799)
                                                                  clojure.core/eval                core.clj: 3206
                                                                                ...                              
                                                                      user/eval2432               REPL Input     
                                                        datomic.api/create-database                 api.clj:   19
                                                        datomic.Peer.createDatabase               Peer.java:  117
                                                                                ...                              
                                                       datomic.peer/create-database                peer.clj:  764
                                                       datomic.peer/create-database                peer.clj:  772
                                                    datomic.peer/send-admin-request                peer.clj:  752
                                                 datomic.peer/send-admin-request/fn                peer.clj:  760
                               datomic.connector/create-transactor-hornet-connector           connector.clj:  320
                               datomic.connector/create-transactor-hornet-connector           connector.clj:  322
                                            datomic.connector/create-hornet-factory           connector.clj:  142
                                               datomic.connector/try-hornet-connect           connector.clj:  110
                                      datomic.artemis-client/create-session-factory      artemis_client.clj:  114
org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory  ServerLocatorImpl.java:  799
org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException: AMQ119007: Cannot connect to server(s). Tried with all available servers.
    type: #object[org.apache.activemq.artemis.api.core.ActiveMQExceptionType$3 0x5d70be8d "NOT_CONNECTED"]
                                        clojure.lang.ExceptionInfo: Error communicating with HOST 0.0.0.0 or ALT_HOST  on PORT 3206
           alt-host: ""
    encrypt-channel: true
               host: "0.0.0.0"
           password: <redacted>
       peer-version: 2
               port: 3206
          timestamp: 1515588947255
           username: <redacted>
            version: "0.9.5561.50"

conan13:01:51

I realise this is probably a networking problem, but I've been trying to get a Datomic transactor running for a long time now and still haven't managed it.

conan13:01:18

Maybe something in here is responsible, such as TCP routing? https://devcenter.heroku.com/articles/http-routing#not-supported

James Vickers23:01:14

Probably like some other people, I am curious how the architecture of a single Transactor affects performance. Does the Transactor have any multi-threaded aspects (like accepting data from Peers in parallel)? Can someone draw a (conceptual) comparison of how the write performance of Datomic would compare to a regular SQL database (e.g. PostgreSQL)?

val_waeselynck07:01:56

From a Rich HIckey talk I saw a few months ago: the Transactor does leverage several threads, but not via parallelism - via 'pipelining' instead. E.g one thread for unmarshalling the transaction requests, one for running the transactions serially, one (or maybe more) for indexing, one for sending updates to the Peers, etc.

val_waeselynck07:01:13

A regular SQL database will use locking for coordination, i.e reads will slow down writes and writes will slow down reads. Datomic won't have this problem, however I reckon its indexing cost is probably higher - i.e for an extreme use case where you only ever want to write serially and not read, PG will probably have higher throughput.

souenzzo11:01:43

It's important to say that if you application has TO MANY writes, it may not fit with datomic...

val_waeselynck16:01:33

@U2J4FRT2T I would nuance this statement as follows: if your application has too much data / too many writes, not all of it can go in Datomic.