75 points by sealedsecrets 6 months ago flag hide 14 comments
randomuser1 6 months ago next
This is such a cool project! I've been working on something similar recently. How are you handling data consistency?
projectauthor 6 months ago next
We're using the built-in PostgreSQL replication and synchronization features to ensure data consistency. We've also implemented some custom logic for conflict resolution.
computergeek22 6 months ago prev next
Is there any performance data available for your setup? Are you using a specific Kubernetes distribution/configuration?
projectauthor 6 months ago next
We've been using GKE with decent results. In terms of performance, we've seen an average latency of around 10ms and throughput of 10000 ops/sec. However, these numbers can vary depending on the number of nodes and workload.
distributeddatabase 6 months ago prev next
How are you dealing with partial failures? Do you have any failover strategies in place?
projectauthor 6 months ago next
Yes, we've implemented an automated failover system using Kubernetes readiness/liveness probes and PostgreSQL streaming replication. In the case of a partial failure, we redirect traffic to the standby node until the primary node is back online.
postgresfan01 6 months ago prev next
Do you plan to support other databases in the future? I'd love to see a similar setup with MySQL or Oracle.
projectauthor 6 months ago next
That's an interesting idea. While our current focus is on PostgreSQL, we have considered expanding to other platforms in the future. MySQL and Oracle support could be possible, but we would need to evaluate the trade-offs and feasibility for our use case.
cloudnativeguru 6 months ago prev next
Have you thought about using a CNCF project like Vitess or CockroachDB for your database infrastructure? This could help simplify the architecture and provide better scalability and fault-tolerance.
projectauthor 6 months ago next
We did consider Vitess and CockroachDB, but in the end, we found that PostgreSQL met our needs more closely. We also have a team with extensive PostgreSQL experience, which made using PostgreSQL a more natural choice for us. However, I do agree that Vitess and CockroachDB are worth considering for similar projects.
dataconsistency 6 months ago prev next
Are you using any specific techniques to optimize the read and write throughput of your database? How do you ensure a consistent read-your-write experience?
projectauthor 6 months ago next
To optimize write throughput, we're using Kubernetes' built-in auto-scaling feature to quickly spin up new nodes when necessary. For read throughput, we're using PostgreSQL's default read-only replicas, with connection pooling to improve performance. Regarding read-your-write consistency, we've implemented a custom serializable transaction algorithm to ensure consistency.
k8sexpert101 6 months ago prev next
Do you experience any issues with evictions or memory pressure on the Kubernetes nodes? Have you considered using any Kubernetes-native optimization strategies?
projectauthor 6 months ago next
We have encountered some memory pressure on the Kubernetes nodes, especially during periods of high load. To optimize the Kubernetes nodes, we're using the Pod Priority and Preemption feature in Kubernetes to ensure that the most critical workloads are allocated the necessary resources. Additionally, we've implemented a custom Kubernetes controller to dynamically adjust the number of nodes based on workload.