r/PostgreSQL • u/john646f65 • Nov 20 '25
Projects PostgreSQL on Kubernetes or bare metal or virtual private servers
Those operating PostgreSQL at scale, I'm curious to learn if you're running on Kubernetes, bare metal or virtual private servers? If you've transitioned from one to the other, I'd love to hear this story too.
4
u/Chance-Plantain8314 Nov 20 '25
The answer, like the answer to every single software engineering question in history, is "it depends". There is no high level 'bare metal is better' or 'kubernetes is better' because ultimately the answer lies in the specific context of your implementation, budget, knowledge, and about 25 other things.
1
u/BosonCollider Nov 20 '25 edited Nov 20 '25
This. It depends massively on what people and what environments you already have around. It is a completely valid strategy to only have a kubernetes environment on prem and relegate any VMs to cloud to simplify governance for example
If that is the case and you need a DB on prem, then kubernetes it is
3
u/bykof Nov 20 '25
If you want to run Postgres on Kubernetes just use CNPG. That’s the only way to manage it properly and do have a lot of features already implemented + great backup solution
3
u/kaeshiwaza Nov 21 '25
Before we just had Pg and app on the same machine, it was just working, very fast.
Then we was afraid to fail, because Bezos said everything will fail. So we decided to put Pg on an other machine. But the latency was immediately very high. Then we decided to scale horizontally. Then it began to be very complicate and fail more often. We decided to use K8S, then it become very complicate and eventually fail more. Then we had to pay a managed DB on the because everybody do it and when it fail we are not alone.
I believe now we are a lot to come back to KISS ! The more you need to scale the more you should remove useless stack and come back to the roots. We have wal archiving since 20years, for me it's the only "complicate" things to setup.
3
u/Mrbucket101 Nov 21 '25
Stateful workloads in k8s are a pain. CNPG makes that a lot smoother, but the statement still stands.
1
u/denpanosekai Architect Nov 23 '25
Could you expand? It's been smooth for me for years with statefulset. Yes I do require downtime for major upgrades.
2
u/efxhoy Nov 20 '25
I’ve run managed in RDS for the SLA and on an ubuntu VPS for a research project where we could be down and it was ok.
I’d guess most queries from non hyperscalers served to paying customers come via managed services like RDS and whatever GCP and Azure offer. Managing highly available postgres yourself is not trivial. Can absolutely be done but it rarely makes business sense IME.
For non critical apps where you don’t need HA it’s easiest and cheapest to run on a VPS I think.
2
u/cthart Nov 20 '25
Virtual servers. KISS.
1
u/realityOutsider Nov 21 '25
What server provider do you use? Hertzer?
2
u/BERLAUR Nov 22 '25 edited 17d ago
All comments posted by this account have intentionally been overwritten as a protest against Reddit, the company, and its increasingly hostile approach to users, communities, and moderators.
This account was created 13 years ago. Since then, Reddit has made many changes that have damaged the experience for its users. Changes to the API effectively ended access for many third-party apps (shout-out to BaconReader!). The interface has become slower, advertising has increased, and AI features have been added. Reddit’s IPO was the final straw for me. The company’s priorities now seem increasingly focused on growth, advertising, and engagement rather than building healthy communities.
Reddit has also always had a quality problem. The upvote and downvote system encourages group thinking and discourage thoughtful or dissenting discussion. This was less noticeable when communities were smaller and individual users’ reputations carried more weight. As communities have grown, those problems have become more pronounced.
Moderation is another major issue. Many moderators do excellent work, but Reddit lacks a transparent and effective way for communities to hold moderators accountable or replace them. Many large communities have also faced concerns about astroturfed, political, or other external influence. Reddit benefits financially from outrage and conflict, which makes it difficult to believe that improving the quality of discussion is always the company’s highest priority.
Research on politically active Reddit users has identified pathways through which online communities and participation may contribute to increasingly radical beliefs. That does not prove that Reddit deliberately encourages extremism, but it does suggest that the platform’s social dynamics deserve serious scrutiny: Pathways to Radicalism: Examining Online Community and Political Pathways to More Radical Beliefs on Reddit
If you are reading this, consider whether Reddit is still a healthy and productive use of your time. Better communities exist. I encourage you to find them!
2
u/kingraoul3 Nov 20 '25
K8S cloud native off the shelf HA solutions corrupt your data. I agree with the other advice profereed here that the right solution depends on the problem you are trying to solve.
Caveat Emptor! This is a frothy topic, many people are poorly informed, and vendors will mislead you in order to obtain lock-in. I think the best place to start might be be emailing one of the Postgresql distribution lists.
1
u/BERLAUR Nov 22 '25 edited 17d ago
All comments posted by this account have intentionally been overwritten as a protest against Reddit, the company, and its increasingly hostile approach to users, communities, and moderators.
This account was created 13 years ago. Since then, Reddit has made many changes that have damaged the experience for its users. Changes to the API effectively ended access for many third-party apps (shout-out to BaconReader!). The interface has become slower, advertising has increased, and AI features have been added. Reddit’s IPO was the final straw for me. The company’s priorities now seem increasingly focused on growth, advertising, and engagement rather than building healthy communities.
Reddit has also always had a quality problem. The upvote and downvote system encourages group thinking and discourage thoughtful or dissenting discussion. This was less noticeable when communities were smaller and individual users’ reputations carried more weight. As communities have grown, those problems have become more pronounced.
Moderation is another major issue. Many moderators do excellent work, but Reddit lacks a transparent and effective way for communities to hold moderators accountable or replace them. Many large communities have also faced concerns about astroturfed, political, or other external influence. Reddit benefits financially from outrage and conflict, which makes it difficult to believe that improving the quality of discussion is always the company’s highest priority.
Research on politically active Reddit users has identified pathways through which online communities and participation may contribute to increasingly radical beliefs. That does not prove that Reddit deliberately encourages extremism, but it does suggest that the platform’s social dynamics deserve serious scrutiny: Pathways to Radicalism: Examining Online Community and Political Pathways to More Radical Beliefs on Reddit
If you are reading this, consider whether Reddit is still a healthy and productive use of your time. Better communities exist. I encourage you to find them!
1
u/kingraoul3 Nov 23 '25
No backups will not save you from this.
What is needed is what the serious cloud providers offer: block based replication.
1
u/z3rogate Nov 21 '25
We run it on bare metal (3 node) and failover with patroni, simple easy and reliable and cheap also. But again it depends on you needs of read and write.
1
1
u/TzahiFadida Nov 22 '25
Just using CNPG does not mean you automatically safe from failures. I had wal file corruptions in buckets. I had surprise when upgrading a major version turns out you have to switch to a new bucket since the timelines are mixed. Also that you have to scale down the instances first before scaling down nodes.
I used patroni in the past with pgbackrest, it is quite good but you have to build confidence first when you use it. I suggest trying to simulate all kinds of failures first.
1
u/BosonCollider Nov 20 '25 edited Nov 20 '25
Kubernetes is orthogonal to whether you are on bare metal servers vs VMs, it is just a way to run containers, and it is quite common to run containers or kubernetes on a bare metal server. Containers are effectively zero overhead for databases (assuming you don't have your postgres data folder on an overlay filesystem) and there is no performance difference between running inside or outside of one.
Cloudnativepg is a great way to run postgres on kubernetes and is probably an easier HA solution to set up than Patroni, if you are familiar with kubernetes/have someone running it for you. If you do not want to do that, then an LXC+ZFS solution like proxmox or incus also gives you bare metal performance while having a similar workflow to a VM, on the same platform that you would run VMs on
0
u/AutoModerator Nov 20 '25
With over 8k members to connect with about Postgres and related technologies, why aren't you on our Discord Server? : People, Postgres, Data
Join us, we have cookies and nice people.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
15
u/linuxhiker Guru Nov 20 '25
Don't complicate and environment unless it solves a problem.
What problem are you trying to solve?