litefs
litefs copied to clipboard
Working multiple clusters/hiding databases
I'm prototyping using LiteFS Cloud to distribute data retailers. Say we have Target and Sprouts. I only want the replica at Target to ever see target.db
, and Sprouts should only see sprouts.db
. If these databases are in the same cluster, they are replicated everywhere.
A logical solution is to use separate clusters. However, that means my central server that writes data to the primary needs to run multiple instances of LiteFS—one for each cluster.
- Is there built-in support for connecting to multiple clusters? I'd imagine something where each cluster might be it's own directory (e.g.,
litefs-target
,litefs-sprouts
). - If not, any suggestions on making multiple cluster connections?
- It's not ideal, but I could get away with simply configuring LiteFS to only download a specific database. Any support for this?
@clintonb That's not a feature we currently support but it's one that I would like to support. Do you need the ability to do auth for each database? For example, the consumer of target.db
can only see that database because they pass some kind of auth token in?
Right now you'd need to set up a separate LiteFS cluster for each database if you want to isolate them. It's not ideal for sure.
@benbjohnson ideally, yes the Target clients only see their own databases in a multi-tenant scenario.
I agree that separate clusters is the best path forward for now.