Fork me on GitHub

Is there a good tutorial or guide I can read for advice on which libraries to choose to make a datomic backed web api?


After ionizing your request-handler, it’s not really different from building a web api with ring/pedestal.


This was assuming datomic-cloud…

🙏 4

I recently came across and found it quite interesting. The central idea behind multiverse databases is to push the data access and privacy rules into the database itself. The database takes on responsibility for authorization and transformation, and the application retains responsibility only for authentication and correct delegation of the authenticated principal on a database call. Such a design rules out an entire class of application errors, protecting private data from accidentally leaking. Is anybody aware of a similar thing being tried for datomic?


@U4YGF4NGM and @U09R86PA4: I think it should also solve the security issues when trying to cache parts of datomic locally?


Wow, fascinating! I'd guess that probably no one's working on this (would love to be wrong!), but I imagine given the degree of immutability and lazy eval built into Datomic already, it'd have a leg up on any other database software trying to add this in. I could imagine the API being as simple as:

(def db (d/with-context {:user-id uid}))

Arek Flinik13:02:36

Has anybody tried running Datomic on top of MSSQL? (please don’t blame me, talking with a potential enterprise customer that insists on doing that because “based on their experiences PostgreSQL is a terrible choice” :face_with_rolling_eyes:)


I’ve run it on top of mysql. You’ll be fine


datomic uses sql as a key-value store for binary blobs


optimize your tables and schema for that workload


@aflinik Many of our customers run on SQL Server

Arek Flinik20:02:23

Thanks! Would be able to share some insights about potential pitfalls, differences in performance characteristics, or any other learnings?


Generally speaking most SQL stores are fairly reliable We have many customers using postgres, SQL Server, and Oracle Like most Datomic storage options, the most common issues are usually general misconfiguration of storage itself. If you’re comfortable running the storage and/or have a good DBA who knows it well, they all perform fairly similarly


Are in-memory databases still supported for testing purposes? I’m having trouble finding docs on how to set that up


If you’re talking about on-prem, yes definitely. If you’re talking about cloud AFAIK it has never supported in-memory? (why say “still supported”?)


In production I plan to use datomic client against an on-prem transactor. What is the best way to write tests against that?


To get the in-memory database it looks like the app needs to include the full datomic-pro dependency


Cognitect’s official recommendation is “use random database names and an aws connection for testing”


This thing also exists, but requires datomic-pro as you noticed: