Fork me on GitHub
#luminus
<
2023-08-16
Black09:08:47

Can someone point me at right direction? I am trying to write an app using datomic in luminus. I would like to separate datomic part into some abstraction so if in future I will need to use another database, I would just change that layer. Yet I am unable to find some resources showing that. Is it good idea to map datomic entity into clojure record and back?

Marius14:10:10

Why not just using maps? Whenever you store an entity, you pass a map to some kind of service layer (for storage and retrieval). If you want to switch the DB layer, you’d “only” have to update your services.

👍 1
Marius14:10:57

There might not be many resources on how to abstract the DB layer because it is uncommon (and not easy) to prepare for that, therefore YAGNI (you ain’t gonna need it).

👍 4