duncsoz
duncsoz

Reputation: 153

Multi-Tenancy with Clojure & Datomic

What (if any) are the current options for Clojure, Datomic and multi-tenancy? Is this the sort of thing that leveraging existing Java libraries would be useful for? Or would there be a more straight forward way of applying a roll-you-own solution in Clojure?

I'm completely new to Datomic and Clojure and would be open to any new paradigms of how they might solve this problem efficiently. I'm interested in all tenanting options, but if more information is really needed, then at this early juncture I'm leaning towards:

Upvotes: 6

Views: 747

Answers (1)

ZAThomas
ZAThomas

Reputation: 31

The simplest thing you could do is to put a tenant key attribute on each of your entities. Then for any query you want to do, you can constrain it by tenant key:

[:find ?n
 :where
 [?c :account/name ?n]
 [?c :tenant/key :tenant.key/acme]]

Upvotes: 3

Related Questions