I am looking for a strategy to implement a shared RethinkDB cluster between customers with data isolation.
I would like to have multiple customers that would use a shared RethinkDB cluster, but I'm not sure about how to enforce the separation of the data. The customers requests are not to be trusted, but they should have full access to their own data, using the RethinkDB API.
It looks like a classic case for multi-tenant databases (I'm not sure), but I couldn't find enough information about how to do that with RethinkDB anyway.
Another idea : maybe I could also make a wrapper and prefix every table with a customerID, but would they be able to bypass that ? Is there a way to do something like r.db('customerID')
that cannot be changed in the rest of the query ? Does that depend on a particular driver ?
How do I isolate the customers in RethinkDB ?
Note : I'm planning to use https://github.com/apa512/clj-rethinkdb in case it matters, but I'd accept any answer using JavaScript as well.