<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Datomic Knowledgebase - Recent questions without answers</title>
<link>https://ask.datomic.com/index.php/unanswered</link>
<description>Powered by Question2Answer</description>
<item>
<title>Ion push failing with error message about (missing?, unreadable?) maven artifact ion-1.0.47.jar</title>
<link>https://ask.datomic.com/index.php/1890/failing-error-message-about-missing-unreadable-maven-artifact</link>
<description>&lt;p&gt;Attempting to push an ion and get an error about not finding (or unable to read) &lt;code&gt;ion-1.0.47.jar&lt;/code&gt;. I tried some troubleshooting and I don't think it is a permissions issue, because I am able to use the aws cli and copy &lt;code&gt;ion-0.9.7.jar&lt;/code&gt;. So why is 1.0.47 not working?&lt;/p&gt;
&lt;p&gt;deps.edn:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:mvn/repos {&quot;datomic-cloud&quot; {:url &quot;s3://datomic-releases-1fc2183a/maven/releases&quot;}}

 :aliases {
           :ion-dev {:deps {com.datomic/ion-dev {:mvn/version &quot;1.0.352&quot;}
                            com.datomic/client-cloud {:mvn/version &quot;1.0.131&quot;}
                            com.datomic/ion {:mvn/version &quot;1.0.71&quot;}}
                     :main-opts [&quot;-m&quot; &quot;datomic.ion.dev&quot;]}}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;command I'm trying to run:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clojure -M:ion-dev '{:op :push :creds-profile &quot;byt-wrought-test&quot; :region &quot;us-west-2&quot;}'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:command-failed
 &quot;{:op :push :creds-profile \&quot;byt-wrought-test\&quot; :region \&quot;us-west-2\&quot;}&quot;,
 :causes
 ({:message
   &quot;Failed to read artifact descriptor for com.datomic:ion-http-direct:jar:1.0.47&quot;,
   :class ArtifactDescriptorException}
  {:message
   &quot;Could not transfer artifact com.datomic:ion-http-direct:pom:1.0.47 from/to datomic-cloud (s3://datomic-releases-1fc2183a/maven/releases): Unexpected error downloading artifact from datomic-releases-1fc2183a&quot;,
   :class ArtifactResolutionException}
  {:message
   &quot;Could not transfer artifact com.datomic:ion-http-direct:pom:1.0.47 from/to datomic-cloud (s3://datomic-releases-1fc2183a/maven/releases): Unexpected error downloading artifact from datomic-releases-1fc2183a&quot;,
   :class ArtifactTransferException}
  {:message
   &quot;Unexpected error downloading artifact from datomic-releases-1fc2183a&quot;,
   :class ExceptionInfo,
   :data
   {:bucket &quot;datomic-releases-1fc2183a&quot;,
    :path
    &quot;maven/releases/com/datomic/ion-http-direct/1.0.47/ion-http-direct-1.0.47.pom&quot;,
    :reason :cognitect.anomalies/fault}})}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Based on some conversations I found on slack and datomic dev forum, I tried this as a troubleshooting step:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;aws --profile byt-wrangle-test s3 cp s3://datomic-releases-1fc2183a/maven/releases/com/datomic/ion/0.9.7/ion-0.9.7.jar .

download: s3://datomic-releases-1fc2183a/maven/releases/com/datomic/ion/0.9.7/ion-0.9.7.jar to ./ion-0.9.7.jar
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and that works. But the same attempt with 1.0.47 does not:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;aws --profile byt-wrangle-test s3 cp s3://datomic-releases-1fc2183a/maven/releases/com/datomic/ion/1.0.47/ion-1.0.47.jar .
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Ions</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/1890/failing-error-message-about-missing-unreadable-maven-artifact</guid>
<pubDate>Tue, 19 May 2026 19:40:21 +0000</pubDate>
</item>
<item>
<title>Using a collection of datoms as input to a query</title>
<link>https://ask.datomic.com/index.php/1089/using-a-collection-of-datoms-as-input-to-a-query</link>
<description>&lt;p&gt;I was wondering if there is a way to use a collection of datoms obtained from &lt;code&gt;d/tx-range + get a single tx&lt;/code&gt; or received from a listener that subscribed to a tx queue as input to &lt;code&gt; d/q&lt;/code&gt;? The nature of this collection looks very similar to history db which can be used with &lt;code&gt;d/q&lt;/code&gt;, however passing this collection as input does not produce the expected result. Neither there is any error.&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/1089/using-a-collection-of-datoms-as-input-to-a-query</guid>
<pubDate>Thu, 24 Apr 2025 12:51:36 +0000</pubDate>
</item>
<item>
<title>Using Valcache via Docker bind mounts</title>
<link>https://ask.datomic.com/index.php/1012/using-valcache-via-docker-bind-mounts</link>
<description>&lt;p&gt;I'm evaluating caching options for Datomic Pro. Valcache sounds like a great fit, but there is one thing that might be a showstopper.&lt;/p&gt;
&lt;p&gt;The &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/pro/operation/valcache.html#prerequisites&quot;&gt;Prerequisites docs&lt;/a&gt; says that &quot;Valcache relies on an SSD with the strictatime and lazytime flags set&quot;. This requirement I can meet pretty easily by remounting the disk on the hosts running the peers.&lt;/p&gt;
&lt;p&gt;Now, the applications that are Datomic peers, who would be the users of these Valcaches, run as Docker containers in a Docker Swarm. The idea is to mount the Valcache as a &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.docker.com/storage/bind-mounts/&quot;&gt;Docker bind mount&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Would this work? The underlaying SSD disk would be mounted with strictatime and lazytime, but would whatever mechanism that requires these flags to be set work through a Docker bind mount?&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/1012/using-valcache-via-docker-bind-mounts</guid>
<pubDate>Thu, 11 Apr 2024 09:50:54 +0000</pubDate>
</item>
<item>
<title>Possibly security issue with the dev H2 storage?</title>
<link>https://ask.datomic.com/index.php/1003/possibly-security-issue-with-the-dev-h2-storage</link>
<description>&lt;p&gt;While trying to understand more about the behaviour of Datomic dev (mainly from a security/encryption point of view), I attempted to connect to datomic.mv.db from an instance of the H2 console. I accidentally tried to log in as &quot;admin&quot; with a blank password and was surprised when I connected successfully. Connecting as &quot;admin&quot; with any password fails, so it seems explicitly to be blank. As far as I can tell I only have public  schema access and can't see any transacted data, but I am able to run SQL queries in the console.&lt;/p&gt;
&lt;p&gt;Clearly a dev transactor isn't intended to be high security, but admin with a blank password seems risky even for a dev environment. In most SQL environments I work with, the sa/admin account is just disabled if not used. Am I missing something?&lt;/p&gt;
&lt;p&gt;As an aside, does the dev transactor use H2's AES encryption or is the resulting data file unencrypted?&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/1003/possibly-security-issue-with-the-dev-h2-storage</guid>
<pubDate>Wed, 13 Mar 2024 21:58:26 +0000</pubDate>
</item>
<item>
<title>How to change the default 1 minute jetty async servlet timeout?</title>
<link>https://ask.datomic.com/index.php/939/how-to-change-the-default-minute-jetty-async-servlet-timeout</link>
<description>&lt;p&gt;We have some ring routes in our HTTP direct ring handler, which returns some Excel files, which are constructed on the fly.&lt;/p&gt;
&lt;p&gt;This handler sometimes runs for more than a minute, resulting in the following error:&lt;br&gt;
&lt;code&gt;HTTP ERROR 503 Async servlet timeout
URI:	/...
STATUS:	503
MESSAGE:	Async servlet timeout
SERVLET:	cognitect.http_endpoint.jetty.FnServlet-49bf6f8c
Powered by Jetty:// 9.4.48.v20220622&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;How can we raise this timeout to ~5minutes, which is the maximum timeout of AWS NLBs?&lt;/p&gt;
&lt;p&gt;(We are exposing the HTTP direct ion endpoint to the public internet via an AWS NLB, to avoid the 30s timeout and 10MB response payload limit of the AWS API Gateway)&lt;/p&gt;
&lt;p&gt;Multiple sources on the internet - eg. &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/ring-clojure/ring/issues/299&quot;&gt;https://github.com/ring-clojure/ring/issues/299&lt;/a&gt; - mention a &lt;code&gt;org.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT&lt;/code&gt; Java property which is supposed to affect Jetty's async context timeout.&lt;/p&gt;
&lt;p&gt;Since the change of this property at runtime is not picked up by a running jetty instance, we have added provided it as a startup option, via the &lt;code&gt;OverrideSettings&lt;/code&gt; CloudFormation template parameter:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
{:OverrideSettings&lt;br&gt;
 (str &quot;export JVM_FLAGS=\&quot;$JVM_FLAGS&quot;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  &quot; -Dclojure.server.repl=&quot;
  &quot;{:address,\\\&quot;0.0.0.0\\\&quot;,:port,50505,:accept,clojure.core.server/repl}&quot;
  &quot; -Dorg.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT=300000&quot;
  &quot;\&quot;&quot;)}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;It is indeed observable within the ion JVM process:&lt;br&gt;
&lt;code&gt;(Long/getLong &quot;org.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT&quot;)
=&amp;gt; 300000&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Yet we are getting a 503 timeout response from the &lt;code&gt;cognitect.http_endpoint.jetty.FnServlet-49bf6f8c&lt;/code&gt; servlet after 1 minute still.&lt;/p&gt;
&lt;p&gt;Request, which take less then a minute work as expected.&lt;/p&gt;
</description>
<category>Ions</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/939/how-to-change-the-default-minute-jetty-async-servlet-timeout</guid>
<pubDate>Thu, 10 Aug 2023 16:01:07 +0000</pubDate>
</item>
<item>
<title>Is `(pull $db2 ?e [*])` supported officially?</title>
<link>https://ask.datomic.com/index.php/937/is-pull-db2-e-supported-officially</link>
<description>&lt;p&gt;The &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/query/query-data-reference.html?search=p#pull-expressions&quot;&gt;documentation&lt;/a&gt; only mentions the syntax without a &lt;code&gt;src-var&lt;/code&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;pull-expr                  = ['pull' variable pattern]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;but found that this syntax also works:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;pull-expr                  = ['pull' src-var variable pattern]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have a self-contained code example here, which demonstrates a use-case, where an entity is split between 2 Datomic databases, for privacy reasons:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://forum.datomic.com/t/pull-db-entity-pattern-is-undocumented/2299&quot;&gt;https://forum.datomic.com/t/pull-db-entity-pattern-is-undocumented/2299&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Is this variant of the &lt;code&gt;pull-expr&lt;/code&gt; in Datalog queries are not supported officially?&lt;/p&gt;
&lt;p&gt;Should I use it in production or does it have some undefined behaviour, compared to its binary arity variant?&lt;/p&gt;
&lt;p&gt;Or the documentation is just incomplete?&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/937/is-pull-db2-e-supported-officially</guid>
<pubDate>Sat, 15 Jul 2023 04:42:45 +0000</pubDate>
</item>
<item>
<title>Datomic Cloud IAM role drift on setup - is this normal?</title>
<link>https://ask.datomic.com/index.php/935/datomic-cloud-iam-role-drift-on-setup-is-this-normal</link>
<description>&lt;p&gt;hi, just set up DC for the first time (ran the two AWS cloudformation templates). The storage stack is showing drift on the IAM managed policy &lt;code&gt;datomic-admin-...&lt;/code&gt;, shows 'MODIFIED', in red. Is this normal upon setup? (checking the changes in the 'versions' tab, the difference is addition of autoscaling and s3 actions to the policy; the second version, presumably causing the 'drift', was added during the provisioning). Is this just a setup artifact nothing to worry about? &lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/935/datomic-cloud-iam-role-drift-on-setup-is-this-normal</guid>
<pubDate>Wed, 12 Jul 2023 09:34:33 +0000</pubDate>
</item>
<item>
<title>Request Entity Too Large - clojure.lang.ExceptionInfo: Response body did not conform to Datomic client protocol</title>
<link>https://ask.datomic.com/index.php/882/request-clojure-exceptioninfo-response-conform-protocol</link>
<description>&lt;p&gt;There seems to be a bug in Datomic 990-9202 that breaks the d/tx-range function.&lt;/p&gt;
&lt;p&gt;Earlier I could use the tx-range function the fetch data from my database.&lt;/p&gt;
&lt;p&gt;But after upgrading to Datomic 990-9202 I get and exception when a transaction has too much data. &lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
clojure.lang.ExceptionInfo: Response body did not conform to Datomic client protocol&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cognitect.anomalies/category: :cognitect.anomalies/incorrect
 cognitect.anomalies/message: &quot;Response body did not conform to Datomic client protocol&quot;
                 http-result: {:status 413,
                               :headers
                               {&quot;apigw-requestid&quot; &quot;Vg4UxisCDoEEJsQ=&quot;,
                                &quot;server&quot; &quot;Jetty(9.4.44.v20210927)&quot;,
                                &quot;connection&quot; &quot;keep-alive&quot;,
                                &quot;content-length&quot; &quot;38&quot;,
                                &quot;date&quot; &quot;Tue, 19 Jul 2022 12:17:47 GMT&quot;,
                                &quot;content-type&quot; &quot;application/json&quot;},
                               :body &quot;{\&quot;message\&quot;:\&quot;Request Entity Too Large\&quot;}&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/882/request-clojure-exceptioninfo-response-conform-protocol</guid>
<pubDate>Tue, 21 Mar 2023 12:26:20 +0000</pubDate>
</item>
<item>
<title>Is it possible for Datomic On-prem to get the storage credentials from Secrets Manager or similar software?</title>
<link>https://ask.datomic.com/index.php/873/possible-datomic-storage-credentials-manager-similar-software</link>
<description>&lt;p&gt;Is there a way to run the transactor service without storing the credentials to disk?&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/873/possible-datomic-storage-credentials-manager-similar-software</guid>
<pubDate>Thu, 02 Mar 2023 10:50:19 +0000</pubDate>
</item>
<item>
<title>What's the state of the art in distributed Datomic?</title>
<link>https://ask.datomic.com/index.php/863/whats-the-state-of-the-art-in-distributed-datomic</link>
<description>&lt;p&gt;I'd like to get an idea of the state of the art in distributed Datomic.  FWIW, my wish list includes the ability for selected processing nodes to have local images and/or participate in federated global images, linked by CRDTs, etc. And a pony.&lt;/p&gt;
&lt;p&gt;-r&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/863/whats-the-state-of-the-art-in-distributed-datomic</guid>
<pubDate>Sun, 18 Dec 2022 00:37:33 +0000</pubDate>
</item>
<item>
<title>Querying 2000+ entities, by passing in uuids (Really slow)</title>
<link>https://ask.datomic.com/index.php/862/querying-2000-entities-by-passing-in-uuids-really-slow</link>
<description>&lt;p&gt;Passing in over 2000 uuids to mysql for a fairly simple query takes milliseconds to retrieve relevant data. However we're running into an issue with datomic where it takes noticeable longer. Is there a specific syntax to use when processing such long lists, or is the linked example the only way? &lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/on-prem/query/query.html#collection-binding&quot;&gt;https://docs.datomic.com/on-prem/query/query.html#collection-binding&lt;/a&gt;&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/862/querying-2000-entities-by-passing-in-uuids-really-slow</guid>
<pubDate>Wed, 14 Dec 2022 09:24:29 +0000</pubDate>
</item>
<item>
<title>Inconsistency between d/pull and d/q + pull for non-existent entities</title>
<link>https://ask.datomic.com/index.php/860/inconsistency-between-pull-and-pull-for-existent-entities</link>
<description>&lt;p&gt;Inconsistency between d/pull and d/q + pull for non-existent entities&lt;/p&gt;
&lt;p&gt;Datomic returns a map with the &lt;code&gt;:db/id&lt;/code&gt; of the entity being pulled, even if the entity doesn't exist in the database. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/pull (d/db conn) '[*] 9999999999)
=&amp;gt; #:db{:id 9999999999}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This behavior is somewhat confusing, especially when using &lt;code&gt;d/pull&lt;/code&gt; with time filters. I was expecting &lt;code&gt;d/pull&lt;/code&gt; to return &lt;code&gt;nil&lt;/code&gt; or &lt;code&gt;#:db{:id nil}&lt;/code&gt; if the entity wasn't created at the given point in time. However, Datomic always returns a map with the entity ID:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/pull (as-of (d/db conn) 1) '[*] 9999999999)
=&amp;gt; #:db{:id 9999999999}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Surprisingly, I see the expected behavior if I pull the entity information from a query using &lt;code&gt;d/q&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/q '{:find [(pull ?e [*])]
        :in   [?e]}
      (d/db conn) 9999999999)
=&amp;gt; [[#:db{:id nil}]]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is that difference in behavior expected? How can I determine if an entity existed at any point in time using &lt;code&gt;d/pull&lt;/code&gt;?&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/860/inconsistency-between-pull-and-pull-for-existent-entities</guid>
<pubDate>Sat, 10 Dec 2022 15:55:29 +0000</pubDate>
</item>
<item>
<title>How do you add relationship properties, e.g. the time a person met another person?</title>
<link>https://ask.datomic.com/index.php/854/how-you-relationship-properties-time-person-another-person</link>
<description>&lt;p&gt;I have some experience with Neo4j / cypher. In cypher relationships are first-class citizens, so they can have properties, which I really like.&lt;/p&gt;
&lt;p&gt;How do I do something similar with datalog? Do I have to have a &quot;mapping entity&quot; in between two entities that have a relationship?&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/854/how-you-relationship-properties-time-person-another-person</guid>
<pubDate>Mon, 07 Nov 2022 08:35:28 +0000</pubDate>
</item>
<item>
<title>Is using entid function to resolve lookup refs a supported behaviour?</title>
<link>https://ask.datomic.com/index.php/721/using-entid-function-resolve-lookup-refs-supported-behaviour</link>
<description>&lt;p&gt;I'm using &lt;code&gt;datomic.api/entid&lt;/code&gt; to resolve a lookup ref to an entity ID, like&lt;br&gt;
&lt;code&gt;$ (entid db [:user/id &quot;test@test.com&quot;])
17592186045432&lt;/code&gt;&lt;br&gt;
This works fine, but a colleague pointed out this is not a documented behaviour.&lt;br&gt;
&amp;gt;Usage: (entid db ident)&lt;br&gt;
&amp;gt;Returns the entity id associated with a symbolic keyword, or the id&lt;br&gt;
itself if passed.&lt;/p&gt;
&lt;p&gt;Is this a gap in documentation, or is this behaviour accidental and not recommended to rely on?&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/721/using-entid-function-resolve-lookup-refs-supported-behaviour</guid>
<pubDate>Wed, 08 Jun 2022 13:30:29 +0000</pubDate>
</item>
<item>
<title>java.lang.IllegalArgumentException: Cannot resolve key: 24a96e20-f526-4f7f-ba38-4f684caa5607</title>
<link>https://ask.datomic.com/index.php/720/illegalargumentexception-resolve-24a96e20-4f684caa5607</link>
<description>&lt;p&gt;I am trying to implement resursive rule (loglcal OR) by following this video - Lucas Cavalcanti &amp;amp; Edward Wible - Exploring four hidden superpowers of Datomic&lt;/p&gt;
&lt;p&gt;Here the code&lt;/p&gt;
&lt;p&gt;(defn owns? [cid pid db]&lt;br&gt;
  (d/q '{:find [?pur]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;     :in [$ ?cus-id ?pur %]
     :where
     [(owns? ?cus-id ?pur)]}
db cid [:purchase/id pid] owner-rules))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(comment&lt;br&gt;
  (owns?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#uuid &quot;0fb7ea94-44af-46fa-98ca-0ddb5eb23123&quot;
#uuid &quot;24a96e20-f526-4f7f-ba38-4f684caa5607&quot;
(d/db bank-conn)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While running the above example I am getting this error: &lt;br&gt;
java.lang.IllegalArgumentException Cannot resolve key: 24a96e20-f526-4f7f-ba38-4f684caa5607&lt;/p&gt;
&lt;p&gt;Here is the full code:&lt;/p&gt;
&lt;p&gt;(def purchase-schema&lt;br&gt;
  [{:db/ident :purchase/id&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;The purchase ID&quot;
:db/unique :db.unique/identity
:db/valueType :db.type/uuid
:db/cardinality :db.cardinality/one}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   {:db/ident :purchase/account&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;Purchase Account&quot;
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/one}])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(def account-schema&lt;br&gt;
  [{:db/ident :account/id&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;The Account ID&quot;
:db/unique :db.unique/identity
:db/valueType :db.type/uuid
:db/cardinality :db.cardinality/one}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   {:db/ident :account/customer&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;Customer who own's this account&quot;
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/one}])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(def customer-schema&lt;br&gt;
  [{:db/ident :customer/id&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;Customer ID&quot;
:db/unique :db.unique/identity
:db/valueType :db.type/uuid
:db/cardinality :db.cardinality/one}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   {:db/ident :customer/name&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:db/doc &quot;Customer name&quot;
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;;&lt;br&gt;
;; Create client&lt;br&gt;
(def client (d/client {:server-type :dev-local&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                   :system &quot;dev&quot;}))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;; Create connections&lt;br&gt;
(def bank-conn    (d/connect client {:db-name &quot;bank&quot;}))&lt;/p&gt;
&lt;p&gt;;; Transact schemas&lt;br&gt;
(comment&lt;br&gt;
  (d/transact  bank-conn {:tx-data purchase-schema})&lt;br&gt;
  (d/transact  bank-conn {:tx-data account-schema})&lt;br&gt;
  (d/transact  bank-conn {:tx-data customer-schema})&lt;br&gt;
  (d/tx-range  bank-conn {:start 6}))&lt;/p&gt;
&lt;p&gt;(comment&lt;br&gt;
  (java.util.UUID/randomUUID))&lt;/p&gt;
&lt;p&gt;;; Transact fake data&lt;br&gt;
(def cid #uuid &quot;0fb7ea94-44af-46fa-98ca-0ddb5eb23123&quot;)&lt;br&gt;
(def sample-customer {:customer/id cid&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                  :customer/name &quot;Jon Snow&quot;})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(def aid #uuid &quot;c579a9f6-f6c3-4718-8ecf-c3003021ee9a&quot;)&lt;br&gt;
(def sample-account {:account/id aid&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                 :account/customer [:customer/id cid]})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(def pid #uuid &quot;24a96e20-f526-4f7f-ba38-4f684caa5607&quot;)&lt;br&gt;
(def sample-purchase {:purchase/id  pid&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                  :purchase/account [:account/id aid]})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(comment&lt;br&gt;
  (d/transact bank-conn {:tx-data [sample-customer]})&lt;br&gt;
  (d/transact bank-conn {:tx-data [sample-account]})&lt;br&gt;
  (d/transact bank-conn {:tx-data [sample-purchase]}))&lt;/p&gt;
&lt;p&gt;(comment&lt;br&gt;
  (d/q '[:find ?cus&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;     :in $ ?cid ?pid
     :where
     [?pur :purchase/id ?pid]
     [?pur :purchase/account ?acc]
     [?acc :account/customer ?cus]
     [?cus :customer/id ?cid]]
  (d/db bank-conn)
  (:customer/id sample-customer)
  (:purchase/id sample-purchase)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;; owns v1&lt;br&gt;
(defn ownsv1? [cid pid db]&lt;br&gt;
  (d/q '[:find ?cus&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;     :in $ ?customer-id ?purchase-id
     :where
     [?pur :purchase/id ?purchase-id]
     [?pur :purchase/account ?acc]
     [?acc :account/customer ?cus]
     [?cus :customer/id ?customer-id]]
db cid pid))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(comment&lt;br&gt;
  (ownsv1?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(:customer/id sample-customer)
(:purchase/id sample-purchase)
(d/db bank-conn)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;; recursive rule (logical OR)&lt;br&gt;
(def owner-rules&lt;br&gt;
  '[[(owns? ?cus-id ?e)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; [?e :customer/id ?cus-id]]
[(owns? ?cus-id ?e)
 [?e ?ref-attr ?r]
 (owns? ?cus-id ?r)]])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(defn owns? [cid pid db]&lt;br&gt;
  (d/q '{:find [?pur]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;     :in [$ ?cus-id ?pur %]
     :where
     [(owns? ?cus-id ?pur)]}
db cid [:purchase/id pid] owner-rules))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;;;&lt;br&gt;
(comment&lt;br&gt;
  (owns?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(:customer/id sample-customer)
(:purchase/id sample-purchase)
(d/db bank-conn)))
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/720/illegalargumentexception-resolve-24a96e20-4f684caa5607</guid>
<pubDate>Mon, 06 Jun 2022 19:37:30 +0000</pubDate>
</item>
<item>
<title>Notifying clients of database changes in Datomic Cloud?</title>
<link>https://ask.datomic.com/index.php/719/notifying-clients-of-database-changes-in-datomic-cloud</link>
<description>&lt;p&gt;In your 2013 blog post &lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.datomic.com/2013/10/the-transaction-report-queue.html&quot;&gt;The Transaction Report Queue&lt;/a&gt;, you write:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;In Datomic, you can monitor all transactions.  Any peer process in the&lt;br&gt;
system can request a transaction report queue of every transaction&lt;br&gt;
against a particular database.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Is there a change data capture or related mechanism in Datomic Cloud, where changes to the database can be pushed to a client?&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Andrew&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/719/notifying-clients-of-database-changes-in-datomic-cloud</guid>
<pubDate>Sat, 04 Jun 2022 15:18:15 +0000</pubDate>
</item>
<item>
<title>Troubleshooting :deploy-status &quot;FAILED&quot;, :code-deploy-status &quot;SUCCEEDED&quot;</title>
<link>https://ask.datomic.com/index.php/706/troubleshooting-deploy-status-failed-deploy-status-succeeded</link>
<description>&lt;p&gt;After a few days of attempting to launch Datomic Ion on AWS following the &lt;strong&gt;Ion Tutorial&lt;/strong&gt; [0], this appears to be the best I can do:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:deploy-status &quot;FAILED&quot;, :code-deploy-status &quot;SUCCEEDED&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Searching CloudWatch for “Alert - Alert” reveals no events.&lt;/p&gt;
&lt;p&gt;I did not modify the &lt;code&gt;ion-starter&lt;/code&gt; codebase except for configuring the correct &lt;code&gt;:endpoint&lt;/code&gt; and &lt;code&gt;:app-name&lt;/code&gt;. (I believe this was done correctly because I completed all steps in “Develop at the REPL”[1] without a hitch.)&lt;/p&gt;
&lt;p&gt;[0]: &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/ions/ions-tutorial.html&quot;&gt;https://docs.datomic.com/cloud/ions/ions-tutorial.html&lt;/a&gt;&lt;br&gt;
[1]: &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/ions/ions-tutorial.html#repl&quot;&gt;https://docs.datomic.com/cloud/ions/ions-tutorial.html#repl&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thank you for any pointers.&lt;/p&gt;
</description>
<category>Ions</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/706/troubleshooting-deploy-status-failed-deploy-status-succeeded</guid>
<pubDate>Mon, 21 Feb 2022 13:33:43 +0000</pubDate>
</item>
<item>
<title>client api: clear cache when credentials change</title>
<link>https://ask.datomic.com/index.php/689/client-api-clear-cache-when-credentials-change</link>
<description>&lt;p&gt;I have my development program running and connect to datomic proper. How do I clear the caches because it brakes when I need new aws creds.&lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/689/client-api-clear-cache-when-credentials-change</guid>
<pubDate>Tue, 14 Dec 2021 08:30:00 +0000</pubDate>
</item>
<item>
<title>How datomic.client.api/connect work?</title>
<link>https://ask.datomic.com/index.php/683/how-datomic-client-api-connect-work</link>
<description>&lt;p&gt;I interested how connection work.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When connection is open? (all time or when we call him)&lt;/li&gt;
&lt;li&gt;Can we hold connection opened all time ?  Is this good or bad?&lt;/li&gt;
&lt;li&gt;When we execute any transaction is it updated connection?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;maybe the questions are simple, but I would like to better understand how it works.&lt;/p&gt;
</description>
<category>Ions</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/683/how-datomic-client-api-connect-work</guid>
<pubDate>Mon, 15 Nov 2021 14:46:44 +0000</pubDate>
</item>
<item>
<title>How to install transaction function using the [com.datomic/client-pro &quot;0.9.63&quot;]</title>
<link>https://ask.datomic.com/index.php/673/how-install-transaction-function-using-the-datomic-client</link>
<description>&lt;p&gt;How to install transaction function using the [com.datomic/client-pro &quot;0.9.63&quot;] ?&lt;br&gt;
I am following this example &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/on-prem/reference/database-functions.html&quot;&gt;https://docs.datomic.com/on-prem/reference/database-functions.html&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;However there is no d/function to install the transaction function... And looking at the documentation there is only datomic dev local and datomic client pro libraries&lt;/p&gt;
&lt;p&gt;How can I create a transaction function using the client pro lib?&lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/673/how-install-transaction-function-using-the-datomic-client</guid>
<pubDate>Wed, 13 Oct 2021 16:27:12 +0000</pubDate>
</item>
<item>
<title>How to integrate library using datomic.client.api when using the peer library?</title>
<link>https://ask.datomic.com/index.php/663/integrate-library-using-datomic-client-when-using-library</link>
<description>&lt;p&gt;I am using the peer library for on-prem Datomic. Now I want to use a library - ragtime.datomic - that uses the datomic.client.api. How can I do that?&lt;/p&gt;
&lt;p&gt;Based on &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/client-api/datomic.client.api.html#var-client&quot;&gt;https://docs.datomic.com/client-api/datomic.client.api.html#var-client&lt;/a&gt; it seems the only option is to run a separate peer process, exposed at a port and set up authorization between the two. But it seems wasteful to run a separate server when I already have the peer library. Is there a simpler way?&lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/663/integrate-library-using-datomic-client-when-using-library</guid>
<pubDate>Fri, 03 Sep 2021 17:33:57 +0000</pubDate>
</item>
<item>
<title>query with pull and more attributes count max min etc</title>
<link>https://ask.datomic.com/index.php/661/query-with-pull-and-more-attributes-count-max-min-etc</link>
<description>&lt;p&gt;When I try pull attributes together with max, min or count I received only 2 attributes.&lt;/p&gt;
&lt;p&gt;I want the same output from Example 1, but instead a new query to :where, I want use (pull).&lt;/p&gt;
&lt;p&gt;My problem its on example 2, I'm missing or a did something wrong?&lt;/p&gt;
&lt;p&gt;Exemple 1, happens correctly:&lt;/p&gt;
&lt;p&gt;  (defn resume [db]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  (d/q '[:find ?name-cat (min ?price) (max ?price) (count ?price)
         :keys category min max qtd
         :with ?product
         :where [?product :product/price ?price]
         [?product :product/category ?category]
         [?category :category/nome ?name-cat]]

       db))
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[{:category &quot;Eletronics&quot;,

  :min 15M,

  :max 15M,

  :qtd 10}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Exemplo2, using (pull)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn resume [db]

  (d/q '[:find (pull ?category [:category/nome])
         (min ?price)
         (max ?price)
         (count ?price)
         ;:keys category min max qtd ;cant use kays because Indexoutbound happen

        :with ?product ;using with because it is a conj, so now it allow if a product has same price
         :where [?product :product/price ?price]
         [?product :product/category ?category]]

       db))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;output&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[{:category/id 34 :category/name &quot;test&quot;} 10
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Peer API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/661/query-with-pull-and-more-attributes-count-max-min-etc</guid>
<pubDate>Tue, 31 Aug 2021 20:42:03 +0000</pubDate>
</item>
<item>
<title>Retracting entities, including tuples with refs</title>
<link>https://ask.datomic.com/index.php/660/retracting-entities-including-tuples-with-refs</link>
<description>&lt;p&gt;In my schema I have attributes of type tuple that has :db.type/ref as one of the tuple's types.&lt;br&gt;
My usecase is maintaining a set of ordered to-many relations.&lt;/p&gt;
&lt;p&gt;When I retract an entity using :db/retractEntity, the tuple attrs that refer to the retracted entity still remain, continuing to refer to a now non-existent entity.&lt;br&gt;
I'm not sure whether this is the intended behaviour, and if so, what would be a standard approach to clean up these tuples? My intention would be for these tuples to be completely redacted. As I'm using this in a cardinality-many setup, I'd expect the attribute to retain all tuple values, except the one that does include the ref to the retracted entity in any position.&lt;br&gt;
Should I be writing a custom retractEntity-like transaction function?&lt;br&gt;
Thanks!&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/660/retracting-entities-including-tuples-with-refs</guid>
<pubDate>Tue, 31 Aug 2021 13:36:44 +0000</pubDate>
</item>
<item>
<title>How to authenticate and authorize access to API Gateway endpoints for datomic?</title>
<link>https://ask.datomic.com/index.php/651/authenticate-authorize-access-gateway-endpoints-datomic</link>
<description>&lt;p&gt;I'm currently evaluating Datomic and I've deployed a production topology using a split stack. DatomicCloudVersion is 9095 and DatomicCFTVersion is 884. The CloudFormation stack created two API Gateway endpoints: &lt;code&gt;datomic-[system]-client-api&lt;/code&gt; and &lt;code&gt;datomic-[system]-ions&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;From my local computer I can get a client by using &lt;code&gt;datomic-[system]-client-api&lt;/code&gt; endpoint:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/client {:system &quot;my-system&quot;
           :server-type :ion
           :region &quot;us-east-1&quot;
           :endpoint &quot;https://[endpoint-id].execute-api.us-east-1.amazonaws.com/&quot;})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above, &lt;code&gt;https://[endpoint-id].execute-api.us-east-1.amazonaws.com/&lt;/code&gt; is the client-api API Gateway endpoint. It works, but the endpoint is open to the world. I then added an IAM authorizer to &lt;code&gt;datomic-[system]-client-api&lt;/code&gt; and used an authorized IAM user to make a request to the now authenticated endpoint:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;awscurl --service execute-api -X GET https://[endpoint-id].execute-api.us-east-1.amazonaws.com --profile datomic
{:s3-auth-path &quot;long s3 path&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;awscurl&lt;/code&gt; is just a tool to make authenticated calls to AWS services. As you can see, I can get a response from the endpoint by using my local profile named &quot;datomic&quot;. If I try using regular curl without the v4 AWS signature it fails:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -X GET https://[endpoint-id].execute-api.us-east-1.amazonaws.com
{&quot;message&quot;:&quot;Forbidden&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Works as expected. The problem is now I can't get a client using:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/client {:system &quot;my-system&quot;
           :server-type :ion
           :region &quot;us-east-1&quot;
           :creds-profile &quot;datomic&quot;
           :endpoint &quot;https://[endpoint-id].execute-api.us-east-1.amazonaws.com/&quot;})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The response I get is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:status 403,
:headers
{&quot;apigw-requestid&quot; &quot;EUsyNi9aIAMEPlg=&quot;,
&quot;connection&quot; &quot;keep-alive&quot;,
&quot;content-length&quot; &quot;23&quot;,
&quot;date&quot; &quot;Thu, 19 Aug 2021 17:01:40 GMT&quot;,
&quot;content-type&quot; &quot;application/json&quot;},
:body &quot;{\&quot;message\&quot;:\&quot;Forbidden\&quot;}&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is as if the &lt;code&gt;d/client&lt;/code&gt; call is ignoring the profile or not generating the proper signature. I tried setting the &lt;code&gt;AWS_PROFILE&lt;/code&gt; environment variable as well, to no avail.&lt;/p&gt;
&lt;p&gt;Is using an IAM Authorizer not the proper way to go? How can I protect both the client-api and ions endpoints? Finally, what's the difference between the client-api and ions endpoints?&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/651/authenticate-authorize-access-gateway-endpoints-datomic</guid>
<pubDate>Thu, 19 Aug 2021 17:05:29 +0000</pubDate>
</item>
<item>
<title>It would be nice to have something like sync-excise to coordinate with background history removal</title>
<link>https://ask.datomic.com/index.php/649/would-something-excise-coordinate-background-history-removal</link>
<description>&lt;p&gt;According to the docs: &quot;The effect of :db/noHistory happens in the background, and some amount of history may be visible even for attributes with :db/noHistory set to true.&quot; It would be useful to have something like sync-excise to know when the db value is aware of all history removal of a specific (noHistory) attribute.&lt;/p&gt;
</description>
<category>Peer API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/649/would-something-excise-coordinate-background-history-removal</guid>
<pubDate>Mon, 26 Jul 2021 15:58:21 +0000</pubDate>
</item>
<item>
<title>Datomic returns empty results where &quot;Insufficient bindings, will cause db scan&quot; exception is expected</title>
<link>https://ask.datomic.com/index.php/644/datomic-returns-insufficient-bindings-exception-expected</link>
<description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;If we change &lt;code&gt;#uuid&quot;...&quot;&lt;/code&gt; to &lt;code&gt;&quot;&quot;&lt;/code&gt; (from uuid to string), we get the exception (desired behavior)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Sdeps '{:deps {com.datomic/dev-local {:mvn/version &quot;0.9.232&quot;}}}' -M \
  -e &quot;(require '[datomic.client.api :as d])&quot; \
  -e '(def client (d/client {:server-type :dev-local :system &quot;hello&quot;}))' \
  -e '(d/create-database client {:db-name &quot;hello&quot;})' \
  -e '(def conn (d/connect client {:db-name &quot;hello&quot;}))' \
  -e &quot;(d/q '[:find ?e :where [?e _ #uuid\&quot;00000000-0000-0000-0000-000000000000\&quot;]] (d/db conn))&quot;
=&amp;gt; #'user/client
=&amp;gt; true
=&amp;gt; #'user/conn
=&amp;gt; []
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Occour on (old) versions of datomic-free too&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Sdeps '{:deps {com.datomic/datomic-free {:mvn/version &quot;0.9.5697&quot;}}}' \
  -M --report stderr \
  -e &quot;(require '[datomic.api :as d])&quot; \
  -e '(d/create-database &quot;datomic:mem://hello&quot;)' \
  -e '(def conn (d/connect &quot;datomic:mem://hello&quot;))' \
  -e &quot;(d/q '[:find ?e :where [?e _ #uuid\&quot;00000000-0000-0000-0000-000000000000\&quot;]] (d/db conn))&quot;
WARNING: requiring-resolve already refers to: #'clojure.core/requiring-resolve in namespace: datomic.common, being replaced by: #'datomic.common/requiring-resolve
=&amp;gt; true
=&amp;gt; #'user/conn
=&amp;gt; #{}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/644/datomic-returns-insufficient-bindings-exception-expected</guid>
<pubDate>Wed, 07 Jul 2021 14:30:05 +0000</pubDate>
</item>
<item>
<title>ClassCastException, d/with  inside transact function</title>
<link>https://ask.datomic.com/index.php/638/classcastexception-d-with-inside-transact-function</link>
<description>&lt;p&gt;Calling a transaction function that uses d/with in a dev-local, filesystem (i.e., not :storage-dir :mem) throws a ClassCastException on internal Datomic code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Environment&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;com.datomic/dev-local {:mvn/version &quot;0.9.232&quot;}&lt;/li&gt;
&lt;li&gt;client-cloud 0.8.105&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;History&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Example with exception using file system dev-local.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def client (d/client {:server-type :dev-local
                         :storage-dir &quot;/tmp/cce-bug3&quot;
                         :system      &quot;test&quot;}))
=&amp;gt; #'user/client
(d/create-database client {:db-name &quot;test&quot;})
=&amp;gt; true
(def conn (d/connect client {:db-name &quot;test&quot;}))
=&amp;gt; #'user/conn
(d/transact conn {:tx-data [{:db/ident       :user/name
                               :db/valueType   :db.type/string
                               :db/cardinality :db.cardinality/one}]})
=&amp;gt;
{:db-before #datomic.core.db.Db{:id &quot;test&quot;,
                                :basisT 5,
                                :indexBasisT 0,
                                :index-root-id nil,
                                :asOfT nil,
                                :sinceT nil,
                                :raw nil},
 :db-after #datomic.core.db.Db{:id &quot;test&quot;,
                               :basisT 6,
                               :indexBasisT 0,
                               :index-root-id nil,
                               :asOfT nil,
                               :sinceT nil,
                               :raw nil},
 :tx-data [#datom[13194139533318 50 #inst&quot;2021-05-09T00:49:46.400-00:00&quot; 13194139533318 true]
           #datom[73 10 :user/name 13194139533318 true]
           #datom[73 40 23 13194139533318 true]
           #datom[73 41 35 13194139533318 true]
           #datom[0 13 73 13194139533318 true]],
 :tempids {}}
(defn my-tx-fn
    [db argm]
    (let [tx-report (d/with db {:tx-data [{:user/name &quot;asd&quot;}]})]
      []))
=&amp;gt; #'user/my-tx-fn
(d/transact conn {:tx-data [(list 'user/my-tx-fn {})]})
Execution error (ClassCastException) at datomic.dev-local.tx/datom-lookup-valfn (tx.clj:397).
class datomic.core.db.Datum cannot be cast to class java.lang.Number (datomic.core.db.Datum is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Working memdb example.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def client-memdb (d/client {:server-type :dev-local
                               :storage-dir :mem
                               :system      &quot;test&quot;}))
=&amp;gt; #'user/client-memdb
(d/create-database client-memdb {:db-name &quot;test&quot;})
=&amp;gt; true
(def conn-memdb (d/connect client-memdb {:db-name &quot;test&quot;}))
=&amp;gt; #'user/conn-memdb
(d/transact conn-memdb {:tx-data [{:db/ident       :user/name
                                     :db/valueType   :db.type/string
                                     :db/cardinality :db.cardinality/one}]})
=&amp;gt;
{:db-before #datomic.core.db.Db{:id &quot;394c7a65-bfeb-4dd4-b188-7aecd2057692&quot;,
                                :basisT 5,
                                :indexBasisT 0,
                                :index-root-id nil,
                                :asOfT nil,
                                :sinceT nil,
                                :raw nil},
 :db-after #datomic.core.db.Db{:id &quot;394c7a65-bfeb-4dd4-b188-7aecd2057692&quot;,
                               :basisT 6,
                               :indexBasisT 0,
                               :index-root-id nil,
                               :asOfT nil,
                               :sinceT nil,
                               :raw nil},
 :tx-data [#datom[13194139533318 50 #inst&quot;2021-05-09T01:02:57.965-00:00&quot; 13194139533318 true]
           #datom[73 10 :user/name 13194139533318 true]
           #datom[73 40 23 13194139533318 true]
           #datom[73 41 35 13194139533318 true]
           #datom[0 13 73 13194139533318 true]],
 :tempids {}}
(d/transact conn-memdb {:tx-data [(list 'user/my-tx-fn {})]})
=&amp;gt;
{:db-before #datomic.core.db.Db{:id &quot;394c7a65-bfeb-4dd4-b188-7aecd2057692&quot;,
                                :basisT 6,
                                :indexBasisT 0,
                                :index-root-id nil,
                                :asOfT nil,
                                :sinceT nil,
                                :raw nil},
 :db-after #datomic.core.db.Db{:id &quot;394c7a65-bfeb-4dd4-b188-7aecd2057692&quot;,
                               :basisT 7,
                               :indexBasisT 0,
                               :index-root-id nil,
                               :asOfT nil,
                               :sinceT nil,
                               :raw nil},
 :tx-data [#datom[13194139533319 50 #inst&quot;2021-05-09T01:03:08.042-00:00&quot; 13194139533319 true]],
 :tempids {}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Expectation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Transaction functions that use d/with do not throw a ClassCastException. Additionally, the behavior of d/with in all Datomic environments (Cloud, File system, Memdb) is consistent. Given a &lt;a rel=&quot;nofollow&quot; href=&quot;https://forum.datomic.com/t/datomic-cloud-589-8846/1328&quot;&gt;previous Datomic Cloud release&lt;/a&gt; fixed a problem with using with-db from an Ion, it seems using d/with in a transaction function is a supported behavior.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Actual&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The final d/transact transaction function throws a ClassCastException when using d/with on some internal Datomic code. This only occurs when using a dev-local, file system environment.&lt;/p&gt;
&lt;p&gt;Full stacktrace is pasted below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#error{:cause &quot;class datomic.core.db.Datum cannot be cast to class java.lang.Number (datomic.core.db.Datum is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')&quot;,
       :via [{:type java.lang.ClassCastException,
              :message &quot;class datomic.core.db.Datum cannot be cast to class java.lang.Number (datomic.core.db.Datum is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')&quot;,
              :at [datomic.dev_local.tx$datom_lookup_valfn invokeStatic &quot;tx.clj&quot; 397]}],
       :trace [[datomic.dev_local.tx$datom_lookup_valfn invokeStatic &quot;tx.clj&quot; 397]
               [datomic.dev_local.tx$datom_lookup_valfn invoke &quot;tx.clj&quot; 397]
               [datomic.dev_local.local_log.LocalLog valAt &quot;local_log.clj&quot; 56]
               [clojure.lang.RT get &quot;RT.java&quot; 760]
               [datomic.dev_local.btindex.BTIndex cons &quot;btindex.clj&quot; 281]
               [clojure.lang.RT conj &quot;RT.java&quot; 677]
               [clojure.core$conj__5390 invokeStatic &quot;core.clj&quot; 85]
               [clojure.core$conj__5390 invoke &quot;core.clj&quot; 82]
               [datomic.core.db.Db addData &quot;db.clj&quot; 2322]
               [datomic.core.db$add_ensured_data invokeStatic &quot;db.clj&quot; 3353]
               [datomic.core.db$add_ensured_data invoke &quot;db.clj&quot; 3351]
               [datomic.core.db$with_tx invokeStatic &quot;db.clj&quot; 3370]
               [datomic.core.db$with_tx invoke &quot;db.clj&quot; 3357]
               [datomic.core.db.Db with &quot;db.clj&quot; 2164]
               [datomic.core.local_db$fn__25633 invokeStatic &quot;local_db.clj&quot; 67]
               [datomic.core.local_db$fn__25633 invoke &quot;local_db.clj&quot; 24]
               [datomic.client.api.protocols$fn__11959$G__11877__11966 invoke &quot;protocols.clj&quot; 126]
               [datomic.client.api$with invokeStatic &quot;api.clj&quot; 363]
               [datomic.client.api$with invoke &quot;api.clj&quot; 353]
               [user$my_tx_fn invokeStatic &quot;user.clj&quot; 3]
               [user$my_tx_fn invoke &quot;user.clj&quot; 20]
               [clojure.lang.AFn applyToHelper &quot;AFn.java&quot; 156]
               [clojure.lang.AFn applyTo &quot;AFn.java&quot; 144]
               [clojure.lang.Var applyTo &quot;Var.java&quot; 705]
               [clojure.core$apply invokeStatic &quot;core.clj&quot; 667]
               [clojure.core$apply invoke &quot;core.clj&quot; 660]
               [datomic.core.db.ProcessExpander inject &quot;db.clj&quot; 3229]
               [datomic.core.db.ProcessInpoint inject &quot;db.clj&quot; 2950]
               [datomic.dev_local.btindex_db$expand_tx$inject_all__18586$fn__18587 invoke &quot;btindex_db.clj&quot; 440]
               [clojure.lang.PersistentVector reduce &quot;PersistentVector.java&quot; 343]
               [clojure.core$reduce invokeStatic &quot;core.clj&quot; 6827]
               [clojure.core$reduce invoke &quot;core.clj&quot; 6810]
               [datomic.dev_local.btindex_db$expand_tx$inject_all__18586 invoke &quot;btindex_db.clj&quot; 440]
               [datomic.dev_local.btindex_db$expand_tx invokeStatic &quot;btindex_db.clj&quot; 444]
               [datomic.dev_local.btindex_db$expand_tx invoke &quot;btindex_db.clj&quot; 429]
               [datomic.dev_local.btindex_db$with_tx invokeStatic &quot;btindex_db.clj&quot; 468]
               [datomic.dev_local.btindex_db$with_tx invoke &quot;btindex_db.clj&quot; 461]
               [datomic.dev_local.impl.DurableConnection transact &quot;impl.clj&quot; 161]
               [datomic.client.api$transact invokeStatic &quot;api.clj&quot; 200]
               [datomic.client.api$transact invoke &quot;api.clj&quot; 183]
               [user$eval124260 invokeStatic &quot;user.clj&quot; 25]
               [user$eval124260 invoke &quot;user.clj&quot; 25]
               [clojure.lang.Compiler eval &quot;Compiler.java&quot; 7177]
               [clojure.lang.Compiler eval &quot;Compiler.java&quot; 7132]
               [clojure.core$eval invokeStatic &quot;core.clj&quot; 3214]
               [clojure.core$eval invoke &quot;core.clj&quot; 3210]
               [nrepl.middleware.interruptible_eval$evaluate$fn__959 invoke &quot;interruptible_eval.clj&quot; 91]
               [clojure.main$repl$read_eval_print__9086$fn__9089 invoke &quot;main.clj&quot; 437]
               [clojure.main$repl$read_eval_print__9086 invoke &quot;main.clj&quot; 437]
               [clojure.main$repl$fn__9095 invoke &quot;main.clj&quot; 458]
               [clojure.main$repl invokeStatic &quot;main.clj&quot; 458]
               [clojure.main$repl doInvoke &quot;main.clj&quot; 368]
               [clojure.lang.RestFn invoke &quot;RestFn.java&quot; 1523]
               [nrepl.middleware.interruptible_eval$evaluate invokeStatic &quot;interruptible_eval.clj&quot; 84]
               [nrepl.middleware.interruptible_eval$evaluate invoke &quot;interruptible_eval.clj&quot; 56]
               [nrepl.middleware.interruptible_eval$interruptible_eval$fn__985$fn__989
                invoke
                &quot;interruptible_eval.clj&quot;
                155]
               [clojure.lang.AFn run &quot;AFn.java&quot; 22]
               [nrepl.middleware.session$session_exec$main_loop__1086$fn__1090 invoke &quot;session.clj&quot; 190]
               [nrepl.middleware.session$session_exec$main_loop__1086 invoke &quot;session.clj&quot; 189]
               [clojure.lang.AFn run &quot;AFn.java&quot; 22]
               [java.lang.Thread run &quot;Thread.java&quot; 829]]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Evidence&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The previously pasted example is reproducible and always throws a ClassCastException.  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Impact&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We are unable to test functionality in a consistent manner. Local setups using dev-local file systems will not function as expected. Developers are unable to test features in the same way they will work in production.&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/638/classcastexception-d-with-inside-transact-function</guid>
<pubDate>Thu, 24 Jun 2021 14:57:51 +0000</pubDate>
</item>
<item>
<title>d/client external server communication</title>
<link>https://ask.datomic.com/index.php/637/d-client-external-server-communication</link>
<description>&lt;p&gt;&lt;strong&gt;Environment&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;com.datomic/client-cloud 0.8.105&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;History&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Get the docstring for &lt;code&gt;d/client&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(clojure.repl/doc d/client)
-------------------------
datomic.client.api/client
([arg-map])
  Create a client for a Datomic system. This function does not
communicate with a server and returns immediately.

For a cloud system, arg-map requires:

  :server-type   - :cloud
  :region        - AWS region, e.g. &quot;us-east-1&quot;
  :system        - your system name
  :endpoint      - IP address of your system or query group

Optionally, a cloud system arg-map accepts:

  :creds-provider  - instance of com.amazonaws.auth.AWSCredentialsProvider. Defaults to DefaultAWSCredentialsProviderChain
  :creds-profile   - name of an AWS Named Profile. See http://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
  :proxy-port      - local port for SSH tunnel to bastion 

  Note: :creds-provider and :creds-profile are mutually exclusive, providing both will result in an error.

For a dev-local system, arg-map comprises:

  :server-type   - :dev-local (required)
  :system        - a system name (required)
  :storage-dir   - optional, overrides :storage-dir in ~/.datomic/dev-local.edn

dev-local stores databases under ${storage-dir}/${system}/${db-name}.

For a peer-server system, arg-map requires:

  :server-type   - :peer-server
  :access-key    - access-key from peer server launch
  :secret        - secret from peer server launch
  :endpoint      - peer server host:port
  :validate-hostnames  - false

Returns a client object.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note the second sentence in the docstring: &quot;This function does not communicate with a server and returns immediately.&quot; Next call &lt;code&gt;d/client&lt;/code&gt; with an endpoint that does not exist.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/client {:server-type :ion
             :system      &quot;my-system&quot;
             :endpoint    &quot;http://i-dont-exist.datomic.net:8182&quot;
             :region      &quot;us-west-2&quot;})
Execution error (ExceptionInfo) at datomic.client.impl.cloud/get-s3-auth-path (cloud.clj:179).
Unable to connect to http://i-dont-exist.datomic.net:8182
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Expectation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Calling &lt;code&gt;d/client&lt;/code&gt; does not communicate with a server.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Actual&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Calling &lt;code&gt;d/client&lt;/code&gt; does communicate with a server.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Evidence&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The above reproducible example indicates the &lt;code&gt;d/client&lt;/code&gt; function call is attempted to communicate the the passing in &lt;code&gt;:endpoint&lt;/code&gt; string given the exception thrown.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Impact&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;d/client&lt;/code&gt; docstring misleads the user by saying no server communication will occur when it does occur. The result is calls to &lt;code&gt;d/client&lt;/code&gt; can fail in unexpected ways when an external server communication is not accounted for. For example, we spin up Datomic Cloud query groups dynamically and attempt to communicate with the newly spun up cluster. Until the cluster is up and healthy, we expect calls to fail at &lt;code&gt;d/connect&lt;/code&gt; with an unavailable anomaly, and instead the calls would fail at &lt;code&gt;d/client&lt;/code&gt; with an unavailable anomaly.&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/637/d-client-external-server-communication</guid>
<pubDate>Thu, 24 Jun 2021 14:55:59 +0000</pubDate>
</item>
<item>
<title>Add query group ASG metrics to query group CW dashboard</title>
<link>https://ask.datomic.com/index.php/619/add-query-group-asg-metrics-to-query-group-cw-dashboard</link>
<description>&lt;p&gt;When looking at the query group dashboard, it is helpful to know what &quot;state&quot; the ASG was in when referencing the various dashboard metrics. Currently, I must do one of the following: 1) reference these metrics in the ASG monitoring tab (e.g., &lt;a rel=&quot;nofollow&quot; href=&quot;https://us-west-2.console.aws.amazon.com/ec2autoscaling/home?region=us-west-2#/details/my-query-group?view=monitoring&quot;&gt;https://us-west-2.console.aws.amazon.com/ec2autoscaling/home?region=us-west-2#/details/my-query-group?view=monitoring&lt;/a&gt;), 2) create a CW dashboard of my own, 3) modify the existing Datomic CW dashboard to add this chart. The ASG metrics answer questions like: 1) how many instances was my query group running? 2) was my query group trying to scale out or in? 3) why did my query group not scale out or in? &lt;/p&gt;
&lt;p&gt;I would find the following &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html#available-cloudwatch-metrics&quot;&gt;ASG metrics&lt;/a&gt; (in order of importance) useful additions to the current query group dashboard.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In Service Instances (Count)&lt;/li&gt;
&lt;li&gt;Minimum Group Size (Count), Maximum Group Size (Count), and Desired Capacity (Count)&lt;/li&gt;
&lt;li&gt;Pending Instances (Count)&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/619/add-query-group-asg-metrics-to-query-group-cw-dashboard</guid>
<pubDate>Thu, 27 May 2021 17:22:27 +0000</pubDate>
</item>
<item>
<title>How might multiple systems serve the same database in different contexts?</title>
<link>https://ask.datomic.com/index.php/617/might-multiple-systems-serve-database-different-contexts</link>
<description>&lt;p&gt;From &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/operation/planning.html#namin&quot;&gt;the guide on naming&lt;/a&gt; there is the following quote:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Multiple systems might serve the same primary database in different development stages. So you might name systems via the convention &quot;[db]-[stage]&quot;, e.g.&quot;inventory-dev&quot;, &quot;inventory-staging&quot; and &quot;inventory-prod&quot;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I'm trying to understand how this would work, and how I should think about my system, application, and database name, but I'm not really sure how this would work.&lt;/p&gt;
&lt;p&gt;My understanding was that you have one System per Storage stack, plus some number of Compute stacks, and that databases are &quot;owned&quot; by the Storage stack, but that doesn't make sense with the quote above.&lt;/p&gt;
&lt;p&gt;Can anyone give some examples of how this would work? I've read &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/operation/planning.html&quot;&gt;the planning guide&lt;/a&gt; but almost certainly don't fully understand it.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;br&gt;
Evan&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/617/might-multiple-systems-serve-database-different-contexts</guid>
<pubDate>Mon, 24 May 2021 15:16:46 +0000</pubDate>
</item>
<item>
<title>What is a performant way to do &quot;and&quot; matching on attribute values?</title>
<link>https://ask.datomic.com/index.php/613/what-is-performant-way-to-do-and-matching-on-attribute-values</link>
<description>&lt;p&gt;So I can use&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[?entity1 ?attrname1 ?attrval]
[?entity2 ?attrname2 ?attrval]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in a &lt;code&gt;:where&lt;/code&gt;  clause to get &lt;code&gt;?entity1&lt;/code&gt; and &lt;code&gt;?entity2&lt;/code&gt; where there exists an &lt;code&gt;?attrval&lt;/code&gt; that matches&lt;/p&gt;
&lt;p&gt;I'm using&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  [(q '[:find (seq ?attrval)
        :in $ ?entity ?attrname
        :where [?entity ?attrname ?attrval]]
      db ?entity1 ?attrname1) [[?attrvals1]]]
  [(q '[:find (seq ?attrval)
        :in $ ?entity ?attrname
        :where [?entity ?attrname ?attrval]]
      db ?entity2 ?attrname2) [[?attrvals2]]]
  (not-join [?attrvals1 ?attrvals2]
               [(seq ?attrvals1) [?element ...]]
               (not [(contains? ?attrvals2 ?element)]))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to get &lt;code&gt;?entity1&lt;/code&gt;  and &lt;code&gt;?entity2&lt;/code&gt; where all &lt;code&gt;?attrval&lt;/code&gt;s for &lt;code&gt;?entity1&lt;/code&gt; exist for &lt;code&gt;?entity2&lt;/code&gt;. Is there a more performant way to do this??&lt;br&gt;
(This feels like a directional &quot;and&quot; to the implicit &quot;or&quot; being applied to each &lt;code&gt;attrval&lt;/code&gt; matching in the first case)&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/613/what-is-performant-way-to-do-and-matching-on-attribute-values</guid>
<pubDate>Fri, 21 May 2021 18:04:41 +0000</pubDate>
</item>
<item>
<title>AssertionError shows up as an Event?</title>
<link>https://ask.datomic.com/index.php/609/assertionerror-shows-up-as-an-event</link>
<description>&lt;p&gt;This surprised me.  In a lambda invocation, a failed &lt;code&gt;assert&lt;/code&gt; shows up as an &lt;code&gt;Event&lt;/code&gt;. I would have expected &lt;code&gt;Alert&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&quot;Msg&quot;: &quot;IonLambdaException&quot;,
&quot;Ex&quot;: {
    &quot;Via&quot;: [
        {
            &quot;Type&quot;: &quot;java.lang.AssertionError&quot;,
            &quot;Message&quot;: &quot;Assert failed: (= (count s) 16)&quot;,
        }
    ],
    &quot;Cause&quot;: &quot;Assert failed: (= (count s) 16)&quot;
},
&quot;Type&quot;: &quot;Event&quot;,
&quot;Tid&quot;: 338,
&quot;Timestamp&quot;: 162134781093
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/609/assertionerror-shows-up-as-an-event</guid>
<pubDate>Tue, 18 May 2021 15:33:51 +0000</pubDate>
</item>
<item>
<title>Additional keys on anomaly part of the API?</title>
<link>https://ask.datomic.com/index.php/608/additional-keys-on-anomaly-part-of-the-api</link>
<description>&lt;p&gt;Datomic sometimes attaches additional keys onto the anomaly in ex-data on the &lt;code&gt;ExceptionInfo&lt;/code&gt;s thrown. Is this additional data part of the API and able to be depended on? Further, could all keys returned be documented in the &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/client-api/datomic.client.api.html&quot;&gt;api docs&lt;/a&gt;? The returned keys are typically quite helpful in dispatching on different Datomic error &quot;types.&quot;&lt;/p&gt;
&lt;p&gt;Here's an example.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def client (d/client {:server-type :dev-local
                       :storage-dir :mem
                       :system      &quot;aa&quot;}))
=&amp;gt; #'compute.http-api.public.task/client
(d/create-database client {:db-name &quot;test&quot;})
=&amp;gt; true
(def conn (d/connect client {:db-name &quot;test&quot;}))
=&amp;gt; #'compute.http-api.public.task/conn
(d/transact conn {:tx-data [{:db/ident       :user/id
                             :db/cardinality :db.cardinality/one
                             :db/valueType   :db.type/string
                             :db/unique      :db.unique/identity}
                            {:db/ident       :user/name
                             :db/cardinality :db.cardinality/one
                             :db/valueType   :db.type/string
                             :db/unique      :db.unique/identity}]})
=&amp;gt;
{:db-before #datomic.core.db.Db{:id &quot;47c8f6f7-26f9-4575-97ec-7fc0948823c1&quot;,
                                :basisT 5,
                                :indexBasisT 0,
                                :index-root-id nil,
                                :asOfT nil,
                                :sinceT nil,
                                :raw nil},
 :db-after #datomic.core.db.Db{:id &quot;47c8f6f7-26f9-4575-97ec-7fc0948823c1&quot;,
                               :basisT 6,
                               :indexBasisT 0,
                               :index-root-id nil,
                               :asOfT nil,
                               :sinceT nil,
                               :raw nil},
 :tx-data [#datom[13194139533318 50 #inst&quot;2021-05-09T01:32:25.677-00:00&quot; 13194139533318 true]
           #datom[73 10 :user/id 13194139533318 true]
           #datom[73 41 35 13194139533318 true]
           #datom[73 40 23 13194139533318 true]
           #datom[73 42 38 13194139533318 true]
           #datom[74 10 :user/name 13194139533318 true]
           #datom[74 41 35 13194139533318 true]
           #datom[74 40 23 13194139533318 true]
           #datom[74 42 38 13194139533318 true]
           #datom[0 13 73 13194139533318 true]
           #datom[0 13 74 13194139533318 true]],
 :tempids {}}
(d/transact conn {:tx-data [{:db/id     [:user/id &quot;a&quot;]
                             :user/name &quot;a&quot;}]})
Execution error (ExceptionInfo) at datomic.core.error/raise (error.clj:55).
:db.error/not-an-entity Unable to resolve entity: [:user/id &quot;a&quot;] in datom [[:user/id &quot;a&quot;] :user/name &quot;a&quot;]
(ex-data *e)
=&amp;gt;
{:cognitect.anomalies/category :cognitect.anomalies/incorrect,
 :cognitect.anomalies/message &quot;Unable to resolve entity: [:user/id \&quot;a\&quot;] in datom [[:user/id \&quot;a\&quot;] :user/name \&quot;a\&quot;]&quot;,
 :entity [:user/id &quot;a&quot;],
 :datom [[:user/id &quot;a&quot;] :user/name &quot;a&quot;],
 :db/error :db.error/not-an-entity}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/608/additional-keys-on-anomaly-part-of-the-api</guid>
<pubDate>Sun, 09 May 2021 01:33:17 +0000</pubDate>
</item>
<item>
<title>Use Launch Template instead of Launch Configuration</title>
<link>https://ask.datomic.com/index.php/607/use-launch-template-instead-of-launch-configuration</link>
<description>&lt;p&gt;The compute Datomic CloudFormation templates (primary and query groups) create ASGs using launch configurations. Launch configurations do not support the full set of Auto Scaling group features. For example, you cannot create an Auto Scaling group that launches both Spot and On-Demand Instances or that specifies multiple instance types or multiple launch templates. In fact, &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg.html&quot;&gt;AWS recommends&lt;/a&gt; creating ASGs using launch templates, not launch configurations. &lt;/p&gt;
&lt;p&gt;We are interested in launch templates for its support for using Spot and On-Demand instances.&lt;/p&gt;
&lt;p&gt;EDIT: As of &lt;a rel=&quot;nofollow&quot; href=&quot;https://aws.amazon.com/blogs/compute/amazon-ec2-auto-scaling-will-no-longer-add-support-for-new-ec2-features-to-launch-configurations/&quot;&gt;2021-10-20&lt;/a&gt;, launch templates will not receive any new EC2 ASG features. &lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/607/use-launch-template-instead-of-launch-configuration</guid>
<pubDate>Fri, 07 May 2021 23:38:51 +0000</pubDate>
</item>
<item>
<title>Does the transactor eagerly fill memcached with indexed segments?</title>
<link>https://ask.datomic.com/index.php/605/does-transactor-eagerly-fill-memcached-with-indexed-segments</link>
<description>&lt;p&gt;The datomic &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/on-prem/overview/caching.html#memcached&quot;&gt;transactor memcached documentation&lt;/a&gt; says this:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;When configured to used memcached, a Datomic process will automatically write into memcached any segment it needs that is not already present in memcached. &lt;strong&gt;In addition, the transactor (only) will write index and log segments to memcached as the segments are produced.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(Emphasis mine.)&lt;/p&gt;
&lt;p&gt;Based on this sentence and assuming a memcached memory pool larger than the storage size that is shared by transactor and peer, my expectation is the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;As the transactor is building an index, it writes newly-created index segments to storage &lt;em&gt;and&lt;/em&gt; to memcached at roughly the same time.&lt;/li&gt;
&lt;li&gt;When the index is finished, it commits the new index root and informs all peers of the new index.&lt;/li&gt;
&lt;li&gt;Any peers using the &lt;em&gt;same&lt;/em&gt; memcached cluster should, at the moment the index is released:&lt;ul&gt;
&lt;li&gt;have a &lt;em&gt;decreasing&lt;/em&gt; ObjectCache hitrate because newly-indexed segments are not cached&lt;/li&gt;
&lt;li&gt;but an &lt;em&gt;increasing&lt;/em&gt; memcached GET count&lt;/li&gt;
&lt;li&gt;and a flat StorageGet and MemcachedPut count because the segments are already in memcached&lt;/li&gt;
&lt;li&gt;For an overall flat or increasing memcached hitrate.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Instead, what I actually see is that when peers accept a new index,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;there's a &lt;em&gt;dramatic&lt;/em&gt; decrease in Memcached hitrate&lt;/li&gt;
&lt;li&gt;and increase in MemcachedPut counts and Storage Get counts.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;IndexWrite&lt;/code&gt; count reported by the transactor is very similar to the MemcachedPut count reported by the peer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This behavior is consistent with the transactor &lt;em&gt;not&lt;/em&gt; writing newly-indexed segments into memcached eagerly while indexing, which is contrary to the documentation.&lt;/p&gt;
&lt;p&gt;So the question: &lt;strong&gt;Does the transactor &lt;em&gt;really&lt;/em&gt; write index segments to memcached as it is indexing?&lt;/strong&gt;&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/605/does-transactor-eagerly-fill-memcached-with-indexed-segments</guid>
<pubDate>Wed, 07 Apr 2021 15:21:18 +0000</pubDate>
</item>
<item>
<title>Support for recent AWS instance types</title>
<link>https://ask.datomic.com/index.php/604/support-for-recent-aws-instance-types</link>
<description>&lt;p&gt;AWS has released several new instance types that are much better price per performance. It'd be great to have the Datomic query group template updated to support these instance types. The Datomic query group template currently supports the following instance types: t3.medium, m5.large, i3.large, i3.xlarge. Based on this, I propose the following additions: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;t3a.medium (~10% cheaper than t3.medium)&lt;/li&gt;
&lt;li&gt;m5a.large (~10% cheaper than m5.large)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If Datomic can run on ARM based processors then further additions can be made with even better price per performance (the new AWS Graviton2 processors are fantastic. &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.honeycomb.io/blog/graviton2-one-year-retrospective/&quot;&gt;Read about Honeycomb's success&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;t4g.medium (perhaps also large and xlarge, ~20% cheaper than t3.medium)&lt;/li&gt;
&lt;li&gt;m6g.large (~20% cheaper than m5.large)&lt;/li&gt;
&lt;li&gt;r6gd.large	(has NVMe based SSD, 26% cheaper than i3.large)&lt;/li&gt;
&lt;li&gt;I4i (&lt;a rel=&quot;nofollow&quot; href=&quot;https://aws.amazon.com/blogs/aws/new-storage-optimized-amazon-ec2-instances-i4i-powered-by-intel-xeon-scalable-ice-lake-processors/&quot;&gt;released 2022-04-28&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Datomic Solo instance type could also be configurable for some inconsequential savings. See monthly prices below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;(Current) t3.small primary + t3.nano bastion: $18.90&lt;/li&gt;
&lt;li&gt;t3a.small + t3a.nano: $17.15&lt;/li&gt;
&lt;li&gt;t4g.small + t4g.nano: $15.33&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An example Datomic query group monthly prices. Take a query group with 2 nodes running for the full month. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;(Current) m5.large: $140.16&lt;/li&gt;
&lt;li&gt;m5a.large: $125.56 ($14.6/month savings)&lt;/li&gt;
&lt;li&gt;m6g.large: $112.42 ($27.74/month savings)&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/604/support-for-recent-aws-instance-types</guid>
<pubDate>Wed, 24 Mar 2021 18:36:03 +0000</pubDate>
</item>
<item>
<title>Make DesiredCapacity an optional parameter in the query group CF template</title>
<link>https://ask.datomic.com/index.php/603/desiredcapacity-optional-parameter-query-group-template</link>
<description>&lt;p&gt;Currently (March 2021) the Datomic query group CF template has the DesiredCapacity parameter marked as required. Because of this, during a CF template update, CF will always set the DesiredCapacity to the CF parameter for DesiredCapacity. This behavior does not work well in the following situation. &lt;/p&gt;
&lt;p&gt;In the query group template I have the &lt;code&gt;DesiredCapacity&lt;/code&gt; at 2, and &lt;code&gt;MaxCount&lt;/code&gt; at 4. I have an ASG scaling policy to target track 50% average CPU utilization. My query group is currently at the max, because the ASG scaling policy scaled up the group DesiredCapacity to 4 (to match my load). My load has increased to the point where 4 nodes is no longer sufficient. I must update the query group CF template to increase the MacCount. The problem is that when you update the MacCount from 4 to 6 via a CF template update and leave the DesiredCapacity at 2, CF will actually set the DesiredCapacity on the ASG to 2 during the high load situation. This worsens the high load situation. &lt;/p&gt;
&lt;p&gt;One option is to query the ASG for its current DesiredCapacity prior to running a CF update and set the CF parameter to the value you retrieved. This approach complicates the update procedure. It also has a &quot;read-modify-write&quot; race condition -- the DesiredCapacity could have changed from the time you read the DesiredCapacity to the time you are performing the CF update. &lt;/p&gt;
&lt;p&gt;A second option is to make the &lt;code&gt;DesiredCapacity&lt;/code&gt; parameter optional. As per the &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-desiredcapacity&quot;&gt;CF docs&lt;/a&gt;, &lt;code&gt;DesiredCapacity&lt;/code&gt; is not a required parameter. When it is not present, it defaults to the minimum size of the group. Leaving &lt;code&gt;DesiredCapacity&lt;/code&gt; unset will make it so during a CF update, CF will not modify the &lt;code&gt;DesiredCapacity&lt;/code&gt; at all -- leaving the ASG &quot;in control.&quot;&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/603/desiredcapacity-optional-parameter-query-group-template</guid>
<pubDate>Wed, 24 Mar 2021 17:24:25 +0000</pubDate>
</item>
<item>
<title>I am now seeing Iterator+offset is not available doing a an index-pull</title>
<link>https://ask.datomic.com/index.php/601/am-now-seeing-iterator-offset-not-available-doing-index-pull</link>
<description>&lt;p&gt;I am doing an index-pull in Datomic Cloud.  The request was timing out so I addedd :timeout 300000 and not &quot;Iterator+offset is not available&quot; exception starts popping up&lt;/p&gt;
&lt;p&gt;We are on 781-9041&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/601/am-now-seeing-iterator-offset-not-available-doing-index-pull</guid>
<pubDate>Mon, 08 Mar 2021 16:46:35 +0000</pubDate>
</item>
<item>
<title>Reverse order browsing for raw indexes</title>
<link>https://ask.datomic.com/index.php/582/reverse-order-browsing-for-raw-indexes</link>
<description>&lt;p&gt;Hello,&lt;br&gt;
The &lt;code&gt;index-pull&lt;/code&gt; function has the &lt;code&gt;:reverse&lt;/code&gt; option to go through the index in reverse order.&lt;br&gt;
Would it be possible to add it to the raw index browsing functions &lt;code&gt;index-range&lt;/code&gt; and &lt;code&gt;seek-datoms&lt;/code&gt; ?&lt;/p&gt;
</description>
<category>Peer API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/582/reverse-order-browsing-for-raw-indexes</guid>
<pubDate>Mon, 25 Jan 2021 11:39:25 +0000</pubDate>
</item>
<item>
<title>Dev-local query does not support :timeout</title>
<link>https://ask.datomic.com/index.php/564/dev-local-query-does-not-support-timeout</link>
<description>&lt;p&gt;Dev-local 0.9.229 does not appear to support &lt;code&gt;:timeout&lt;/code&gt; when querying. Here is a repro. &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def client (d/client {:server-type :dev-local
                       :system      &quot;example&quot;}))
(d/create-database client {:db-name &quot;example&quot;})
(def conn (d/connect client {:db-name &quot;example&quot;}))
(d/transact conn {:tx-data [{:db/ident       :string
                             :db/cardinality :db.cardinality/one
                             :db/valueType   :db.type/string}]})
(dotimes [n 1000]
  (d/transact conn {:tx-data (map (fn [i]
                                    {:string (str n i)}) (range 1000))}))
(first
  (d/q {:query   '[:find (pull ?e [*])
                   :where
                   [?e :string]]
        :timeout 1000
        :args    [(d/db conn)]}))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The query takes longer than 1s and does not throw. I would have expected an exception thrown. &lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/564/dev-local-query-does-not-support-timeout</guid>
<pubDate>Wed, 30 Dec 2020 21:25:39 +0000</pubDate>
</item>
<item>
<title>Add default :timeout to client api ns docstring</title>
<link>https://ask.datomic.com/index.php/563/add-default-timeout-to-client-api-ns-docstring</link>
<description>&lt;p&gt;It'd be great to have the default value for &lt;code&gt;:timeout&lt;/code&gt; (60000) included in the &lt;code&gt;datomic.client.api&lt;/code&gt; ns docstring. Currently this value can only be found in the &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/client/client-api.html#timeouts&quot;&gt;docs on the website&lt;/a&gt;. As of client-cloud 0.8.102, the ns docstring specifies the default value for &lt;code&gt;:limit&lt;/code&gt;. &lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/563/add-default-timeout-to-client-api-ns-docstring</guid>
<pubDate>Thu, 24 Dec 2020 00:12:44 +0000</pubDate>
</item>
<item>
<title>Datomic Client API equivalent to on-prem tx-&gt;t, t-&gt;tx</title>
<link>https://ask.datomic.com/index.php/562/datomic-client-api-equivalent-to-on-prem-tx-t-t-tx</link>
<description>&lt;p&gt;The Datomic client API does not provider &lt;code&gt;tx-&amp;gt;t&lt;/code&gt; or &lt;code&gt;t-&amp;gt;tx&lt;/code&gt;. These functions can be useful for very specific scenarios (e.g., you have a tx id and want to know if the database has &quot;moved forward&quot;). &lt;/p&gt;
&lt;p&gt;This was also requested on &lt;a rel=&quot;nofollow&quot; href=&quot;https://forum.datomic.com/t/datomic-client-api-equivalent-to-on-prem-tx-t/851&quot;&gt;the forums&lt;/a&gt;. A workaround was provided for the user's specific case but the request is still relevant. &lt;/p&gt;
</description>
<category>Client API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/562/datomic-client-api-equivalent-to-on-prem-tx-t-t-tx</guid>
<pubDate>Mon, 21 Dec 2020 00:25:17 +0000</pubDate>
</item>
<item>
<title>Allow dev-local import-cloud :source and :dest to work with any :server-type</title>
<link>https://ask.datomic.com/index.php/561/allow-dev-local-import-cloud-source-dest-work-with-server-type</link>
<description>&lt;p&gt;Currently &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/dev-local.html#import-cloud&quot;&gt;import-cloud&lt;/a&gt; requires the &lt;code&gt;:source&lt;/code&gt; client &lt;code&gt;:server-type&lt;/code&gt; to be &lt;code&gt;:cloud&lt;/code&gt; and the &lt;code&gt;:dest&lt;/code&gt; &lt;code&gt;:server-type&lt;/code&gt; to be &lt;code&gt;:dev-local&lt;/code&gt;. It'd be great if this function allowed any &lt;code&gt;:server-type&lt;/code&gt; to be passed for &lt;code&gt;:source&lt;/code&gt; and &lt;code&gt;:dest&lt;/code&gt;. A possible use case would be copying a dev-local database to a cloud system for testing in a staging environment. &lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/561/allow-dev-local-import-cloud-source-dest-work-with-server-type</guid>
<pubDate>Sun, 20 Dec 2020 00:37:33 +0000</pubDate>
</item>
<item>
<title>How do I initialize core.async connections in Datomic Cloud?</title>
<link>https://ask.datomic.com/index.php/539/how-do-i-initialize-core-async-connections-in-datomic-cloud</link>
<description>&lt;p&gt;I need to &quot;hook up&quot; a core.async channel to a thread on system initialization. How might I go about doing this, or doing any initialization tasks?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br&gt;
Hadil&lt;/p&gt;
</description>
<category>Ions</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/539/how-do-i-initialize-core-async-connections-in-datomic-cloud</guid>
<pubDate>Sat, 28 Nov 2020 23:53:01 +0000</pubDate>
</item>
<item>
<title>How can I get a ring-like request in ionized web handlers?</title>
<link>https://ask.datomic.com/index.php/537/how-can-i-get-a-ring-like-request-in-ionized-web-handlers</link>
<description>&lt;p&gt;Hello! After hearing the talks and reading the tutorial and documentation, I was under the impression that ions receive their requests in a ring-like format, and that we can &quot;wire a web handler to a single function, using a routing library such as Compojure or pedestal.&quot;&lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/ions/ions-tutorial.html#conclusion&quot;&gt;1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On one hand, this seems to be true with standard ion lambdas, but these are not exposed to the web. OTOH if we want to expose our web service, we need to write a web handler that we'll ionize. When we do that, the requests coming in lose their ring-like shape, and only expose the following keys:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; :headers
 :server-name
 :body
 :datomic.ion.edn.api-gateway/json
 :datomic.ion.edn.api-gateway/data
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With that, our router (reitit backed by ring) fails.&lt;/p&gt;
&lt;p&gt;I have seen different examples on the web where some router is exposed behind a single web handler, the most promising of which being probably &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/markbastian/replion&quot;&gt;Replion (look at the code)&lt;/a&gt; (and he uses reitit and ring and seems to have more success than us) and &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/pedestal/pedestal-ions-sample&quot;&gt;Pedestal Ions Sample&lt;/a&gt; (but Pedestal works in a relaxed ring context).&lt;/p&gt;
&lt;p&gt;So my question is: is there something obvious that I don't understand? Are there more working examples? Some people seem to write adapters to transform the requests to make them more ring-like. Are they doing the right thing, or are we all missing something?&lt;/p&gt;
&lt;p&gt;For example, here's a very naive adapter:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn get-path [req]
  (let [s (get-in req [:datomic.ion.edn.api-gateway/data :requestContext :stage] &quot;stg&quot;)
        p (get-in req [:datomic.ion.edn.api-gateway/data :requestContext :http :path] &quot;/&quot;)]
    (get (str/split p (re-pattern (str &quot;/&quot; s))) 1 &quot;/&quot;))) ; get rid of stage leading path!

(defn req-&amp;gt;ring-req [req]
  (assoc req
         :protocol (get-in req
                           [:datomic.ion.edn.api-gateway/data :requestContext :http :protocol] &quot;HTTP/1.1&quot;)
         :remote-addr (get-in req [:headers &quot;host&quot;] &quot;example.com&quot;)
         :request-method (keyword
                          (str/lower-case
                           (get-in req [:datomic.ion.edn.api-gateway/data :requestContext :http :method] &quot;GET&quot;)))
         :uri (get-path req)))

(defn app
  &quot;Web handler that returns the app's responses for each web request.&quot;
  [arg]
  (let [sta (start! arg)
        req (req-&amp;gt;ring-req arg)
        ret ((handler/app) req)]
    ret))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Another related question is: what is the &lt;code&gt;:integration&lt;/code&gt; key on &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/cloud/ions/ions-reference.html#lambda-config&quot;&gt;lambda configurations&lt;/a&gt;? Why does &quot;nobody&quot; use it, except Stu's slack event handler? What does it do? We tried setting it and didn't seem to observe an impact.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description>
<category>Ions</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/537/how-can-i-get-a-ring-like-request-in-ionized-web-handlers</guid>
<pubDate>Thu, 26 Nov 2020 19:04:57 +0000</pubDate>
</item>
<item>
<title>What to do about &quot;syncContext completed and\/or Request lifecycle recycled&quot;?</title>
<link>https://ask.datomic.com/index.php/514/what-about-synccontext-completed-request-lifecycle-recycled</link>
<description>&lt;p&gt;We get into a state where we see a lot of &lt;code&gt;syncContext completed and\/or Request lifecycle recycled&lt;/code&gt; &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What does it mean?&lt;/li&gt;
&lt;li&gt;What can be done about it?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The stack trace is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&quot;Trace&quot;: [
            [
                &quot;org.eclipse.jetty.server.AsyncContextState&quot;,
                &quot;state&quot;,
                &quot;AsyncContextState.java&quot;,
                52
            ],
            [
                &quot;org.eclipse.jetty.server.AsyncContextState&quot;,
                &quot;getResponse&quot;,
                &quot;AsyncContextState.java&quot;,
                118
            ],
            [
                &quot;cognitect.http_endpoint.jetty$respond_bbuf_STAR_&quot;,
                &quot;invokeStatic&quot;,
                &quot;jetty.clj&quot;,
                326
            ],
            [
                &quot;cognitect.http_endpoint.jetty$respond_bbuf_STAR_&quot;,
                &quot;invoke&quot;,
                &quot;jetty.clj&quot;,
                323
            ],
            [
                &quot;cognitect.http_endpoint.jetty$respond_bbuf&quot;,
                &quot;invokeStatic&quot;,
                &quot;jetty.clj&quot;,
                351
            ],
            [
                &quot;cognitect.http_endpoint.jetty$respond_bbuf&quot;,
                &quot;invoke&quot;,
                &quot;jetty.clj&quot;,
                348
            ],
            [
                &quot;cognitect.http_endpoint.Endpoint&quot;,
                &quot;fail_request&quot;,
                &quot;http_endpoint.clj&quot;,
                126
            ],
            [
                &quot;cognitect.http_endpoint.Endpoint&quot;,
                &quot;respond&quot;,
                &quot;http_endpoint.clj&quot;,
                147
            ],
            [
                &quot;cognitect.http_endpoint.Endpoint$fn__13082$state_machine__8637__auto____13127$fn__13129&quot;,
                &quot;invoke&quot;,
                &quot;http_endpoint.clj&quot;,
                199
            ],
            [
                &quot;cognitect.http_endpoint.Endpoint$fn__13082$state_machine__8637__auto____13127&quot;,
                &quot;invoke&quot;,
                &quot;http_endpoint.clj&quot;,
                199
            ],
            [
                &quot;clojure.core.async.impl.ioc_macros$run_state_machine&quot;,
                &quot;invokeStatic&quot;,
                &quot;ioc_macros.clj&quot;,
                978
            ],
            [
                &quot;clojure.core.async.impl.ioc_macros$run_state_machine&quot;,
                &quot;invoke&quot;,
                &quot;ioc_macros.clj&quot;,
                977
            ],
            [
                &quot;clojure.core.async.impl.ioc_macros$run_state_machine_wrapped&quot;,
                &quot;invokeStatic&quot;,
                &quot;ioc_macros.clj&quot;,
                982
            ],
            [
                &quot;clojure.core.async.impl.ioc_macros$run_state_machine_wrapped&quot;,
                &quot;invoke&quot;,
                &quot;ioc_macros.clj&quot;,
                980
            ],
            [
                &quot;clojure.core.async.impl.ioc_macros$take_BANG_$fn__5769&quot;,
                &quot;invoke&quot;,
                &quot;ioc_macros.clj&quot;,
                991
            ],
            [
                &quot;clojure.core.async.impl.channels.ManyToManyChannel$fn__589$fn__590&quot;,
                &quot;invoke&quot;,
                &quot;channels.clj&quot;,
                95
            ],
            [
                &quot;clojure.lang.AFn&quot;,
                &quot;run&quot;,
                &quot;AFn.java&quot;,
                22
            ],
            [
                &quot;java.util.concurrent.ThreadPoolExecutor&quot;,
                &quot;runWorker&quot;,
                &quot;ThreadPoolExecutor.java&quot;,
                1149
            ],
            [
                &quot;java.util.concurrent.ThreadPoolExecutor$Worker&quot;,
                &quot;run&quot;,
                &quot;ThreadPoolExecutor.java&quot;,
                624
            ],
            [
                &quot;clojure.core.async.impl.concurrent$counted_thread_factory$reify__492$fn__493&quot;,
                &quot;invoke&quot;,
                &quot;concurrent.clj&quot;,
                29
            ],
            [
                &quot;clojure.lang.AFn&quot;,
                &quot;run&quot;,
                &quot;AFn.java&quot;,
                22
            ],
            [
                &quot;java.lang.Thread&quot;,
                &quot;run&quot;,
                &quot;Thread.java&quot;,
                748
            ]
        ]
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/514/what-about-synccontext-completed-request-lifecycle-recycled</guid>
<pubDate>Mon, 16 Nov 2020 22:03:14 +0000</pubDate>
</item>
<item>
<title>Provide way to interact with a datomic database before making the system available</title>
<link>https://ask.datomic.com/index.php/500/provide-interact-datomic-database-before-making-available</link>
<description>&lt;p&gt;Currently in Cloud there is no way to interact with a datomic database before making the system available for external requests.&lt;/p&gt;
&lt;p&gt;Potential uses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;deploy the same code everywhere (dev &amp;amp; prod) and it does db-ensure&lt;br&gt;
actions&lt;/li&gt;
&lt;li&gt;load data and/or schema prior to the system being live &lt;/li&gt;
&lt;li&gt;start components or other system-management tooling&lt;/li&gt;
&lt;li&gt;provide (easy) way to integrate startup (e.g. mount/system-component) &lt;/li&gt;
&lt;li&gt;provide status and ability to know when pieces are started so you can finish app initialization&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/500/provide-interact-datomic-database-before-making-available</guid>
<pubDate>Mon, 02 Nov 2020 15:45:42 +0000</pubDate>
</item>
<item>
<title>Does dev-local/import-cloud handle failure in the middle of an import?</title>
<link>https://ask.datomic.com/index.php/495/does-dev-local-import-cloud-handle-failure-the-middle-import</link>
<description>&lt;p&gt;When running an import-cloud, does dev-local gracefully handle import-cloud failing in the middle of the import? i.e., it fails (gets killed or throws) and I can call import-cloud again without worrying about corrupt data, missing data, etc. &lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/495/does-dev-local-import-cloud-handle-failure-the-middle-import</guid>
<pubDate>Fri, 30 Oct 2020 16:21:53 +0000</pubDate>
</item>
<item>
<title>Bind Ions to IAM roles separate from their ambient compute role</title>
<link>https://ask.datomic.com/index.php/465/bind-ions-iam-roles-separate-from-their-ambient-compute-role</link>
<description>&lt;p&gt;Right now Ions run under the role of the underlying compute resources that they are deployed to. It would be nice to be able to give Ions a role independent of the ambient compute. This can be managed by the Ion runtime machinery by calling AssumeRole in the background, and supplying those creds to the Ions&lt;/p&gt;
&lt;p&gt;This is important so that Ions don't have to run with the permissions of all the other ions running in the same compute.&lt;/p&gt;
</description>
<category>Ions</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/465/bind-ions-iam-roles-separate-from-their-ambient-compute-role</guid>
<pubDate>Sun, 25 Oct 2020 19:58:49 +0000</pubDate>
</item>
<item>
<title>Expose an alt-port transactor configuration property</title>
<link>https://ask.datomic.com/index.php/469/expose-an-alt-port-transactor-configuration-property</link>
<description>&lt;p&gt;The alt-host configuration property is great and helps in many scenarios, but not having an equivalent for the port (alt-port?) is a blocker in some other scenarios. It would be great to have such property, which would default to the same port as the transactor is listening.&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/469/expose-an-alt-port-transactor-configuration-property</guid>
<pubDate>Sun, 25 Oct 2020 19:45:14 +0000</pubDate>
</item>
</channel>
</rss>