El Carro: Run Oracle Databases on Kubernetes
github.comNote: i never really considered putting oracle in kubernetes to be a technical problem; since you can pass a “raw” block device from a distributed block storage.
I consider it to be a licensing nightmare as the normal oracle license means you’ll need to license every single vCPU on the cluster.
The express edition used here has some relatively anaemic usage limits which you could brush up against very quickly:
“Oracle Database 18c Express Edition automatically constrains itself to the following resource restrictions;
2 CPU threads; 2 GB of RAM;and 12 GB of user data.”
Still, it’s cool, but I would caution anyone against introducing an oracle dependency.
I've never used Oracle and, given it's reputation, never will. Is there anything that it does better than other databases?
Quite a number of things but I’m scared to list them for fear of someone here thinking it might be a good idea to play with it.
Things that oracle does right: high availability, consistency of data (which is harder than you think, and the tools we use tend to use are genuinely crap at this especially things like MySQL and MongoDB which are insanely popular), performance of OTLP workloads, and support*
Your mileage may vary on that last point.
A more appropriate comparison against Oracle database would be MS SQL Server, or even Postgres, no?
MySQL/MariaDB is a different product class with different priorities, and MongoDB is a "NoSQL" product.
MySQL directly competes.
But Postgres and MSSQL are the true equivalents, you’re right.
Correctness is hard was my main comment. There’s a whole class of other database types, but oracle can do NOSQL document storage just fine.
Postgres and MSSQL can too, especially the former, but there are some weird quirks, like having documents larger than 16KiB means they’re stored off-row in a compressed TOAST table. Which hurts performance a lot.
Mysql, Postgres and Oracle are closer than ever in functionality, but I don’t think postgres/mysql alone can compare to “Oracle”, but if you compare postgres+greenplum/citus/XL or mysql+Vittess to Oracle+RAC that’s pretty close, but you’ll probably need to choose from a few extras to get all the way there. The key difference is Oracle is doing it all in one monolithic stack.
Oracle isn't really monolithic though. If you dig into it, it is all a really ancient aggregation of various tools and components from different eras. All of it has some Oracle branding on it, but usage-wise and functionality-wise it is inconsistent as hell, overlapping, downright weird and sometimes even dangerous to the non-wizard. Imagine the ancient font-installation dialogue in windows, times a thousand.
For most (but not all) purposes, PostgreSQL is approximately as good, the devil is in the details of your specific application. Oracle is a competent OLTP system but it makes a different set of tradeoffs than PostgreSQL. For geospatial performance, as an example, neither platform clearly wins -- it goes back and forth depending on the details of what you are doing.
The tl;dr: start with PostgreSQL and evaluate from there.
Suing it's users
If, like me, you at some point need to support Oracle coming from Postgres there are a few annoyances you should be aware of:
- No boolean type. Different folks will choose T/F chars, Y/N chars or 0/1 integers. - Strings are not nullable. An empty string and a null string are the same thing. - Date also has time.
By default, you end up with some very annoying bugs. Expect to actually change the way some of your columns work.
That is quite weird.. but I don't really understand it actually. Isn't the best way to store a boolean to literally store 1(bit)? More than 0 and 1 isn't needed right?
I'm just guessing but a CHAR would be 4 byte if it's Unicode and an INTEGER also right?
So you're telling me there's really no way to store just one or a few bits?
This is legit the biggest wtf I've read today, this is an over 20 year old enterprise db...
What's really weird is the Stockholm syndrome of the Oracle users: They are proud of these limitations. I've heard all of these:
* Boolean: You don't really need it, just use 0/1 or Y/N (or J/N or O/N or whatever NLS equivalent of Y/N you want). You might have to implement a few different mappers for the same data type, so what?
* Strings: Semantically, a null string and an empty string are the same. You should be grateful the database works this way. All other DBs are wrong (you hear this a lot in Oracle land).
* Dates: Oh, just ignore the time if you don't want it. What do you mean, time zones? Add the correct offset in your software, you lazy XXX. BTW, we migrated to a server with another time zone, hope this doesn't impact you?
Now there are things that oracle is good at, mainly being trustworthy and scalable with your data, especially in clustered environments. But postgress is slowly but surely eating Oracle's niche here, and mysql has demonstrated customers will tolerate anything for lower costs. So their main value proposition today is that they are Enterprise Class, and all the big boys run Oracle so either join the club or get laughed at by the big boys.
Clarification for the Dates thing: You implement a date as a datetime where time=00:00:00. BUT a timezone mismatch between application and DB means today 00:00:00 might change into yesterday 23:00:00 so everybody who claims you can 'just' ignore the time is subtly wrong.
I had a lot of fun troubleshooting an issue where a country was invaded in WW2 so it joined the German time, but its neighboring country was not. Hence, only in part of WW2 and only in summertime the time zones between these countries differ. Server was of course installed in the neighboring country and then delivered without altering the time zone because who cares about something that subtle. Turns out everybody born in these specific half years had their birthday shifted by one day.
Had a CTO before insisting on tinyints instead of bools because you can have "third behaviour modes".
I wish I remembered the logic behind that, but it was essentially akin to extending feature flags.
There are better date/time data types in Oracle, and the implicit nullability of empty strings is great in practice, but these goddamn booleans annoy me to no end. You can use them in sprocs just fine, but a boolean column? No, that's too hard for Oracle to implement.
From personal memory at least 33 years old.
I was horrified how bad it was compared to Sybase back then.
Oh my goodness, this is an awful idea. Oracle just runs hosted Exadata for OCI last I checked.
RAC requires shared block storage and L2 private network. Cloud SDNs and storage require gross hacks with horrible performance consequences. Even “modern” virtualization is painful, but can work.
Oracle isn’t going to fix all the bare-metal spaghetti assumptions in their clustered DB stack, and has been pretty clear about that.
This could be useful for throwaway dev/test environments. Or maybe for apps that aren’t performance intensive or critical that are in “maintenance mode” and folks want to lift-and-shift. But they’ll probably spend more time on that than fixing/replacing/retiring the app. And all will require smaller data sets than what I see with big company legacy systems.
And typically those systems are using Oracle to access data populated by another system, which makes me die a little inside.
Pretty clearly a play to get big companies into GCP contracts, more than anything real.
It’s to sell to execs who want to do the cool thing without paying to fix the old thing. ahem Thomas Kurian cough.
I'm curious about this for tangential reasons. Does it allow you to pass through actual raw storage and network devices to the container?
Kubernetes has a large ecosystem of network storage drivers which provide replication for non-HA applications.
That said - it is entirely possible to run local storage for applications that provide their own replication. We run an LVM local storage provisioner for our in-cluster Postgres (orchestrated by Patroni). This gives us all sorts of snapshotting and resizing that you would find in network storage while having the performance of locally attached NVMEs
Would love to see Google throw this sort of effort at something other than Oracle. The Zalando crew have done an amazing job with Patroni and their Postgres operator. But having Google’s resources could really elevate in-cluster databases to the mainstream.
This, but for Postgres…
Stay tuned. A lot of the tech behind El Carro can be extracted into a generic controller and serve as the foundation for other databases including Postgres.