470 comments

[ 3.2 ms ] story [ 300 ms ] thread
Is this not a case study that anyone can leave Oracle now, if an Amazon scale install can?
It shows that a big company like Amazon, hiring thousands of SDEs still needed other vendors software than their own, because of all that time they spent in hiring and firing people and obsessing over their customers needs.

sarcasm

Also, MySQL is technically, an Oracle database (after Sun got bought out). Now they should write some migrations to turn all of that off.

sarcasm intensifies

I expect the internal teams use Amazon Aurora instead of MySQL. Aurora is compatible with MySQL but is not owned by Oracle.
Yeah but the client interfaces are all MySQL. Oracle should buy off PostgreSQL too. And then it should start charging only Amazon for using these interfaces.

moar sarcasm.

There was also MaxDB, and a few other that Monty built. There's also Percona, WebscaleSQL and a few other forks.

Amazon have been using MySQL even before all these forks happened. And not only that, if Oracle decided to pursue a lawsuit, or if MariaDB, Percona, Elasticsearch or EnterpriseDB did, Amazon will have to cough up.

This is not really a thing that Amazon should be bragging about, because it makes no real sense! They still run a lot of software they did not write.

Note: Amazon employee, but opinions are mine.

Amazon did not replace Oracle with MySQL. You seems to talk a lot given your knowledge of how Amazon operates internally and how licensing works is... blatantly false.

All of those DB's that could "pursue" a lawsuit are built on open source licenses which Amazon is not violating.

But the most important point here: The idea that you have to write a database to be happy to be off Oracle is insane. Amazon moved to an alternative that doesn't have a deep license designed to financially screw their clients as much as possible. That's a win.

1. When did I say that Amazon replaced Oracle with MySQL? I just said that MySQL is an Oracle database.

2. Open Source licenses that Amazon is not violating - a 3rdparty lawyer would be able to ascertain better about the extent of legality on Amazon's changes and its contribution back to open source software than you and I do.

3. Ex-Amazon employee here. My comments are purely based on my observation - and purely my opinions. Why can't I talk a lot?

1. I assumed it was implied. Why else bring it up?

2. If there was a means to sue Amazon for hosting databases, Oracle would have already done it a LONG time ago with MySQL. The burden is on you to prove your claim.

3. You are free to talk as much as you want, just expect push back when you aren't right, a lot. ;)

1. and 2. Amazon does use a lot of MySQL, and the fact that they still do. Oracle can determine when and how it wants to bill Amazon. You and I can't change any of that.

3. Except when the other person isn't. You just lost me on the last comment.

>Amazon have been using MySQL even before all these forks happened. And not only that, if Oracle decided to pursue a lawsuit, or if MariaDB, Percona, Elasticsearch or EnterpriseDB did, Amazon will have to cough up.

Pursue a lawsuit over... what, exactly?

(comment deleted)
No, it means that Amazon reached the point of considering other solutions than Oracle (I bet partially because of cost) at the time when this project started to move their database workloads that at the time were residing on Oracle to something else. Amazon uses many software vendors, they by no mean suffer from the NIH (not invented here) plague.
Or is it a case study that you need the resources of Amazon to pull off migrating from Oracle?
> some third-party applications are tightly bound to Oracle and were not migrated

Oracle's strategy of buying companies like PeopleSoft is paying off.

SAP and Salesforce would love to, but haven't achieved Oracle-free status to the joy of Larry.
S4 doesn't use Oracle, Commerce doesn't use Oracle. Some of the acquisitions still do because nobody wanted to free up cash.
It is not.

Amazon accomplished the task by building their own Oracle replacement. You have to be approximately as large as Amazon for that to be a realistic option.

If you'd like to use the alternatives that Amazon built, you can, of course, migrate to Amazon Web Services. Though, if you dislike the vendor lock-in you're experiencing with Oracle, and are considering Amazon as a good place to flee to, you possibly haven't been paying attention. With Oracle, you're just renting the software. With Amazon, you're renting both the software and the hardware, and renting the hardware is a precondition of being able to continue using the software, AND they charge you a fee to move your data off of their hardware. It's one of the most well-engineered enterprise vendor lock-in traps the industry has ever seen.

Most places likely aren't using Oracle at Amazon's scale, either.

I suspect that one of MySQL, Postgres or Microsoft SQL Server can fill in for Oracle if you have access to the source code and can make changes yourself. (If you've bought software that is Oracle-only, then it's not an option -- but it wasn't an option for Amazon, either). I suspect that in a lot of cases, this will pay for itself, but it might take 10 years to do so.

Depending on the size of your install, there are companies that are very good at converting over something like Oracle to Postgres for probably much less than you'd expect. With the price of oracle licensing, your break-even could be in a year or two.
>Microsoft SQL Server

Out of the frying pan, into the fire.

MSSQL's really not too bad. Yes, it's a commercial offering, but there's nothing inherently evil about charging money for software, and you do get what you pay for.

I've worked in both MSSQL shops and PostgreSQL shops, and, while I wasn't in charge of the budget, I wouldn't be at all surprised to find out that, once you factor paying your programmers and DBAs for their time into the equation, the MSSQL shop ended up having lower overall costs associated with its choice of DBMS.

MS licensing is somewhat expensive, but easy to understand and relatively benign. Oracle licensing chokes you like the Drakh keepers from Babylon 5.
Have you worked on MSSQL licensing in the age of Virtualization and per-core licensing? It's gotten VERY complex according to some of my friends that still run it.

It seems they have changed their pricing strategy:

    Oracle: What is your IT budget? We'll take it. (all of it)

    Microsoft: Hey, at least we're not as bad as Oracle.
I'm not sure I follow this logic. Wouldn't both databases require the same amount of care and feeding? Are you suggesting that you need less DBA's per MSSQL database than for a PostgreSQL or Maria database?
Yep. Because the tooling is stronger. The developer ergonomics are better. The performance is better, meaning you'll be able to do more with fewer servers. MSSQL has a boatload of useful features that PostgreSQL lacks. (Clustered indexes and table-valued parameters are the ones I like to fixate on.) And so on. I can only personally speak to the developer story, but my experience has been that the productivity difference is huge. There's a night and day difference in the information you can get out of an EXPLAIN on each of them, for example, and I would get detailed emails warning me if a MSSQL query plan unexpectedly changed in production. With PostgreSQL you're more likely to need to build your own tooling for that sort of stuff, or just wait for a user to complain. On the DBA side, I'm hazier on the details, but I've seen PostgreSQL DBA's sinking hours' or sometimes even days' worth of effort into grinding through tasks tasks that an MSSQL DBA can bang out by spending a couple minutes clicking through a wizard dialog.

If you're a tiny startup, the differences won't amount to all that much, and it will be hard to justify MSSQL's price tag, which is fine, because, yeah, you can't afford it, anyway. If you're an enterprise or otherwise have large database needs, the differences can very quickly become apparent, and easily worth the money.

I have worked with both databases over a decade. The biggest difference between SQL Server and Postgresql is neither tooling or performance(both are excellent), but the community and culture.

By far, PostgreSQL has more knowledge sharing and documented edge cases. Not to mention that the official PostgreSQL documentation is probably one of the best documented software systems ever. This makes PostgreSQL a lot easier to learn and use and that also affects the amount of money you need to spend.

SQL Server has some annoying edge cases, licensing is a real pain point these days, but so are the technical issues like lack of schema support in the JDBC driver. Other things are that you cannot pipe the backup. I would love to take backup of an Azure SQL service to my local machine with SSH.

Instead of a table-valued parameter, wouldn’t you use an array of a composite type in PostgreSQL? What are the relative good and bad points?
Yeah. And you don’t need to create a custom type to handle it as a parameter. So it’s easier.

The only thing SQLServer has over PostgreSQL is multiply resultsets. That’s it. I really wish that existed in PostgreSQL to prevent round trips.

I'm currently working on a mssql shop, and on aws it's more than twice the price vs postgres or aurora. I don't see how you can justify the price difference
Wouldn't surprise me if a large fraction of those installs could be replaced with sqlite..
That said, if you restrict yourself to the PostgreSQL subset of Aurora, you will be able to move to any Postgres implementation down the line.

Yes, they charge you a fee to move your data off. However, that is not the limiting factor for people moving off of Oracle. (And if it is, they're probably not looking at AWS in the first place.)

can you give an eli5 of postgresql's offering vs oracle db? Why isn't there an open source equivalent right now? What 'extra stuff' did Amazon have to build to make it 'more' than the open source stuff available right now.
Thank you for mentioning the departure fee... That just took AWS off the table for me unless I'm pushed into it by other (paying) parties.
I believe the parent is referring to the price of the bandwidth that would be required for transferring data from AWS to somewhere else.
It's not really a fee. It's just the price they charge you for data transfer to external systems. This is known as Data Egress charges and all cloud providers I know off has it. The cost of egress will depend on which service you are using. Some services have lower data transfer out costs, some have higher, etc..
There is no departure fee. As others have pointed out, this is simply data transfer.
There are plenty of alternatives that don't lock you to Amazon. One of my teams just migrated from oracle to MariaDB and saw big performance gains. We happen to be using AWS for hosting, but it's Maria, we can go anywhere.
They don't really charge you a fee. The only thing you are charged is data transfer out cost of whatever amount of data you transfer out. And that price is the same whether you are transferring data out for backup, for use by your internal systems, etc. Or for leaving to another vendor.

Also, as far as I know, all cloud providers charge for data transfer out.

I would protest the point that you have to be as large as Amazon to produce your own database-as-a-service solution, especially if you are only building it for yourself. Throwing some automated tooling around Postgres and any arbitrary linux VM hypervisor API should get you a lot of the same value.

It doesn't take a ton of magic to allow a developer to spin up a pg cluster with a few clicks via some custom web tool. Reporting and operations are trickier to handle, but if you don't need to satisfy the same customer base as Amazon does (i.e. you are your only customer), you could probably pull this off at nearly any scale.

That said, I will certainly grant you the cloud vendor lock-in angle. It truly is one of the biggest ploys of this decade. My organization takes great pride in only using the most fundamental of cloud resources (compute instances, block storage, DNS, VPN, routing). If we had to evacuate AWS to on-prem or some other provider, it would not be a huge ordeal. For those who wound up with their entire business stuck firmly inside vendor-specific things like Lambdas, you have my deepest sympathies.

Just because Bill Gates has the resources to buy a fleet of 747s doesn't mean I can.
I think the approach can be applied to many companies. I have seen some companies turning every single data storing problem into an Oracle problem. Amazon turned many of the problems into ones that are easier to solve. Using 6 different technologies[1]. I am sure not all applies to all departments but it is a better approach to do this at the scale they got. For small companies this really does not matter. If your hot data fits a single node disk cache you obviously won't benefit from using a horizontally scalable database but Oracle's customers are often in the higher end of the scale spectrum. The question is how can Amazon compete with Oracle where the relationship is there for decades between a customer and Oracle. Good example of this is banks. They managed to get some of the financial companies to move some workloads to AWS but to move Oracle workloads to something else is a whole different game.

1. https://media.amazonwebservices.com/blog/2019/bye_bye_oracle...

It is. The effort is not really as other comments put out to build a Oracle competitors. Arguably for most companies, the open source alternatives are enough for them to be happy with.

What Amazon shown here is the transition at scale is possible.

The developer carrying it out still using 2015 MBP
Me too - still the best laptop
My 2011 MBP is still my primary. This is the case for a lot of people because the newer versions just don't compare. On to of that you can't even upgrade the components in them since everything is integrated into the board.
In my opinion the best user friendly mac was the unibody early 2009 15" MacBook Pro. It was the last Mac with a removable battery. Plenty of technological improvements have been made since then but I still love that model.
Ditto. My 2011 MBP is a truck that just won't quit. Although I've replaced just about everything in it but the processor, the fact that I was able to do so makes me love the machine.
I only just now replaced mine (with a Mac Mini + an iPad Pro) because my graphics card died for the last time.
My company has tried to get me to replace my 2015, and I am resisting until they release a better keyboard design.
The latest revision is not bad. But it’s not great either. Kinda mushy.
Is that a...big deal? It's just 2015. Most of my coworkers use 2015 models because they prefer them.
Many consider 2015 the best year yet for MBPs.
You'll have to pry mine from my cold dead hands.
Imagine the disappointment when pressing enter and nothing happens because the key didn't register.
I'm also on a 2015 model, but it was manufactured in early 2017 so it's not that old. I and several people I know are holding out on the 2015s for as long as they can because of ports, no touch bar, and a better keyboard compared to the newer models.
We currently have two 2018 MBPs on the shelf that were bought as 'upgrades' back then but they're sitting unused because people are sticking with their 2015 MBPs until they won't be maintainable anymore or Apple (or someone else) releases a version that's an improvement over 2015 MBP instead of a downgrade.
Wow! Congratulations to the engineers. Oracle digs in deep. Bet that is a massive headache off a lot of people's plate.
> The migration gave each internal team the freedom to choose the purpose-built AWS database service that best fit their needs, and also gave them better control over their budget and their cost model.

Anyone know of a comprehensive resource that we could use to figure out which DB to use?

Here’s an algorithm which I believe to be 95% accurate:

If only a single user/device needs to access the data: use SQLite. In all other cases: use PostgreSQL.

At Amazon level you start needing specialized databases. For most other people Postgres is fine.
Not sure how much sarcasm is built into your statement but as a long time user & supporter of Postgres I have to disagree. Postgres is fantastic at many things but there are times when it's not the best choice. An example would be high-scale OLAP. I've tried to use PG for those cases but ingesting thousands+ of events per second into PG and then trying to perform rollups on them in an online capacity (near real-time availability) requires a TON of extra legwork to get it going and near continuous maintenance thereafter. Other purpose-built DB's for OLAP such as Druid, Clickhouse, etc are much better suited for this type of use-case. The main advantage these systems have over Postgres is their column-oriented nature vs. row-oriented of PG and other RDMS.
> Postgres is fantastic at many things but there are times when it's not the best choice.

To be fair, that would be the 5% :).

Glib perhaps but no sarcasm intended. I do agree that there are use cases where PG loses out to more specialized tools, but that’s the 5%, and if you are in that zone you probably know you are and are likely to be capable of doing your own more robust evaluation.
on the similar MS stack of SQL Server it breaks down hard when you start trying to max its throughput. You have to start tearing down all the features, turning off indexes, foreign keys, etc. Otherwise what could take hours will take days or even weeks.
If provisioning and maintaining MS SQL Server is more of a happy path for your IT department, that's not a bad choice either.
The og-aws Slack or ##aws on freenode

But really, you should understand what kind of data store you need based on your use case is first and then decide on an implementation later...

(comment deleted)
Migrating everything to the same externally-available cloud infrastructure is exactly the thing that Google needs to do, but has been failing at for going on a decade now. Yes, I'm bitter about it.
It's not even on the radar for them I believe. Maybe ask again in another ten years.
Is it not the case that it is actually the opposite? That GCP is running on the internally-available cloud infrastructure at Google?

How would they turn that inside out? What would GCP actually run on if they ran GCP on GCP? Or do you mean run search/gmail/youtube on GCP? Isn't their internal infra basically kubernetes in all but name?

I've heard that Google is bad at dog fooding their own cloud infrastructure and even that Borg is still dominant over Kubernetes in their internal infra but don't have any insider knowledge. If true this is one thing that Amazon is vastly superior than Google at.
Yeah there was a post about that on HN that got a lot of attention a week or two ago. I think that letter/essay was written before google cloud platform was really a thing, would be interesting to know how things have changed since ~2006.
Internal teams are using some GCP services, but overall nearly all teams stick with Borg. Many key services like Search are not able to switch to GCP b/c performance degradation.
Yes, this is exactly what I'm saying.
At least in azure, the "platform" that azure runs on doesn't have anything like a managed sql database or a distributed queue service. It's strictly a compute platform. I'd imagine GP is suggesting that only the things that absolutely must run on internal-only infra do so and the rest like YouTube or Gmail run purely on top of GCP (which only happens to be on top of internal infra)
It depends where you are in the stack. At a low level they're using the same data centers, but the public stuff like GCP and Kubernetes is a rewrite of earlier internal software and migration of higher-level servers to a different stack is nontrivial.
Amazon Cloud itself is not externally available, and runs on parts of its infrastructure that are non-public. It's like GCP in that regard, except that most of the rest of Amazon's products are then built on top of this cloud, whereas with Google that's not the case; there's a parallel internal-only infrastructure that every Google product you've ever heard of (Search/Gmail/YouTube/etc) runs on.
(I work at AWS)

One of the more interesting things I've observed over the past few years is the incremental effort to get AWS teams "lower in the stack" onto native AWS offerings. This makes sense: the less parallel or underlying infrastructure you have to maintain to scale and support the public cloud, the more time and attention you can devote to public services. Many (most?) new AWS services are fully native AWS (including the one I work on :)), and design and operational readiness reviews require justification for not using native AWS rather than the opposite.

The claim is that some of the data was migrated to publicly available systems. I'm guessing that quite a bit of it is stored in amazon specific systems, for two reasons. First, availability. If the amazon product catalog depends on Aurora, then when Aurora has an issue, so does Amazon retail. Second, custom solutions that were developed before modern alternatives existed have an insurmountable inertia in a big company.
If the amazon product catalog depends on Aurora, then when Aurora has an issue, so does Amazon retail.

Because one-off internal IT never goes down? This isn't a good argument, especially since AWS wants to handle their other customers' availability.

No, not at all, but it rarely goes down at the same time. I mean, I could be wrong, but that's my read of the announcement. Another issue with the managed services is that they don't provide total control over configuration, which is a complete show stopper for a large high performance data store.
A lot of large cloud outages are caused by networking problems, which do tend to bring everything down.
(comment deleted)
The very fact that they are dogfooding DynamoDB (with core features of their business) makes me want to take it more seriously and use it more.

I also love that they didn't just replace Oracle with <insert competing RDBMS here> but instead thoughtfully pieced together a strategy based on what the data was going to be used for.

Well done!

Have used DynamoDB a couple times, most recently for data processing.

It is extremely expensive, for data storage and performance. Queries are limited and cumbersome to write.

If you are looking at it, put a reasonable amount of test data in and play with it too see what costs look like compared to the performance you need from it.

Expensive compared to what? DynamoDB has the cheapest 4ms writes I can find...

But yes, absolutely prototype and measure costs with real workloads

The DDB query language is one of the largest warts on the face of AWS. “Select From Where” is a solved problem!
I have the exact opposite experience. These are just anecdotal experiences. Without providing insight into the workload and your approach it is pretty meaningless.
In my mind the true "hard part" would be in migrating business logic that lives in Oracle stored procedures (PL-SQL). Are there any tools that do a decent job in translating procs to non-Oracle dialects?
Yep, we built SQL Tran to do exactly that. https://www.spectralcore.com/sqltran. Finishing the rewrite right now which allows us to make changes much faster.
When is it out of Beta?
In a few months, it's not so far away. If you can share your database code (data is not important), we can make sure that our parsers and translation layer work with all the code constructs you use from day 1.
> Are there any tools that do a decent job in translating procs to non-Oracle dialects?

One of the main selling points of EnterpriseDB (built on top of and supporting development of Postgres) is a significant degree of Oracle compatibility, including PL/SQL, client interfaces, etc., so if you go that route you might not need much translation.

AWS has the AWS Schema Conversion tool that works pretty well.
Hate oracle personally. But when Amazon mention cost savings, I assume they're not at list price for normal aws customers like us?
Article mentions that, yeah - cost savings are based on their already heavily discounted deal with Oracle.
I think OP was asking if Amazon is calculating their savings based on the public AWS service pricing or their own cost for running on those AWS services (there's obviously a good chunk of margin on what it costs to run AWS and what the listed service prices are for those services).
I think OP means Amazon’s discount on AWS.

Many customers on AWS have contracts that guarantee discounted rates given sufficient volume. People have commented on hn about negotiating them, and you can see some examples from recent IPO filings. Amazon (the non-AWS parts) are yet another customer of AWS, and wherever possible you should expect them to operate like one. They even buy RIs!

I can't say either way, but they mention the average person saves even more than they do (90% vs the 60% Amazon saw). This was due to their Oracle license being much cheaper than normal Oracle customers. So if you extrapolate, even if they did get some discount being Amazon, the discount they were getting on Oracle probably makes the savings comparable to if they weren't getting large discounts on each side (regular customers of Amazon/Oracle).
Oracle licenses are priced with a relatively equation, taking two inputs:

1) How much money do you have 2) How much would it cost you to switch to something else

Your annual license cost is the smaller of the two inputs, minus a 10% discount.

Your formula yields zero in some cases.
It's also satire.

Wondering what you think of the following quote:

> Baseball is ninety percent mental and the other half is physical.

I wonder if anyone here has seen any net new adoption of Oracle DBs in the last few years? It was an absolute juggernaut 10-15 years ago and has rapidly tanked their reputation and spread their business across software, services and cloud with mixed results. Is it actually still growing or just milking their stodgy enterprise customers for more money?
I think that not very many existing customers of Oracle migrate off, but I have to think that they are no longer the default for new and growing businesses to move into. AWS seems to have become that, with Oracle not even the second-most likely option (that would probably be Google or Microsoft).

Having said that, Oracle is probably the COBOL of databases, in that it will still be around (collecting good $$) from its existing customers for a long, long time.

I believe the business model is that it is near impossible to leave the ecosystem (this is also how SAP can still thrive). It takes a lot of money and expertise to make the migration happen. Few companies have scaling problems as pronounced as Amazon and as much of a vested interest in migrating to their own custom solutions.
SAP survives because it's good and handles a lot of business cases.

I still hear implementations.

I don't hear implementations of Oracle.

When they threaten you with lawsuits for using their software, and make their pricing completely opaque so you don’t really know what you owe (Comcast style), why would you knowingly choose that? Postgres is pretty darn good these days.

I still love Java, but I won’t be surprised if that language becomes a business risk because of Oracle’s behavior in other spaces.

You must have missed the Amazon Corretto announcement— there’s an Amazon JDK now.
My guess is that like they did with Google, with time, Oracle will go after all the OpenJDK derivatives.

To be clear the licensing appears to be open enough so that this shouldn’t be a real threat, but IANAL.

I'm sure it will be priced at just below the cost in legal fees to defend yourself..
Coretto passes TCK (as well as RedHat and Zulu, amongst others out there), there's nothing to sue for.
Google did not have an OpenJDK alternative, they had a implementation of a language and stdlib that was 99% identical to Java.
Oracle owns Java. Amazon just builds its own version.
> Postgres

Yes, maybe there will be built in automatic fail over in a few years so you don't have to hack it together using a bunch of scripts.

Of course there's overlap in functionality and most companies should probably chose PG over Oracle. But PG is a joke in some areas like the above mentioned.

Maybe PG even gets kickbacks as a feature. Who knows!
> Yes, maybe there will be built in automatic fail over in a few years so you don't have to hack it together using a bunch of scripts.

thanks microsoft !!

https://github.com/citusdata/pg_auto_failover

Oracle is slashing positions in a lot of their sales divisions. There was a large layoff this spring/summer, and from what I can tell from contacts that were there, anyone who can is jumping ship to AWS or other competitors, and poaching as many of their old customers with them as they can.
In 2001/2003, I led a small team at an agency that converted Kraftfoods and 50+ brands from 25+ ATG Dynamo web/app CMS servers + 20+ Oracle servers to .NET 1.0 CMS on 3 web servers, 3 app servers and 3 Microsoft SQL Servers.

Even then Oracle tools were horrible for developers and still are. The only reason they had that many databases was Oracle's business is licensing, massive, expensive licenses, and their sales pushed them sold through upper management. Those days are almost over, developers choose the tech, the cloud is here. Without Tom [1], Oracle was basically not even a great developer community, all documentation was bad and the Java interfaces on the tools / management studio were horrendous. Oracle is fast but for most things on the web caching comes into play heavily and other databases are good enough. Oracle is good for large datasets/reporting, cursors are extremely fast when Oracle is tuned, the problem is it is like vehicle that needs tuning and optimization all the time or it drives bad. The cost and upkeep make Oracle mostly overkill and too painful.

Ellison laughed at the cloud like Ballmer laughed at the iPhone. That was a major error. But ultimately Ellison is an engineer that forgot to make sure developers like to use the product. That will ultimately be their fatal flaw as now the developers choose the tools not what is sold in above them.

All other platforms are developer centric and cloud first now. Oracle the all seeing one says the end is nigh for Oracle the database. No new projects will be using it without force. Too bad Oracle also owns MySQL, Java etc. I really wish someone else had bought Sun.

[1] https://asktom.oracle.com

Oracle's new licensing requirement for Java is a bit threat to that platform. My company for technical reasons can't switch to OpenJVM so we're going to pay Oracle their new licensing money but we're not doing any greenfield Java development and are going to work towards moving our Java applications to another platform. That's an n=1 example but wouldn't be surprised if others end up migrating away, causing longterm harm to Java.
I'm curious, what are the technical reasons OpenJVM won't work for you?
I think he complained about licensing fees?
But licensing fees aren't 'technical issues'. You say 'technical' to mean not related to things like licensing.
Some support contracts only support if using x JDK Some software checks the exact JDK and only runs using it etc.
I guess you could use the OpenJDK VM for new projects even if legacy projects are reliant on the Oracle VM.
> My company for technical reasons can't switch to OpenJVM

The OpenJDK (not 'OpenJVM', that's not a thing) is literally 100% the same build as Oracle JDK now. There can't be any technical reason.

It's the same now, but in previous versions there were important differences. Might be legacy code that's hard to make forward compatible.
AWS is maintaining separate releases of the JDK to help offset the release shenanigans of Oracle.

And there are other concerted efforts to keep control from Oracle in releases and the validity of the JDK.

As long as a sufficiently large majority (and AWS is helping here a lot, admittedly) maintain such regimented discipline, the JDK will be ok.

Oracle mostly wanted it to sue google for billions. That suit is basically dead, and Oracle knows the JVM isn't worth any large scale revenue.

It might be the magic "support" word - random openjdk builds don't bring any commercial guarantees.

This said, the likes of RedHat, Amazon and Azul are pretty happy to offer those guarantees, and I bet their prices are lower than Big Red O.

Yes, but that wouldn't be a 'technical' reason, would it?
But there is: Some software checks the name and version (major and minor) of the JVM vendor against a whitelist.

Guess which One Rich Asshole company has this practice.

> One Rich Asshole company

This is just personal abuse.

“Do not make the mistake of anthropomorphizing Larry Ellison!” - Bryan Cantrill
couldn't his software be written on a relatively older version of the JDK that would preclude this?
We were told not to download any new versions of java due to oracle trying to extract money for it. Basically we are going to do the same.

Purge every oracle product slowly but surely

> We were told <...>

Yeah. Say no more... If only you would have looked. Anyhow, Oracle does the following:

- Contributes pretty much all of the closed source technologies (or what was originally to become closed source) of the Oracle JDK to OpenJDK, for example giving the community: JDK Flight Recorder; JDK Mission Control; ZGC; …and probably more stuff I can’t think of right now;

- Ensures the Oracle JDK and the OpenJDK builds are virtually indistinguishable;

- Starts providing a free OpenJDK build (which includes all these donated technologies);

- Provides uncountable man hours of maintaining and innovating the Java platform;

- Ensures that the community knows where to find the free bits by linking to them, and slaps on a bright yellow warning sign, so that everyone can see that the licensing has changed;

And how does the community react, you wonder? Yep, that’s right. “Oracle is the Devil”, “This is a bait and switch operation” etc. Ad nauseum.

ONCE AGAIN. You do not need to use OracleJDK. Just use OpenJDK from AdoptOpenJDK.

Isn't oracle only charging for support of older jdk's as well? If you just stay on the current version path of upgrading every 6 months you shouldn't have to pay for anything at all.

Does any language offer free support for years old versions?

I am aware... I work in old school financial services there is more red tape and politics with these types of things. I am merely stating what our plans are. We don't really use Java for any new development on our team so the easier solution is to just avoid it. There is a big team that will need to switch over but that isn't our problem.

The long short of it is we aren't a booming industry and we do it for the money so one less vendor we have to send a 7 figure check to will only increase the bonus pool.

We switched to AdoptOpenJDK, zero problems so far.
So rewriting everything onto a new platform is cheaper and less risky than doing the work to break dependencies on Oracle JDK? I know nothing about your situation, but it sounds to me like you've made a mistake somewhere.
ATG Dynamo. Brings back some memories. It was actually a really smart platform that was killed by the vastly inferior J2EE. Spring is basically the same premise as Dynamo and is still going strong.
J2EE reminds me of another blast from the past, a contract around the time for Java (Apache) Struts [1], boilerplate hell and not fun.

Fun fact: Java (Apache) Struts 2 [2] is a vulnerability mess. It was used by Equifax on the breach:

> Struts 2 has a history of critical security bugs, many tied to its use of OGNL technology; some vulnerabilities can lead to arbitrary code execution. In October 2017, it was reported that failure by Equifax to address a Struts 2 vulnerability advised in March 2017 was later exploited in the data breach that was disclosed by Equifax in September 2017. [2]

They probably went with Java EE because it was "secure", little did they know Struts would enter the game. Equifax I am sure treats their developers good by how often their software was updated /s.

[1] https://en.wikipedia.org/wiki/Apache_Struts_1

[1] https://en.wikipedia.org/wiki/Apache_Struts_2

jee is a set of interfaces, it cannot be secure or not.
"Memories" is an interesting way of spelling "nightmares".

The Dynamo part of it, the pure application server part, had a few genuinely decent features. I've never seen a dependency injection framework like Nucleus, despite the fact that it makes an awful lot of sense. And you got /dyn/admin!

The whole publishing thing - derive a versioned dual of your database schema, edit data in it using a reflective CMS, then automatically publish changes to your production database - is kind of amazing. Source control for databases. I haven't seen anything else like that. Apart from just putting databases in source control, i guess. It occasionally got absolutely screwed up, but the idea was cool!

But a lot of it was absolute garbage. Repositories, where database entities are mapped to these crappy dictionary things that you need to either wrap or go mad trying to customise to actually use. Form handlers, whole classes for what would be a single handler method in a modern framework. The wacky build and packaging stuff.

And then whole commerce layer of it. Pipelines where the majority of the steps are about doing cleanup and normalisation that's only necessary because of how weak ATG's data model is, and the real commerce value could have been a single 20-line function, and adding your own stages becomes and exercise in boilerplate-smithing. Catalogue maintenance, which you have to run sometimes, because apparently it's too hard to just keep the database consistent. Scenarios, the businessperson-usable customisation tool that isn't, in practice, usable by businesspeople!

I kind of agree on the pipelines, it's a serious case of over-engineering for very little benefit and many frustrating sessions of debugging kilometers of stack traces under which the actual error was hiding.

However, publishing has always been a dumpster fire for me, from the very first time I've used it (around 2004-2005 IIRC) to 2015 when I stopped working with ATG. Deploying changes never worked reliably, full deployments could take days, if not weeks, and relying on RMI made for a very fragile system anywhere multiple network interfaces were involved.

Nucleus and /dyn/admin are incredible features, not only for development but for having near total control of your application in production. I can't count how many production incidents I've solved with curl and /dyn/admin alone.

While I know Oracle thrives off unearned reputation, (and that Ms SQL is a seriously underrated product outside of enterprises)- I refuse to believe that 3 ms-sql servers were equivalent to 20 oracle's. You must have lost something .
I’m interested in seeing how much they try to milk Java in the next 10 years. I can see them getting desperate enough to really bring the hammer down on licensing, killing off openjdk, and making life miserable for everyone in the process.
How? Its an Open source implementation of the java vm which they don't own.
Don’t they claim some sort of copyright on the APIs and also restrict what can be called “Java”?
There are a couple ways they are trying to do this. They’re actively fighting the court battle vs Google for copyright of the Java api. They’re also adding more features to Java that are only supported in new versions, and they can/will attempt licensing lock in for those features. OpenJDK might survive as permanently stuck in version 8, or it might survive as a fork which will divide the community.
OpenJDK is not stuck on 8, and is where all language development goes.
Except the opposite is happening lol:

- Contributes pretty much all of the closed source technologies (or what was originally to become closed source) of the Oracle JDK to OpenJDK, for example giving the community: JDK Flight Recorder; JDK Mission Control; ZGC; …and probably more stuff I can’t think of right now;

- Ensures the Oracle JDK and the OpenJDK builds are virtually indistinguishable;

- Starts providing a free OpenJDK build (which includes all these donated technologies);

- Provides uncountable man hours of maintaining and innovating the Java platform;

- Ensures that the community knows where to find the free bits by linking to them, and slaps on a bright yellow warning sign, so that everyone can see that the licensing has changed;

Some bits do not even make sense: >OpenJDK might survive as permanently stuck in version 8

??? Wat?

Why do you think that they don't own OpenJDK? Here's snippet from "OpenJDK: How to contribute" page:

> Like many other open-source communities, the OpenJDK Community requires Contributors to jointly assign their copyright on contributed code. If you haven't yet signed the Oracle Contributor Agreement (OCA) then please do so, scan it and e-mail the result to oracle-ca_us(at)oracle.com. Please make sure to specify OpenJDK as the project you'd like to contribute to so that we can process and store your OCA. Allow at least two weeks for processing. If your request is urgent contact the appropriate Project Lead.

It seems to me that they actually own OpenJDK. I'm not a lawyer, but I think that they have the power to make all code proprietary if they want.

Well they definitely can just like Microsoft can with all their open source projects which require CLA and all the other big corps with same open source model but the already published code also stays under the currently assigned license. They can only change newer version's licese which would probably cause a fork and do more damage than help
This ownership of copyright gives them the possibility to release the next version of (not-)OpenJDK under a proprietary license, but does not give them a possibility to kill off the current version of OpenJDK as every single user who has received explicit perpetual irrevocable license to use, change and redistribute the current version - so there's always a possibility for a true open source fork.
you're right, vbezhenar... i believe the spirit of my message remains unchanged: openjdk is almost entirely open source (GPLv2 + Classpath Exception).

they cant pull the this licence from already published code, which means that they cant forcefully monetize it anymore. if they tried, someone else would fork it and continue its maintenance.

> which they don't own

They do own it. They own the copyright on the source code (all of it - even if Google or Intel wrote it). They own the trademarks. They own the specifications.

Apart for their lawsuit against Google, they're ownership of copyright just means they could choose to relicense future code under a different license, even proprietary if they wanted.

At that point, someone else could attempt a hard fork. Same as what AWS did for Elastic search and MongoDB. The existing release code is still under open source license and so would allow for that. But whoever's attempts that fork, unlike Oracle, would not be allowed to change the license terms beyond what the current open source license allows.

And, someone could also choose to not re-use any code, and re-imement from scratch the spec, like what Google did for Android. That said... the open lawsuit against Google is still deciding of the legalities of that one.

I can imagine that there are more than a few Oracle customers whose spend increases year-over-year because:

1) they have significant investment in the human capital side of Oracle, which is to say, Oracle DBAs on staff who are highly capable at keeping the lights on for their Oracle databases, but have little or no familiarity with alternatives 2) enterprise architects are required to get approval from their DBAs for the design of new systems, who won't approve non-Oracle databases that they can't support, so new systems get built with new Oracle databases 3) the financial cost of the additional databases is organizationally far enough removed from the design phase that Finance has no real power to say no, and anyway such enterprises have other areas of the business that are far more bloated grabbing Finance's attention, where the cost of additional Oracle licenses is a rounding error by comparison 4) Anybody at a high enough level to see why this is a problem has far bigger problems to deal with and so the situation persists.

I doubt that apathetic enterprises are enough to make Oracle database a growth center overall when nobody in their right mind adopts it for new companies, but I doubt that all of their customers are looking for a migration exit.

#2 is my life. AWS is cheaper overall but that transition takes a ton of cash, because you have to pay the DBAs AND Oracle AND Amazon until you can transition to AWS (or Azure).
Often it's the apps, like eBiz Suite, that drive the net-new adoption of the underlying DB.

The large Accounting firms handle 80% of the financial audits of Fortune 500 corporations. They are used to walking up to Oracle DBs and extracting the reports needed for compliance and reporting.

If they have to learn a new ERP or proprietary Accounting system, then the T&M costs can mount.

We started a new SaaS company last year. We use Java + Oracle from the get go.

Last company was very reliant on Oracle, we ran the entire business on a single Oracle instance for a couple of decades.

We had our share of adventures, but over the years never lost a minute's worth of data despite server, hard drive and other issues. We've also had a few scary performance problems, but have always been able to tune the DB to get past them. And once or twice, we've been in a dark place where you are googling for cryptic error codes, and we've always come through. That's a lot of business and millions of dollars earned through having a very reliable database underneath.

For us, the cost equation is whether it's worth learning a new DB. It's not. If you can run your business on a single instance, then on AWS, it's cheaper to stick with what you know than to try and move to a new DB for a few K of saved licence fees.

What's more, using Oracle is a good answer when the PHBs at our customers ask about our stack. No one ever got fired for using Oracle.

So yes, it certainly makes sense to use Oracle for new projects if you are already Oracle experts.

Java is somewhat the same equation as well ;)

>No one ever got fired for using Oracle.

Yet.

One area of growth - Accidental Oracle customers. Oracle makes software acquisitions and bases the new version of the product on Oracle DB. Customers are forced to upgrade and take on an Oracle DB, or get a firm push into the Oracle cloud.
In other words, AWS used the stones to sustain the stones.
(comment deleted)
wasn't Larry Ellison last year who was bragging that the whole of Amazon/AWS runs on Oracle?
He often uses Java as a means of making that statement somewhat true.
That, and Oracle's legendary shitty business tactics, probably pushed AWS to make this a higher priority, and stick it in oracle's face with videos of oracle shutdown parties and blog posts.

Take that, Larry Ellison.

To be fair, AWS does run on Java.
Which is being migrated to AWS Corretto (if it hasn't been already).
> stopped oracle

Now Amazon should do this to every company using them.

I am pretty sure the emotions are real in this video.
Sorry I wasn't saying it was faked and I'm talking about the act of posting of the video, which I don't think it would be unreasonable to view as being deliberately provocative.
That was the actual shutdown. I was there, it was not rehearsed, and there were no retakes.
Sorry I wasn't saying I thought it was faked or something like that, in case that wasn't clear. I was saying that posting a video celebrating removing a vendor's software from your organisation could be seen as taunting them. Which - given that it's Oracle we are talking about - is pretty funny.
Who was the lucky bod who got to do the deed, and why did we only get to see their right arm?
As someone who has never used or worked with Oracle DBs, can someone explain why migrating to another technology is so difficult?

With all the database engines available, is there really not another one that can match Oracle without massive customizations?

It probably starts with horrible things (not SQL compatible) like "" is equal to NULL...
It really depends on how your applications were designed. If you "go deep" with Oracle - and if you've hired Oracle DBAs, you probably have - you probably have a lot of your business logic buried in a large body of stored procedures that aren't version controlled and rely on Oracle-specific behavior.
Oh man. I used to work at Amazon at a time when this Oracle deprecation was starting up. It's utterly non-trivial.

It's not really "switching relational DBs", it's "rebuilding all of the legacy systems to not use relational DBs". Their scale had long since left the realm where it was reasonable to run everything on massive monolithic DBs, but the technical debt hadn't been paid down -- so they just kept putting more money into bigger and bigger hardware and larger DBA teams to support them. For instance when I last worked the there each warehouse ran on a single massive Oracle DB. That isn't solved by swapping to another database; it was well beyond reasonable.

I suspect that this article seems like a bit of self-promotion but it's actually intended as a giant middle-finger to Oracle.

> but it's actually intended a giant middle-finger to Oracle

When they were all cheering, I actually felt bad for Oracle for a nanosecond.

That sounds way too long. I think you should get that checked out.
In theory SQL is SQL, even more so if your App uses a layer of indirection like an ORM. If you don't use any Oracle specific features, procedures and similar, in theory you could just replace it.

But that is not what happens.

First problem is - majority of mature enterprise systems (which tend to use Oracle), are not designed in such a schoolbook way, so that's you first problem. Codebases are ugly and teams loose the knowledge to maintain some parts that are mature and work mostly ok - often the DB layer.

Another concern is regressions in the product that is hard to properly test for. Minor details that are exposed by even small changes in DB behaviour or performance, that won't get caught in testing, but will cause an impact when your next scheduled job happens to fall on the first friday of that one month where the customer has that very special report that is just slightly so different and runs only once every 7 years.

Another major pain point are operational concerns. When dealing with DB technologies, managing, deploying, operating your back end DB servers can be quite a different beast. In theory your teams should be able to handle it, as they are experienced engineers that know how to learn new tech quickly. In practice, you don't have money for those, and your team is lazy and doesn't really want to learn that new cool tech, just let them do their job.

And finally, if it all "just works" at the moment, it is a hard sell to switch such a fundamental part of the system and properly validate the investment versus the risks.

And this is all if you're not a super user of Oracle specific pieces, surrounding tooling or consultants/expertise.

In practice, you don't have money for those, and your team is lazy and doesn't really want to learn that new cool tech, just let them do their job.

In practise, you want to cheap out on paying for training, have your team do their job and learn an entirely new system to expert level at the same time, the "cool new tech" isn't and your team knows that you're trying to sell it as "cool" to pull a fast one on them because you think they're idiot children, and you won't even commit to using it for long enough to make it worth the bother of trying to learn before changing your mind or prioritising something else, and you're humming and hawing about investing in the tools to make the new tech work well because it's free software so why should it cost you any money?

Besides, you won't prioritise maintenance or design, so the codebase is a mess and people are incentivised towards panic-of-the-day fixes and don't-ever-ever-break-anything conservatism - their fault not yours, obviously, it can't be your fault, you don't even work with the tech (you just choose it by fiat).

I used to write PL/SQL long time back. In old days, every business logic was written in stored procedures, which the java code calls. Migrating stored procedures is a hard part since whoever wrote it left the company long time ago.

Whatever talent available in the company that wants to migrate off Oracle, would not want to take the risks of migration failure.

When you have an Oracle database, you probably have a lot of PLSQL. That, in itself, is not so serious (PgPLSQL is quite similar).

But you'll probably have Forms, Reports, and Apex too. These are all designed to make building an app a piece of cake but make it impossible to migrate except if you rewrite the whole thing.

> Financial Ledger – This team moved 120 TB of data, reduced latency by 40%, cut costs by 70%, and cut overhead by the same 70%, all powered by DynamoDB.

Does this mean they have a custom set of books running atop DynamoDB or is this specific to aggregate reporting and financial data warehousing?

Would love to know also. My guess given the volume of data is data warehousing.
Amazon's leadership famously pushed hard in the early 2000s for all its systems to share data only via service interfaces ( https://gist.github.com/chitchcock/1281611 ).

I wonder how much of the reason for that was actually a wish to avoid getting further locked in to Oracle (changing or removing a database that backs a single service is very much easier than changing a database that also acts as an integration point).

If the goal of SOA was to reduce Oracle lock in then it utterly failed. After SOA practically every team had an Oracle db, so now they have to convince tens of thousands of engineers to migrate thousands of databases.

Imagine what Oracle is going to try and charge Amazon per month for every remaining DB given how publicly hostile Amazon has been.

I think you missed the point slightly. If the interfaces between these services are now Oracle agnostic, it makes migrating off Oracle (by mandate, if necessary) more feasible. More pointedly, I struggle to imagine a scenario where using Oracle of e.g. Postgres would be meaningful in any sense outside of the specifics of Oracle's out of the box integrations. If they aren't being used, why would anyone use Oracle at all?
Amazon has enough money to not care. The marketing from this announcement will make them enough money to not care even less.

The contracts almost certainly have pre-negotiated rate increases. You don’t put the vendor in a position to double your rates after you’ve adopted software.

Obviously, enough Amazon bots are giving me bad karma, but my point stands: No, Amazon is not a special snowflake because it did this.

This was an expensive exercise in spite, took a long time and a lot of people - and everyone knows it.

They could have done this far efficiently already if they wanted to scale out, but that company has too many conflicting internal priorities that they took a heck of a long time to move away to anything that scales.

They never try to invent things and if not Oracle, they'd use some other vendor built software. That is the true reality of this company.

So no, if you're thinking you're better than this company for moving away from vendor built software, you are mistaken. In the worst possible way.

They did move to vendor built software. They moved to one that they could get better prices for, AWS. Everyone else will not likely get the deal that they received.
> Everyone else will not likely get the deal that they received.

True, but similarly few people would be able to swing the kind of discount they got at Oracle. I'd be really interested in seeing what those discounts worked out to overall.

"Amazon bots"... sure dude. Because all your opinions are popular by default. Otherwise is just "bots" downvoting you.

Why people can't admit that their opinions can be unpopular sometimes. That's not a bad thing. Not all the things you say need to be popular to have meaning to yourself and others. It sucks to be downvoted but that's part of having a healthy discourse in HN.

Okay, all is fair in a really healthy discussion. The reason I write what I write anyway is because I believe in them. Your point is taken and accepted.

I've slammed Google, FB and some other tech companies on certain occasions BTW, and I absolutely never felt bad about it. Thanks!

It is hard to understand what you are saying. HN is not really an AWS loving place. Expensive in regard of what? If you end up saving 50% of your year over year cost across all the company than spending millions on this project and running it for 5 years is still worth the investment in the long run at their scale. Amazon is not looking for 1 month investments, their AWS endeavour is 13 years old[1]. They can spend a long time on something if they really up to it.

1. https://www.statista.com/statistics/250520/forecast-of-amazo...

We've been working on migrating from Oracle to Postgres for a few years now. We are about 2 weeks from being finished. It is not for the faint of heart, but it is totally worth it. The documentation is much much better, performance is equivalent or better, the sql dialect is saner, etc. Other than moving the data itself (ora2pg was invaluable for this), rewriting the queries is what has taken the most amount of time. Some of our tips on differences between oracle and postgres sql:

replace nvl with coalesce

replace rownum <= 1 with LIMIT 1

replace listagg with string_agg

replace recursive hierarchy (start with/connect by/prior) with recursive

replace minus with except

replace SYSDATE with CURRENT_TIMESTAMP

replace trunc(sysdate) with CURRENT_DATE

replace trunc(datelastupdated) with DATE(datelastupduted) or datelastupdated::date

replace artificial date sentinels/fenceposts like to_date(’01 Jan 1900’) with '-infinity'::date

remove dual table references (not needed in postgres)

replace decode with case statements

replace unique with distinct

replace to_number with ::integer

replace mod with % operator

replace merge into with INSERT ... ON CONFLICT… DO UPDATE/NOTHING

change the default of any table using sys_guid() as a default to gen_random_uuid()

oracle pivot and unpivot do not work in postgres - use unnest

ORDER BY NLSSORT(english, 'NLS_SORT=generic_m') becomes ORDER BY gin(insensitive_query(english) gin_trgm_ops)

Oracle: uses IS NULL to check for empty string; in postgres, empty string and null are different

If a varchar/text column has a unique index a check needs to be made to make sure empty strings are changed to nulls before adding or updating the column.

PostgreSQL requires a sub-SELECT surrounded by parentheses, and an alias must be provided for it. - SELECT * FROM ( ) A

any functions in the order by clause must be moved to the select statement (e.g. order by lower(column_name))

Any sort of numeric/integer/bigint/etc. inside of a IN statement must not be a string (including 'null' - don't bother trying to use null="" it won't work). Concatenating a NULL with a NOT NULL will result in a NULL.

Pay attention to any left joins. If a column from a left join is used in a where or select clause it might be null.

For sequences, instead of .nextval use nextval('')

Using SQL Server exclusively has given me a Never-Oracle mindset. Some of these differences sound insane. and

> any functions in the order by clause must be moved to the select statement (e.g. order by lower(column_name))

I'd pull the hair outta my head

But functions in the where clause are an unsargable mess :(
My top 1 is this one:

> Oracle: uses IS NULL to check for empty string; in postgres, empty string and null are different

Any programmer who doesn’t distinguish NULL and "" has not passed the 2-year experience. Being generous. How did this make it to production?

Do you mean why does Oracle treat NULL and empty string as the same thing? Internally Oracle changes empty string to NULL values. Oracle won't let you insert an empty string.
Somebody can build a consulting business from this HN comment.
This is the first time I have wished Hacker News showed upvotes. They have got to be over 100 with that right?
You can model it.

- Get upvote snapshots of all top-level comments' authors in this thread. Take repeated measurements at relatively low time resolution. Also compare this to any other comments they may be making (have a model of the type of comment: follow-ups that are deeply nested probably have a lower upvote velocity)

- Find archive.org snapshots of OP as well as the authors of all other upvoted comment threads. Find the delta from then to now. Some authors will have recent data.

- For a better model, construct historical graphs of all authors using these methods and use it to iteratively adjust.

- Make sure you understand the ranking algorithm and that it is reflected in your model.

Nontrivial, but could be a fun exercise.

And of course you could store the results on Postgresql!!
Thanks I’ve sent this comment to our DBAs. Very useful.
I wonder: How long before someone adds a patch to PostgreSQL as a 'compat' patch, or extension.
I believe EnterpriseDB sells something like that.
There's a company called enterprisedb that does just that.

While they keep their Oracle compatibility stuff proprietary, they do employ several of the postgresql core developers.

and gets sued by Oracle because APIs :(
It's almost like you should set up a Patreon for this comment.
> any functions in the order by clause must be moved to the select statement (e.g. order by lower(column_name))

What does this refer to? AFAIK, you can invoke functions just about anywhere including in the ORDER BY clause:

    => CREATE FUNCTION some_func (int) RETURNS int AS $$ SELECT $1 + 1; $$ LANGUAGE SQL;
    CREATE FUNCTION

    => SELECT t.* FROM (SELECT 1 AS a) t ORDER BY some_func(t.a);
    a 
    ---
    1
    (1 row)
Are you referring to not being able to reference column aliases in an ORDER BY clause? (work around is to use a subquery)

    => SELECT 1 AS a ORDER BY some_func(a);
    ERROR:  column "a" does not exist
    LINE 1: SELECT 1 AS a ORDER BY some_func(a);
Very useful - anyone using oracle should try to use ANSI keywords now to avoid work in the future, always use COALESCE instead of NVL, use ANSI date functions, etc.
How do you develop and debug triggers?
I'm not sure what you mean. Triggers are developed and debugged in Postgres the same as in Oracle.
I am curious, what tools do you use?

No secret, that with oracle you have few full-blown IDEs where you can literally step by step execute triggers, write unit tests for them etc.

Oh, well, honestly none. I just write them by hand. I've written hundreds that way. It probably would be faster to investigate tools, but it seems like there is always something with higher priority to work on.
> replace merge into with INSERT ... ON CONFLICT… DO UPDATE/NOTHING

PostgreSQL supports MERGE statements [1], and a cursory glance doesn't seem to show that Oracle deviates that much from the SQL standard. Is there a particular reason you are avoiding the merge statement or is it simply a readability preference for the non-standard "upsert" ON CONFLICT extension?

(I'm curious because I was a big fan of MERGE statements in a past life. Part of being allowed to use them in that codebase was proving that the standard was pretty well followed across DB vendors [not that we used more than one], as well as that MERGE performance was critical to some very large dataset joins with complex update logic.)

[1] https://www.postgresql.org/message-id/attachment/23520/sql-m...

PostgreSQL does not support the MERGE statement (at least not yet).
IIRC there was a discussion about adding the full ANSI MERGE statement, but in the end they added INSERT ... ON CONFLICT and left it at that:

https://www.postgresql.org/docs/12/sql-insert.html#SQL-ON-CO...

Interesting, I can see where some of my confusion comes from if it was discussed but not completed. It's somewhat disappointing as I do think the ANSI MERGE statement is a good tool.
The MERGE statement is less functional and has a LOT of hidden gotchas, I won’t argue that I can be useful but I don’t disagree when them not providing the footgun.
I won't argue that debugging MERGE statements is easy, and that there aren't pitfalls, but it's a very declarative relational model reduce pattern so calling it "less functional" doesn't seem accurate to me, if you mean functional as in functional programming. (If you mean functional as in the raw number of features supported, I also heavily disagree because I know from past experience there are reductions you can do with MERGE that you cannot do easily if at all with other "upsert" patterns.) Again, I might be biased because in that past life I was doing some wild "big data" (of a sort, of a sort) map/reduce type stuff with MERGE (in T-SQL on Microsoft SQL Server, if that matters for painting a picture).
I should have clarified for it’s intended purpose MERGE is a useful statement, but for the use case handled by INSERT .. ON CONFLICT the ANSI MERGE statement falls flat, as it does not have the same concurrency and atomicity guarantees. It’s routinely a pain point when people try to use it to implement upsert’s in MSSQL.

For other cases there is work being done by 2nd Quadrant to add MERGE into PostgreSQL, but I’m glad the other functionality was added first to avoid a common and faulty use case of MERGE.

Merge in SQLServer is horrible imo. It’s horrifically slow. And causes more problems than it solves. After learning about upsert in PostgreSQL. Ah I wish we had it in sqlserver. The PostgreSQL code is so much cleaner and more efficient.
We've all got our anecdotes, of course, but I every time I replaced a CTE, cursor, or temp table sproc with an easier to read Merge statement performance skyrocketed. It wasn't even a fair challenge because all the CTEs and cursors were written WITH (NO LOCK) because who needs consistency or transactions, but yet Merge was faster with locks and transactions than CTEs avoiding them (and kowtowing to the local "we use NO LOCK in these parts" culture left them nearly "instantaneous").

Obviously, you have to watch your execution plans and make sure everything is indexed accordingly, because the guts of almost every Merge are a JOIN and if your database isn't set up for performant joins then of course you will hate Merge's performance.

And again, certainly anecdotal and a relatively long time ago in this industry's terms that I did any of that. But still something I'm fascinated by.

[ETA: Also, yes Merge is overpowered and underperformant for single row upsert, but as soon as you need bulk upsert, chef's kiss.]

I think full merge is scheduled for the next release.
not really true. postgres supports "insert .. on conflict" which is functionally a subset of sql merge. the feature was introduced years ago and i would not be surprised if eventually sql merge is glommed into pg core.
I have a hard time believing PostgreSQL performance is better than Oracle, can you give an example? How big is your database and how much did migrating cost you?
Think of how much you can spend on beefy hardware though, if you go with PostgreSQL, versus spending that money on Oracle licensing.
Yep, it's surprising how much performance you can get when you're not paying Oracle millions for licensing.

A lot of people who think Oracle is amazingly fast, think so because who puts a million dollar DB on thousand dollar hardware? Put any major DB on equivalent hardware and you'll get some pretty damn good performance.

This, wish I could upvote this more.
Nobody has any data they can show you, because Oracle's EULA prohibits both running their software and sharing that data, you can only do one of those.

My experience is that Postgres has better performance than Oracle on much smaller machines. If you have very simple data, with very simple joins, and never deviate from the trivial "select columns from table join table using (foreign key)" you may have a different experience, because Oracle is just great on those.

Have you seen the pricing for Exadata racks? I ran the numbers a few months back and over 5 years, Oracle was 4x as expensive for my workloads. It's also easier to find AWS people than Oracle people.
You can buy a lot of SSD storage for the price of an Oracle licence.
have you tried both? the oracle eula prevents disclosing performance stats. pg allows user defined indexes to be added to kernel and integrated with optimizer, creating some pretty sophisticated optimization techniques. we have the text search index easily handling 20mil+ pdfs with the rum index from postgrespro http://github.com/postgrespro/rum.
What about pl/sql to pl/pgsql?
This wasn't too bad. The first one was the worst - figuring out the difference in the syntax. But after that it was fairly simple to convert all the rest to Postgres syntax. It took a few days to convert all of them in our system (about 500).
A lot of this sounds similar to MS SQL Server - the MERGE one sticks out, does Postgres not have MERGE?
Not yet, merge is broken though and postgres has an alternative that actually do handle races.
Now do MSSQL.. (Gets pen and notepad)
I would note that "foo IN (a, b, c)" can often be better done as "foo = ANY(ARRAY[a, b, c])" in Postgres - not least because you can shift to passing in an array of variable size without having to construct a special statement for each.

For sorting on the result of a function, consider using a subselect. "SELECT foo FROM (select fun(z) as foo from blaz) tmp order by 1".

If you have a DB migration challenge then take a look at www.compilerworks.com
The best part about this comment is that any errors or new best practices will automatically be updated with the entire knowledge of the world.
Wow.. someone could start an Oracle -> Postgres migration consulting business just from your comment.

I hope they name it SADL Consulting.

> replace rownum <= 1 with LIMIT 1

rownum is a pseudocolumn numbering entries, sorting the results will give you records in non increment rownum. On such queries rownum <= N will give you the record that was first in the results before sorting.

LIMIT will give you the first record after sorting.

So rownum != LIMIT and if you really want to implement the same logic you would need to use select row_number() over () as rownum in the ported query, put that into a subquery and filter with where rownum <= N in the outer level.

Example:

select * from (select row_number() over () as rownum, * from pg_class order by relname) as x where x.rownum < 5;

select * from pg_class order by relname LIMIT 5;

Will give two very different results.

The first one maps to oracle:

select * from pg_class where rownum < 5 order by relname;

The second one doesn't.

Our Oracle queries are written like:

select * from ( select * from pg_class order by relname ) where rownum <= 1

So select * from pg_class order by relname limit 1

works for us.

@irrational, you have my sympathy. But next time you hear of anybody wanting to torture themselves with such an endeavor you might want to save their soul by asking them to look at CompilerWorks.com. Full disclosure, I work at/for CompilerWorks and will be biased since they pay the bills. But as an ultimate compliment for the kind of work we do, one of our customers brought xz0r's comment about us to our attention.
It should be noted that the email that Steve Yegge made famous was:

1) The birth of the service oriented architecture as a standard at Amazon

2) Took place long before AWS was used by Amazon's commercial business, and most software systems were monolithic, requiring mainframe-like dedicated hardware.

3) Was inspired due to the epic spaghetti monster known as FC Software, whose entire non-architecture revolved around a massive Oracle database.

When Amazon hit the limits of scaling the Oracle databases with beefier hardware, they realized what a clusterfuck they had created. There were literally hundreds of applications, doing different things, but all connected to the oracle database. The oracle database functioned as a database, but also as a high throughput queue, as well as a message passing platform. At high loads, different applications were hitting the same rows so frequently that the transaction errors alone could bring down an entire fulfillment center.

And it should also be noted that it was the same FC Systems (the inspiration for the move towards SOA) that took 12 years to finally get rid of Oracle.

Moral of the story: you need competent software architects, and at the very least, a scalability plan. Also, fuck Oracle.

> The oracle database functioned as a database, but also as a high throughput queue, as well as a message passing platform. At high loads, different applications were hitting the same rows so frequently that the transaction errors alone could bring down an entire fulfillment center.

Isn't that how everyone uses Oracle? I've seen exactly the same complains from developers at banks. Although building software around big featureful RDBMSs in general encourages poor architectures and messy software.

I've seen the same architecture implemented in MSSQL and MySQL. It's pretty easy to paint yourself into a corner where your one database is doing all sorts of stupid things because you never sat down and identified the problem space in the larger context and moved to a wider configuration instead of simply using a table with short-lived rows as a queue. It's the same arguments about nails and hammers.
I dunno about that. Maybe this could be read as a success story. They built half-assed software quickly, scaled it to ridiculous levels, made billions of $, and finally had to replace it with something better. And now they are just fine.
Oracle should have been doing everything to keep them as a customer and push their databases through cloud offerings. They already push their software through resellers, sort of the same thing, just automatic
Do you know what is happening to their cloud offering?
From what I understand it's mainly being thrown at governments. Why do you ask?
What that article doesn’t capture is how many engineers absolutely burned out working against unreasonable deadlines and cut throat managers.
Any reason why Larry Ellison is still running the company?
How much did the actual migration effort cost them?