Postgres vs Cassandra for Kong

10/1/2018

I am trying to deploy Kong in GKE as per the documentation https://github.com/Kong/kong-dist-kubernetes

I noticed cassandra is available as StatefulSet but Postgres as ReplicationController. Can I understand the difference? Also can anyone suggest how to choose between these 2?

-- Rohit Goyal
google-kubernetes-engine
kong
kubernetes

2 Answers

10/1/2018

StatefulSet is better for managing stateful applications (which postgres and cassandra definitely are) as it provides possibility to create PersistentVolumeClaim to use GKE PD in your case so your state will be stored on separate partition on dedicated PD. In comparison Postgres deployment using ReplicationController which you provided use emptyDir so it means when you delete by accident/failure POD with Postgres all data will be lost so in that case you will need probably to re-initialize your Kong deployment (run Kong migrations, configure routers, etc.)

-- Jakub Bujny
Source: StackOverflow

10/2/2018

ReplicationControllers predates StatefulSets. It was a way to manage your pod replicas. The 'newer' approach to manage your replicas is ReplicaSets which is used by Deployments.

StatefulSets is meant for applications that require your pods to start in an ordered way together with some sort of data stored on disk. So it's very suitable for master/slave datastore or ring topology datastores like Cassandra. I would strongly recommend using StatefulSets for these types of workloads.

-- Rico
Source: StackOverflow