Does one cluster mean one database? Do I need separate phyiscal clusters for different databases?

Hello,

I’m trying to understand the following:

  • Does one CrateDB cluster correspond to one database? For example if I need to have two separate databases, e.g. one production and one for development, does that mean I should have two separate CrateDB clusters?

  • Let’s assume I have 3-node CrateDB cluster: if I want to have another cluster, should I have another set of servers?

Coming from PostgreSQL background, I’m used to creating separate databases on the same PostgreSQL installation and those databases can be operated independently of each other, while sharing the same physical server and the same PostgreSQL installation. I’m trying to understand how these concepts apply to CrateDB.

1 Like

Hi @Emre_Sevinc,

yes, CrateDB does not support the concept of multiple databases.

If you want to run different databases on the same CrateDB cluster a potential solution/workaround can be achieved by using different schemas for production and development.

You can use different users with privileges on a specific schemas to prevent access between your environments.

GRANT AL ON SCHEMA staging TO <username>;

Separate clusters can still be useful in specific scenarios as for example…

  • while performance testing on development to prevent noisy neighbour problems
  • when testing your code against a new version of CrateDB in development first

But I assume you are aware of this as with PostgreSQL you would also need a separate PostgreSQL installation for these scenarios.

Let’s assume I have 3-node CrateDB cluster: if I want to have another cluster, should I have another set of servers?

I personally wouldn’t recommend this setup for running different environments on the same servers. But if you want you would be able to start multiple instances of CrateDB on the same machine given you use different config, ports, etc. In a k8s setup you potentially would also run multiple CrateDB pods on the same physical server.

Let me know if you have further questions,
Johannes

1 Like