Is Kubernetes right for us?

Hi guys, I am new to Kubernetes and I just thought I might register here and ask for help.

Overall I understand (and really like) the idea of container orchestration using Kubernetes. But for some reason I find it very difficult to search for best-practices on how to use Kubernetes for our use case:

Diagram 2020-12-24 12-14-31

We have a REST service, that highly depends on the two database systems Redis and PostgreSQL. However, one thing is very special. The REST Service is using client-side sharding. That is, it knows which node to contact by providing a configuration as follows:

SHARD_ID1 -> pg01:5432
SHARD_ID2 -> pg02:5432
SHARD_ID3 -> pg01:5432
# ...
SHARD_ID256 -> pg02:5432

In the above example we have only two nodes pg01 and pg02.
For performance reasons, we might add more postgreSQL nodes.

What would be the best approach:

  1. Only use Kubernetes to autoscale the REST-Cluster and manually deal with the Redis Cluster and PostgreSQL Cluster, providing the sharding configuration manually?
  2. Have all three clusters running in Kubernetes and have an extra service that automatically manages the sharding configuration? If so, would we have to use one big cluster or three single clusters communicating with each other? Is there some event bridge that we can use to know which services are running?

The benefits in the latter approach would be fully automatic scaling, which would be awesome.

Or do I have a wrong view on Kubernetes in this case? I appreciate your opinion.

1 Like