Fork me on GitHub

back in june @denik asked the question > "is there a story for a webapp that uses datomic ion and websockets?". i'm very interested in this too. my (webapp) project is very websocket heavy, so AWS API Gateway isn't useful for me. is that a roadblock?

Petrus Theron10:08:44

You might be able to use AWS IoT for this and call out to your Ions as needed, as IoT supports MQTT over websockets:


thanks, i'll look into it!


@U0GC1C09L please keep me post it if you find a good way to make it work

Joe Lane16:08:08

@U0GC1C09L that is exactly what you should do. I demo’ed this myself and its magnificent. I’m working on making a writeup but i need to set up the right blogging system with work first.

Petrus Theron16:08:45

@denik @U0GC1C09L a validating use-case for AWS IoT + Datomic:

👍 4
🚀 3
🔥 1

cheers! this seems to be exactly what i'm looking for. very much looking forward to the tutorial. 🙂

💯 1
Joe Lane18:08:16

Haha, cool, y’all found my twitter account.


Sweet. I actualy have a couple upcoming user stories for exactly this lol

Petrus Theron10:08:23

Is there a way to access the Datalog internals so I can block queries that touch certain attributes? Basically, I want to whitelist attributes for querying or pulling.

Petrus Theron10:08:50

It would be great if there was an intermediate Datalog parser step that returned a list of "compiled attributes" for a given query before being run, so that I could block the query. For wildcards, I'd like to constrain the list of pulled attributes.


i remember seeing someone post a keep-alive wrapper for the datomic SOCKS proxy script. anyone have a link?


I just copied out the advice given earlier in slack (which I was able to find on an archive)


Please feel free to add any experience reports to that thread ^


cheers, thanks Jaret


I am having an issue with transacting a large amount of data in which I keep getting the exception "db.error/transactor-unavailable Transactor not available". I've got along the lines of ~100k objects being transacted using transact-async, each one resulting in about 5-10 datoms. I'm partitioning the data so that I'm performing a large number of small transactions. I've tried a variety of sizes for "small" such that the transaction report queue shows txdata sizes along the lines of 100-10000 datoms depending on how I do my partitioning. It looks like the transactor is being saturated then once it recovers it starts writing again. I've tried setting a high timeout (-Ddatomic.txTimeoutMsec=120000) and that doesn't seem to work. The log does give a warning of "2018-08-22 07:58:07.869 WARN default o.a.activemq.artemis.core.server - AMQ222183: Blocking message production on address 'test-98bbb5cd-6025-4228-aee8-f0ee886d5a82.tx-submit'; size is currently: 263,836 bytes; max-size-bytes: 262,144." Could the problem be an artemis configuration? If so, how would I configure that for datomic? I can't seem to find any information on that. Any ideas? Thanks!


Additional data: I'm using datomic-pro-0.9.5697 with a postgresql backing store configured basically the way the datomic site says to configure it. My current transactor template file has the "recommended settings" for production enabled and write-concurrency=8.


@markbastian If you’re hitting backpressure you need to slow your import and/or wait


Datomic OnPrem doesn’t provide “flow control” in the form of a queue or work limiting in the peer library; if you need that kind of upstream arbitration you need to supply it


Should the use of transact-async just queue up the data in the artemis queues and get picked up eventually?


That was my understanding when I read that before, but I am still pretty new to datomic, especially the transactor.


Ok, I think I figured something out. If I call transact-async and let it do its thing it works very well. I can write hundreds of thousands of datoms in not much more time that it takes to process the data. The issue is when I dereference the future it returns. I want to be able to catch any exceptions in the transaction and it seems like the only way to do this is to eventually deref the future. I tried putting that in another future, but that still seems to block the transactor (or something that gives bad performance).


So, I think my only issue is how I can catch possible exceptions on the transaction without turning it into a blocking operation.


What's the easiest way of reliably scheduling a call to backup-db for a datomic cluster built using the CloudFormation template?


To put it quite clearly, I can do this just fine and it is very perfomant:

(datomic/transact-async conn [[:my "data"]]) ;Assume for the moment that data may or may not be valid.
But if I do this it performs terribly:
    @(datomic/transact-async conn [[:my "data"]])
    (catch Exception e (.printStackTrace e))))
Should I be using core.async as shown here: It still seems like this would dereference the future and you'd have the same issues.


if you don’t deref the future it’s fire and forget


if you need to know whether the transaction failed or not you either have to keep the future and deref it (only tells you if it succeeded, not if it potentially failed) or query for the things later to ensure they got in there


Yeah, my general case is fire and forget and it works very well. I just would like some facility to report an exception if and only if one occurs. I suppose I could put the futures on a queue and occasionally poll them to see if they've been realized and then check for exceptional behavior. Alternatively, if I suspect a problem I could enable derefing the future only in those cases. Thanks for the tips!


Hey, wait... Datomic is reordering query clauses???


There is no feature to re-order clauses. Clause order is up to you. If you’re seeing something unexpected here, please feel free to log a support case to <mailto:[email protected]|[email protected]>


Ok. It's specifically in calling a user function. We have a work-around, but I'll report there.


Is this new?


Hi, I’m looking at Ions to implement business specific layer on top of Datomic to support operations such as money transfer, stock trading (transfer share amounts between accounts), etc. It seems to be good fit, but I’d also like to publish post-commit events to Kafka topics. I think it could be achievable with datomic.Connection.txReportQueue in peer API, but it seems not exist in Client API. Are there alternatives to achieve this in Datomic Cloud?


not at present, but you could poll


Can you write to a queue in a transaction function? Rich was talking about this at Conj party '18. (Be careful not to block in the transactor)


@U09K620SG thx for the idea and I read Ions launch day questions as well. In this case I’d like to capture post-tx so transaction function may not be the best place as I need to consider multiple invocations and tx failure case. @U072WS7PE Is it possible to connect Datomic Cloud DB via Peer API if I run it from VPC peered network to circumvent securities? Suppose it’s possible, would it be considered as “at-your-own-risk” or a proper approach?


@U1QA1G3UH we’re using to stream out transactions and do other stuff with them. @U0509NKGK has a great blog post on how they did it The preferred approach to accessing your datomic endpoint from another VPC is using AWS’ VPC endpoint feature


Hi @U380J7PAQ thx for the info. Onyx datomic plugin had only Peer API until I contributed the PR to support for Datomic Client API and Datomic Cloud in Feb. so I presume you’re using Peer API 🙂 BTW, I decided to use Kafka Streams instead. (And now Distributed Masonry is a part of Confluent!) My question is if there is a way to access Datomic Cloud via Peer API. Yes, I know I can VPC peer, but I’d like to know if accessing Datomic Cloud via Peer API is a) possible, b) supported.