4 ms·
I mean, good luck when you are later porting to another DB system.
by tomrod 5y ago
I mean, good luck when you are later porting to another DB system.
- joppy 5y agoHow big of a concern is this? Nowhere I’ve ever worked has been concerned with the ability to swap the database for a completely different one, in the same way they are not concerned with the ability to swap whatever programming language is being used for a different one.
- MattGaiser 5y agoI worked for an organization that used Oracle for relatively trivial applications. The difficulty of switching to MySQL and then later to Postgres convinced them to use an ORM going forward. Basically if your app might last 20 years (this one went online when I was 4) it might be a consideration.
- setr 5y agoIME if you didn’t use the DB -specific features, migration is painful, but not that much so. If you did use the DB specific features, you’re screwed regardless of an ORM. NB: I work for a DB migration firm, specializing in legacy->modern — where our usual customer has thousands of SP’s that have to be migrated and an ORM would have saved you maybe 5% of the effort; so my experience is biased towards that level of difficulty.
- sumtechguy 5y agoTSQL and PSQL ideas of a stored procedure are not really the same. If your SQL is mostly bound columns or some sort of ORM only then you can get lucky and just play the data type matching game. But most of the ones I have ever had to port was playing the 'rewrite these 300 stored procs again' game. They usually ended up in some sort of stored procedure for one of a few reasons 'they only knew how to do that', performance, that is what the senior guy wants.
- martijndeh 5y agoIn a type-safe environment I think you should just be able to switch your pur sang SQL builder to another dialect. Because of the type-safety you’ll be able to find incompatibilities at compile time which makes the migration easy enough (ignoring data migration). This avoids creating a weird ad hoc SQL dialect trying to fit all the others in a single API. I work on Mammoth which is a pur sang Postgres query builder, see https://github.com/Ff00ff/mammoth https://github.com/Ff00ff/mammoth.
- setr 5y agoHow often does one even migrate DB’s? I’ve always seen the advice, but other than an explicit goal of supporting SQLite + Postgres simultaneously, I’ve never actually ending up needing to move. And given that RDBMS’s tend to do have roughly similar performance profiles, except when they have radically different profiles (e.g. switching from row to columnar, or unique optimizations eg GIS in postgres), there’s not much incentive to be moving around — unless you hit the end of the envelope, at which point you’re probably looking at a re-design anyways if you’re already looking at re-architecting it. And if you’re switching to something with a different performance profile, you’re going to be rewriting those queries anyways. Personally I stopped considering databases as “standardized” or swappable — and using an ORM for hot swapping purposes I think might be as ridiculous as using a library for unifying web server frameworks (you can definitely do it… but your common denominator is fairly pathetic). The only scenario I’ve seen where one changes DB with an explicit goal of minor code changes is migrating from some legacy DB on some ancient version to something more modern (especially today, targeting a DB the cloud can auto-manage), where your ORM DB flexibility won’t help you whatsoever
- zimpenfish 5y ago> How often does one even migrate DB’s? I've never seen it happen on a production system in ~20 years. Might happen at the current gig but that's more down to "Firebase is junk for this job and we're rewriting everything anyway, might as well consider switching DB too".
- tomrod 5y agoLucky! I've done a few.
- mind-blight 5y agoI've seen it happen once. Back in 2011, the company I was working for decided to switch all of their apps from MySQL to postgres. We had built everything in Django, so the transition was a lot less painful than it could have been, but it definitely wasn't free.
- BiteCode_dev 5y ago
- thornygreb 5y agoDone it once..in 20+ years accompanied by an entire re-write, so not often enough to care about this at all.
- dwohnitmok 5y agoOver time I've come to see DB-independence as a benefit that is seldom realized and therefore not a strong point in favor of a given system. Data is generally far more valuable than application code and often times your database will far outlive your application code (and sometimes even your choice of programming language). Moreover if you're using DB-specific features rather than generic SQL, there's usually a strong business need driving it that would cause DB-specific coupling even in a supposedly DB-independent ORM.
- jcpst 5y ago> Data is generally far more valuable than application code and often times your database will far outlive your application code (and sometimes even your choice of programming language). I agree with this. At my current company, we have stored procedures that are over 30 years old still running. The original application code was VB6, then VB.NET, and now there are C# NET5 services. There’s also all kinds of other document stores, but that old SQL DB isn’t going away any time soon.
- _moof 5y agoIn my experience this is an overrated concern. And when it does happen, it's usually accompanied by a rewrite anyway.
- tomrod 5y agoMid and low tail risk applications, certainly. Some applications have regulatory requirements associated with them, especially retention, or otherwise serve critical needs areas.
- _moof 5y agoMy experience includes government, consumer unicorns, and new vehicle development in aerospace. I'm familiar with highly regulated and exponential-growth settings.
- tomrod 5y agoMe too! And my experience notes that it is exactly-rated, versus under-rated.
- refactor_master 5y ago> Some applications have regulatory requirements associated with them, especially retention, or otherwise serve critical needs areas. Which is why the choice ends up between “keep a legacy system older than the average age in the IT industry” and “take it apart and start over”.
- yobbo 5y agoRDBMs have proved to have far more staying power than random ORMs for various fashion languages.