News for hackers. Stuff that matters.
Re:Ask HN: Who operates at scale without containers? by brimble on Tuesday March 22, 2022 @12:45PM (#30768382)
> That's the easy part! The hard part is managing databases.

Ding ding ding ding ding.

"But what about disk?" (so, relatedly, databases) is the hard part. Balancing performance (network disks suuuuuck) and flexibility ("just copy the disk image to another machine" is fine when it's a few GB—less useful when it's lots of GB and you might need to migrate it to another city and also you'd rather not have much downtime) is what's tricky. Spinning up new workers, reliable- and repeatable-enough deployment with rollbacks and such, that's easy, until it touches the disk (or the DB schema, that's its own whole messy dance to get right)

Re:Ask HN: Who operates at scale without containers? by zthrowaway on Tuesday March 22, 2022 @02:18PM (#30769524)
People still think stateful things are impossible on k8s but Stateful sets and persistent volumes solves a lot of this. You should be relying on out of the box DB replication to make sure data is available in multiple areas. This is no different on other platforms.
Re:Ask HN: Who operates at scale without containers? by nijave on Tuesday March 22, 2022 @10:02PM (#30774013)
Putting a 50TB+ database that enables eye watering revenue on k8s is a hard sell for a lot of businesses--especially when they have non-containerized solutions that work.

Simple topologies and NoSQL databases (or databases they can handle replication/partitioning/node failures automatically) are pretty easy to stick in StatefulSets.

There's crazy things like this https://blogs.oracle.com/mysql/post/circular-replication-in-... that would be fairly difficult to run in a StatefulSet.

In addition, the patch and lifecycle cadence of k8s is pretty quick so rebooting SQL databases with 100ks TPS more than 1-2 times a year tends to be problematic

Re:Ask HN: Who operates at scale without containers? by evanelias on Wednesday March 23, 2022 @02:05AM (#30775473)
> There's crazy things like this https://blogs.oracle.com/mysql/post/circular-replication-in-... that would be fairly difficult to run in a StatefulSet.

This isn't a great example to cite, since traditional circular replication in MySQL is a massive anti-pattern... it's incredibly fragile and pretty much has no valid use-case.

That's especially true today when other options like Galera or Group Replication are available. But even 10-15+ years ago, mentioning circular replication was a great way to give a DBA an aneurysm. (Well, I suppose that's arguably a use-case, if you profoundly dislike your company's DBAs...)

Re:Ask HN: Who operates at scale without containers? by nijave on Wednesday March 23, 2022 @08:29AM (#30777760)
Probably a bad example, but the sentiment was: encapsulating years of DBA knowledge and complex enterprise architectures in generic k8s abstractions can be incredibly difficult.

For instance, you put a RDBMS in a StatefulSet. You figure out how to replicate between pods. Now a piece of hardware fails and a replica needs rebuilt--what does that? So you add an operator into the mix. What happens if bin logs have been purged and a replica can't just "rejoin"? Now you have to figure out how to transfer data between pods (PVs) to bootstrap a new replica. Now you probably need some sort of init container solution to keep the pod running and volume mounted while you're copying in data. Now that you have all that, how do you handle master/primary failures and replica promotion? How do you handle backups? How do you handle restores?

Once you've solved all that, how do you performance tune your database? At some point, you're probably going to start looking at kernel tuning which you'll need some additional customizations to enable (probably dedicated node per database pod, then you can either skip k8s and configure the host directly or wire up allowed sysctls through k8s).

Or, you can skip all that and require human intervention for everything, but now humans need to wade through the k8s abstractions and fix things. With that route, you break basic k8s functionality like restarting pods since it can take down your database topology

Re:Ask HN: Who operates at scale without containers? by evanelias on Wednesday March 23, 2022 @11:39AM (#30779598)
Oh yes to be clear I definitely agree with the overall sentiment. I just wouldn't ever cite circular replication as an example. Basically saying "it's hard to do [inherently flawed terrible thing] on k8s!" just detracts from the argument :)

fwiw my team eventually automated pretty much "everything" for Facebook's database fleet, and it was hundreds of thousands of lines of custom automation code (non-k8s), many years of work for 10+ extremely experienced engineers. In a k8s environment I suspect it would have been even more work.

The open source mysql k8s operators are certainly getting better with time, but there's still a lot of stuff they don't handle.

Re:Ask HN: Who operates at scale without containers? by nijave on Saturday March 26, 2022 @09:14AM (#30811533)
MariaDB uses a closed source operator for their SkySQL product (it's all on Kubernetes). Here's the most recent info I could find http://www.odbms.org/2019/06/on-mariadb-kubernetes-operator-...

(I used to work there)

Re:Ask HN: Who operates at scale without containers? by koffiezet on Wednesday March 23, 2022 @01:51PM (#30781253)
I have a client who's pretty massive database is pretty damn critical, not only for revenue but also legal reasons. It is managed by a separate team. All applications however run on k8s (well, actually openshift), the main reason being organizational scaling of development teams. With the current setup in place, increasing the amount of dev teams we'd need to support would be pretty painless. We do however run certain smaller (<200gb) databases in-cluster where performance is less of a focus, which, because of the storage abstractions currently in place could otherwise become a potential bottleneck.
Re:Ask HN: Who operates at scale without containers? by DeathArrow on Wednesday March 23, 2022 @04:27AM (#30776266)
>Putting a 50TB+ database that enables eye watering revenue on k8s

But you can run the software in k8s while using an external data store for data. With microservices you can also use small databases for each and push the data you want to persist like finished transactions and invoices to external systems.

No reason to have only one giant database to do everything in. At my last place of work we moved from a monolithic software using a giant database to microservices and many small databases, some of them NoSQL.

Re:Ask HN: Who operates at scale without containers? by nijave on Wednesday March 23, 2022 @08:20AM (#30777678)
Parent comment was suggesting you can run databases in StatefulSets on k8s

>No reason to have only one giant database to do everything in

It's the reality for a lot of "legacy" services. Some of these things have 50-100+ apps all connecting to the same DB with incredibly complex schemas, functions, triggers, etc. It's potentially a multi-year project to undo that. When you do that, you're potentially introducing significantly more network hops. If a business transaction spanned multiple pieces of data in the same database before, you've potentially created a saga spanning multiple microservices now.

Even if you do adopt microservices, you'll probably end up consolidating all the data somewhere else for reporting, analytics, data warehousing, etc purposes anyway (so you end up with a giant OLAP DB instead of a giant OLTP one)

Re:Ask HN: Who operates at scale without containers? by mountainriver on Tuesday March 22, 2022 @05:23PM (#30771751)
Yes you can run DBs on kube now, much of people thinking this isn’t good comes from years back when it wasn’t
Re:Ask HN: Who operates at scale without containers? by JeremyNT on Wednesday March 23, 2022 @10:59AM (#30779141)
Does it buy you much though? The big issue with databases is storage, and you need local storage for optimal performance.

You can ask k8s for a persistent volume on local storage, but at this point you have to treat that pod exactly the same way you'd treat a snowflake database server, because the local storage is what ultimately matters.

You can replicate to other pods with their own persistent volumes, but the replication overhead adds up too both in terms of performance and complexity.

I know there's stuff like vitess and crunchy data, which try to abstract this away, but the amount of layers buried here is very high for benefits that seem kind of nebulous compared to "big ol server" mode.

Re:Ask HN: Who operates at scale without containers? by mountainriver on Tuesday March 29, 2022 @04:36PM (#30848034)
pods can share a persistent volume in ReadWriteMany mode
Re:Ask HN: Who operates at scale without containers? by senorsmile on Tuesday March 22, 2022 @07:56PM (#30773164)
Kelsey Hightower just had a good interview where he disagrees with you: https://changelog.com/shipit/44

Edit: somewhat* disagrees with you. It's a good listen.

Re:Ask HN: Who operates at scale without containers? by gabrielgrant on Tuesday March 22, 2022 @09:11PM (#30773700)
tl;dr?
Re:Ask HN: Who operates at scale without containers? by bruth on Tuesday March 22, 2022 @10:13PM (#30774077)
If you have a low-volume, non-performant, non-critical database, k8s is fine. If you need it to perform and/or need built-in ops (managed backups or replication), use a managed service.

k8s _can_ do stateful, but if a managed service exists for this workload, use it. It is not about _can_ I run it on k8s, it is a _should_ question. Is it worth the cumulative effort required to achieve the same degree of quality.

Re:Ask HN: Who operates at scale without containers? by hawk_ on Tuesday March 22, 2022 @05:46PM (#30771994)
Can you elaborate on "multiple areas"? Do you mean each node inside a db "cluster" should run in a different area? And how does one achieve that?
Re:Ask HN: Who operates at scale without containers? by fer on Tuesday March 22, 2022 @02:09PM (#30769408)
Sometimes I think K8s is largely pushed for Amazon/Google/Microsoft to sell the disk that goes along with it.
Re:Ask HN: Who operates at scale without containers? by zomglings on Tuesday March 22, 2022 @05:00PM (#30771483)
Don't forget network costs (especially for "high availability" clusters spanning multiple regions).
Re:Ask HN: Who operates at scale without containers? by swiftcoder on Wednesday March 23, 2022 @03:07AM (#30775810)
Admittedly it's 5 years since I worked at AWS, but at the time there was basically no internal usage of containers. ECS was pushing customers towards containers, but the the feeling towards containers at the time inside the company could be summed up as "we have a decade worth of operational tooling, why would we throw that all away?"