Datomic Pro and Datomic Cloud are FREE!

Implicit Partitions

If you have an application that is struggling with performance, it might be due to poor data locality, the physical distribution of relevant information. A query that is searching for sparsely distributed data will find few results per storage read. Conversely, queries can efficiently slurp relevant data when it is densely colocated. Datomic’s partitions allow applications to group entities together and gain control over locality. Entities that share a partition will be colocated in the E-leading indexes, EAVT and AEVT. Because each partition requires a name and installation prior to its use, it can become cumbersome to build schemes that use many partitions.

Today’s release of Datomic On-Prem includes a new feature: Implicit Partitions. These partitions are identified by an integer, and they are usable without an installation step. There are 524288 (2^19) implicit partitions in each Datomic database, and these facilitate the use of algorithmic partition assignment strategies, e.g. deterministically assigning each customer to a particular partition, or assigning time-windowed data to different partitions.

Applications can transact entities into implicit partitions by passing one to d/tempid:

(d/transact conn [{:db/id (d/tempid (d/implicit-part 55))
                   :movie/title "The Great Gatsby"}])

We are also introducing two new transaction data directives that facilitate partition assignment. To request put a new entity into a particular partition, you can include its tempid in the :db/force-partition map. This can appear anywhere in a transaction map form. Here is the same transaction using this directive with a string tempid:

(d/transact conn [{:db/id "movie"
                   :movie/title "The Great Gatsby"
                   :db/force-partition {"movie" (d/implicit-part 55)}}])

The :db/match-partition directive says that an entity should have the same partition as another entity. Here, both items will be in the same partition as its order, which is in implicit partition 15555:

(d/transact conn
            [{:db/id    "order"
              :order/id 123
              :order/items ["item1" "item2"]}

             {:db/id     "item1"
              :item/name "cereal"
              :item/sku  "A150"}

             {:db/id     "item2"
              :item/name "milk"
              :item/sku  "T770"}

             {:db/force-partition {"order" (d/implicit-part 15555)}
              :db/match-partition {"item1" "order"
                                   "item2" "order"}}])

To learn more about implicit partitions, read the documentation for Implicit Partitions and Controlling Partition Assignment, and the API documentation for Datomic On-Prem.

..

Query Stats

Today’s release of Datomic On-Prem, and coming soon in Cloud, includes a new feature: query-stats.

query-stats is a new feature that gives users visibility into the decisions made by the query engine while it processed your query. Datomic users can leverage the information returned by query-stats to find the optimal clause ordering for a query as well as gain visibility into various query components including query clauses, query rules, and query expressions.

For example, given the following query:

{:find  [(count ?artist-name)]
 :where [[?release :release/name ?release-name]
         [?release :release/artists ?artist]
         [?artist :artist/name ?artist-name]]}

The following query-stats are returned:

{:ret         [[4587]],
 :query-stats {:query  {:find  [(count ?artist-name)],
                        :where [[?release :release/name ?release-name]
                                [?release :release/artists ?artist]
                                [?artist :artist/name ?artist-name]]},
               :phases [{:sched   (([?release :release/name ?release-name]
                                    [?release :release/artists ?artist]
                                    [?artist :artist/name ?artist-name])),
                         :clauses [{:clause [?release :release/name ?release-name], :rows-in 0, :rows-out 11434, :binds-in (), :binds-out [?release], :expansion 11434, :warnings {:unbound-vars #{?release ?release-name}}}
                                   {:clause [?release :release/artists ?artist], :rows-in 11434, :rows-out 4600, :binds-in [?release], :binds-out [?artist]}
                                   {:clause [?artist :artist/name ?artist-name], :rows-in 4600, :rows-out 4587, :binds-in [?artist], :binds-out [?artist-name]}]}]}}

This output can be more easily interpreted using REBL:

40473ee8 8ba1 480f 92ed 28af07fe858f

To learn more about query-stats and other enhancements:

Read the release announcement for Datomic On-Prem.

Read the API documentation for Datomic On-Prem.

..

Datomic Cloud 884-9095: New tiers and internet access

Datomic Cloud 884-9095 is a major new release offering more instance options, lower pricing, API Gateway automation for ions and clients, and more.

More instance options

Datomic now provides a wider variety of compute, memory, and monitoring choices. Basic compute instances start from t3.small and step up to t3.2xlarge, letting you ramp up on capability and cost linearly.

Lower pricing at all scales

All instances sizes now cost less to run. If you were running Solo before, you can now run the smallest production tier, including a load balancer, for what solo cost before. If you are running production, your cost will be lower at your current instance size, and you may be able to select a smaller instance size as well.

New automation ion web applications

Datomic’s CloudFormation templates can automatically setup both the VPC link and API Gateway needed to expose your web application (ion).

New client access from outside the VPC

Building on the new API Gateway automation, you can now elect to access your Datomic cloud system via an automatically-configured API Gateway, obviating the need for an access gateway and SOCKS proxy.

Run and scale analytics anywhere

Datomic analytics support is now available via a Datomic connector for Trino. With this connector, you can run analytics anywhere that you would like, e.g. a dev laptop or a cluster in EC2. You can also access Trino features including clustering and federation.

Security first

All of the new access points described above (web ions, client access, and analytics) are secured via TLS, and Datomic compute nodes continue to run in a private VPC.

Metrics choices

Datomic metrics are now available in two tiers: basic or detailed. (You can also turn off metrics entirely.) These choices let you minimize cost or maximize observability, independently for each compute group.

Try it

If you are an existing Datomic Cloud user, this release significantly simplifies operations. Before you upgrade, please read the changelog carefully, so that you understand all the things you will no longer need to do.

If you are new to Datomic Cloud, getting started has never been easier.

..

Cognitect Joins Nubank!

We are thrilled to announce that Cognitect is joining the Nubank family of companies. This is the next step in a long relationship, and opens new opportunities for Clojure and Datomic worldwide. Please read the full story over on the Cognitect Blog.

..


2 of 13