I was just talking with a vendor on the phone, and we got to talking about new versions of DBs. Somehow, we really got on a tear and I wanted to share it with you.
And this is really one of the biggest areas where I think the DB industry really needs improvement. The issue is how to get devs to start thinking in modern terms. There are actually two issues surrounding this issue, maybe more, but let me get started and we'll see what shakes out.
First of all, there's this campaign of best practices that's been strictly adhered to for years without question. I actually blogged about this recently. So this is another case where someone reads a best practice and takes it to heart everywhere.
So the best practice in this case is that you should always write code as ANSI compliant as possible to make it easier to port to other platforms. And while that follows a certain logic, what they never tell you is the other side of that debate. And the other side is writing to maximize resources and efficiency on each system. That's really the issue, isn't it? Because when you write an application the same on every platform, you can't take advantage of optimizations on any of them.
A really good example of this is concurrency. Let's look at a simple app that might be written to be cross-platform for Oracle and MSSQL. Oracle and MSSQL both have roughly the same locking capabilities, but they have different defaults. So out of the box, Oracle can have better concurrency if you're using strict ANSI-compliant code because it uses a looser locking mechanism by default. MSSQL however can achieve the same level of concurrency as Oracle, you just have to flag the code properly.
However, the reverse is also true. If you don't want loose locks out of the box, then MSSQL will perform better for you while you'll have to make changes to Oracle. So it really just boils down to what you want. So in a simple concurrency situation like this, you’ve already got differences that will make or break your app in major ways.
And I'll go ahead and say that most of the time when you put code on one of these platforms that doesn’t perform well, you'll end up making the necessary changes so that the app does what it's supposed to do. Because I've written about this before -- the business doesn’t care about your ANSI principles. They want the app to perform.
And complete ANSI-compliance isn't really what the best practice means anyway. What it means is as compliant as you can make it to reduce the coding effort needed to port to another platform. Sometimes it’s not even possible to make the 100 percent compliant. Different platforms have different functions, data types, etc. So they’re going to be different anyway.