datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
tatut 2021-04-23T04:02:17.363700Z

not sure if I have enough cases for a general case. Looks to me that it’s just about how complex the query to get the “max of some attr” is and how then can you get the :db/id of the entity that had the max value

tatut 2021-04-23T04:10:28.363900Z

a max-with-id aggregate that returns the max value and the :db/id of the entity that had it, feels like would be useful

jaret 2021-04-23T12:16:22.367600Z

@stopachka all Datomic licenses are perpetual, meaning they will always work on versions of Datomic on-prem released prior to their expiration. Starter is intended for customers wanting to try out Datomic, after the 1 year the expected path is to move on to a PRO license to continue getting upgrades + support + HA etc. If you aren't ready after one year, you can continue using your Starter license, but you will not be able to "renew" and get new versions released after your starter licenses expiration. > can have multiple boxes of datomic running, etc I want to clarify that a Datomic license supports a single Datomic system which is the Transactor (pair for HA of active/standby), and all associated peers. Datomic is a distributed system so all of these processes can be (and should be) on different machines.

1❤️
Joe Lane 2021-04-23T13:47:47.371500Z

Is this all that you’re doing with the query? could you use index-pull or index-range and just grab the first element? Could you write a query function to do that for you from within the query ( if you need to pass that value to other where clauses, for example) Use Reverse flag for max (I think, on mobile).

2021-04-23T15:38:21.373400Z

Awesome, thank you @jaret !

2021-04-23T15:38:40.373900Z

Hey all, could anybody point me to a good repo on Github with an easily-grokked implementation of Datomic on-prem? I'm finding that getting over the hump of integrating the library and getting a hello-world thing going is pretty challenging.

ccortes 2021-04-24T11:42:24.379400Z

I had the same problem when I was trying to build a website with clojure and datomic. This https://github.com/milgra/tutorials/blob/master/full-stack-web-development-with-clojure-and-datomic.md helped me a lot.

2021-04-24T12:56:00.379700Z

Ah, this is great, thank you! This reminds me a little bit of the "Immutable Stack" series: https://youtu.be/QrSnTIHotZE

Joe Lane 2021-04-23T15:56:49.374400Z

Hi @andyfry01, have you looked at https://docs.datomic.com/on-prem/learning/day-of-datomic.html ?

Joe Lane 2021-04-23T15:57:19.374800Z

And the accompanying github repo https://github.com/Datomic/day-of-datomic

2021-04-23T16:51:06.375600Z

I'll take another look at it, thanks @lanejo01! I did enjoy the lecture series, maybe I just have to be patient and pick the repo apart a bit.

Joe Lane 2021-04-23T16:52:39.376900Z

If you have specific questions / problems you're hitting I'm happy to help answer those too 🙂

2021-04-23T17:14:56.377Z

In that case, maybe you could explain this to me: what's the difference between datomic.api and datomic.client.api? In hello_world.clj in the Day of Datomic repo for example, they DON'T use datomic.client.api: https://github.com/Datomic/day-of-datomic/blob/master/tutorial/hello_world.clj#L10 But in the official on-prem docs, they do: https://docs.datomic.com/on-prem/getting-started/connect-to-a-database.html#repl I was wondering if this might be a cloud vs. on-prem thing.

Joe Lane 2021-04-23T17:18:10.377400Z

Sure thing! So in datomic cloud and dev-local, the only way to interact with datomic is via some form of the "Client API". On-prem is unique because it supports a version of the "Client API" and, additionally, has what's known as the "Peer Api", a separate way to interact with datomic.

Joe Lane 2021-04-23T17:18:48.377600Z

• datomic.api -> Peer API • datomic.client.api -> Client API

2021-04-23T17:23:23.378Z

Gotcha, that's helpful! > If you are trying Datomic for the first time, we recommend that you begin with a client library. Sounds like I should focus my efforts on getting up and running with the client library :thumbsup:

Joe Lane 2021-04-23T17:26:04.378200Z

Are you only looking at on-prem? We have a cloud offering that is simpler operationally that may fit your needs better (depending on your needs, of course 🙂 )

2021-04-23T17:35:20.378400Z

I think I'd like to stick with on-prem for now to cut down on the complication (and expense) of using a cloud DB, but if and when I scale up to that level I'll come knocking 😛

Joe Lane 2021-04-23T17:37:39.378600Z

Fair enough, but just so you're aware, on-prem licenses are paid upfront (once you're out of starter) while cloud is pay-as-you-go and can be cheaper in some circumstances. I'd hate for you to build out a bunch of stuff and then realize you wanted cloud instead.

Joe Lane 2021-04-23T17:38:18.378800Z

Have fun! I'm around if you have anymore questions!

2021-04-23T17:41:11.379Z

Indeed! I appreciate the help. I'm still in early days with it all, but Datalog is blowing my mind. I feel like for the first time in my life I can actually write a database query. My MO since I first started doing software has been more or less SELECT * FROM SOME_TABLE and proceed to aggregate/filter/whatever with backend JS or Clojure. This was a huge help for me: http://www.learndatalogtoday.org/ . It's a fantastic introduction to Datalog, and also a really good example of a real-world, relatable, and small-scale Datomic DB + schema.

jarrodctaylor 2021-04-23T19:53:11.379200Z

Possibly worth considering as another option is https://docs.datomic.com/cloud/dev-local.html no expense and same client api.