I'm seeing some behavior in datomic cloud (both remote connection, and when deployed in ions), that is contrary to what I've been led to believe as "the database as a value". When I acquire a "current" DB value from a connection, their hash is new every time I ask for it, even though the DB values have the same t basis. When I run the same test with dev-local, I do see the desired behavior, that in fact, 2 DBs of the same basis are equal. Does anybody know why the client API behaves this way, and why it's different from dev-local?
;; dev-local connection, using dl/divert-system
(let [c (conn)
db1 (d/db c)
db2 (d/db c)]
{:db1 db1
:db2 db2
:db1-hash (hash db1)
:db2-hash (hash db2)
:eq? (= db1 db2)
:type (type db1)})
;; => {:db1
;; #datomic.core.db.Db{:id "import-202123-1720", :basisT 3151, :indexBasisT -1, :index-root-id nil, :asOfT nil, :sinceT nil, :raw nil},
;; :db2
;; #datomic.core.db.Db{:id "import-202123-1720", :basisT 3151, :indexBasisT -1, :index-root-id nil, :asOfT nil, :sinceT nil, :raw nil},
;; :db1-hash -1795899545, ;; These stay the same as long as nothing more is transacted
;; :db2-hash -1795899545, ;; These stay the same as long as nothing more is transacted
;; :eq? true, ;; This was intended
;; :type datomic.core.db.Db}
;; Remote connection, using :server-type :ion
(let [c (conn "core-prod" "XXXX.core.prod")
db1 (d/db c)
db2 (d/db c)]
{:db1 db1
:db2 db2
:db1-hash (hash db1)
:db2-hash (hash db2)
:eq? (= db1 db2)
:type (type db1)})
;; => {:db1
;; {:t 3150, :next-t 3151, :db-name "XXXX.core.prod", :database-id "de0a365c-eb28-4cf4-a490-bd0bcfff8104", :type :datomic.client/db},
;; :db2
;; {:t 3150, :next-t 3151, :db-name "XXXX.core.prod", :database-id "de0a365c-eb28-4cf4-a490-bd0bcfff8104", :type :datomic.client/db},
;; :db1-hash 256930107, ** New hash values everytime I acquire **
;; :db2-hash 8175244, ** New hash values everytime I acquire **
;; :eq? false, ;; ** This is not intended **
;; :type datomic.client.impl.shared.Db}
This was one of the biggest benefits that I saw early on: https://youtu.be/4iaIwiemqfo?t=3755
okay thank you Joe!
What is a Query group? If I'm in production, do I also need to launch a Query group server as well? For development, is the Solo instance missing any features from the production Datomic?
The solo instance misses https://docs.datomic.com/cloud/ions/ions-tutorial.html#http-direct and for development, I would start with https://docs.datomic.com/cloud/dev-local.html
A query group is a separate cluster that reads and caches the data, so it doesn’t affect your other clusters. It becomes useful when you have different workloads on the system
It is a value in the sense that passing the same db to a query will give the same results… but not in more strict senses
I wouldn’t rely on the identity or hash of the db handle
is it possible to build a REST api around Datomic so that it can be called by other API end points sort of like microservice architectures? I want to have a serverless (AWS Lambda) web facing API for handling application logic and then use datomic to keep track of financial transactions (in particular double entry ledger). I want to be able to do /datomic/ledger/user234/credit/1000
and it should make that changes on the datomic. I guess this is where the lambda proxies come in that can expose datomic functions on AWS API Gateway/Lambda ?
With the above scenario, do I lose any performance benefits for reading, (I have a vague understanding of Peer and caching) by calling everything over the wire (rest api)? If so, how should I be architecting here?
Lastly, what AWS Database do you recommend for storage? If I use RDS MySQL instance, will I be able to do SQL queries as well? Or is it completely opaque regardless of what underlying DB you use?
Thanks again!
It is completely opaque, you cannot specify storage but: https://docs.datomic.com/cloud/analytics/analytics-concepts.html will give you SQL view into the database https://www.youtube.com/watch?v=thpzXjmYyGk is a deep dive on Datomic Ions, worth watching
thanks guys!
You certainly can make a REST API around your Datomic stuff
Datomic cloud doesn’t allow you to specify what storage to use afaict
It is completely opaque, you cannot specify storage but: https://docs.datomic.com/cloud/analytics/analytics-concepts.html will give you SQL view into the database https://www.youtube.com/watch?v=thpzXjmYyGk is a deep dive on Datomic Ions, worth watching
The solo instance misses https://docs.datomic.com/cloud/ions/ions-tutorial.html#http-direct and for development, I would start with https://docs.datomic.com/cloud/dev-local.html
A query group is a separate cluster that reads and caches the data, so it doesn’t affect your other clusters. It becomes useful when you have different workloads on the system
This was one of the biggest benefits that I saw early on: https://youtu.be/4iaIwiemqfo?t=3755
Hi! I would appreciate pointers on how to avoid an IAM user from deleting a database
I am super confused by the Datomic product range ... I just want to develop a personal project that needs to run only locally on my machine using Datomic. Now I understand I should either use Datomic Free or Datomic Starter, but now I've also come across dev-local which apparently provides the Client API - does that then not entail any storage? What exactly is dev-local?
dev-local has storage and is probably a great match for this if it's a personal project
3✔️Have you seen https://docs.datomic.com/cloud/dev-local.html?
Ok thanks ... why are there three "free to use" versions of Datomic? Is it all about licensing?
Ah yeah reading this a little more thoroughly would have answered the storage question ... the "why the diversity" question not really though. 😉 thanks
I would defer to someone on the Datomic team to answer that more fully so that I don't say something dumb :)
There's two different products -- Cloud and On-Prem. Datomic free is mostly deprecated, I think.