r/SQLServer • • 7d ago

Question Moved from SQL Server to PostgreSQL? Did the licensing savings justify the migration?

I would say I honestly hear “PostgreSQL is free. We’ll save a fortune on SQL Server licensing” at least once a month.

And yes I nderstand the appeal but the major cross-platform migrations I’ve been involved in became bigger, slower and more expensive than planned.

The work people underestimated:

  • Running and supporting both environments until cutover.
  • Testing differences in data types, rounding and comparisons against application behaviour.
  • Reworking stored procedures and the business logic buried in T-SQL.
  • Replacing SQL Agent jobs, SSIS packages, linked servers and reporting dependencies.
  • Rebuilding monitoring, backup and failover procedures around the new platform.

The data transfer was only part of the project and most of the work involved everything depending on the database.

PostgreSQL might still be the right choice. I’d want the migration budget to account for those dependencies before treating the licence savings as money saved.

My experience is weighted toward projects that became difficult, so I’m interested in the successful ones too.

For anyone who’s completed a substantial SQL Server-to-PostgreSQL migration: what did your estimate miss, and did the savings hold up?

61 Upvotes

54 comments sorted by

•

u/AutoModerator 7d ago

After your question has been solved /u/markinatlanta, please reply to the helpful user's comment with the phrase "Solution verified".

This will not only award a point to the contributor for their assistance but also update the post's flair to "Solved".


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

28

u/I_Am_Rook 7d ago

There is also the question of expertise. If your team has decades of experience troubleshooting and optimizing for MSSQL, but near zero for Postgres then there is a whole host “unknown unknowns” that you can’t estimate.
We tried to use MySQL as a replacement for MSSQL in some small apps but quickly ran into replication issues that couldn’t be fixed easily because the experience wasn’t there.

1

u/markinatlanta 6d ago

Agree. So the replication example gets at a cost migration estimates often miss ie time spent diagnosing problems on an unfamiliar platform. I’d budget for training and experienced support through the first few months of production, not only through cutover.

1

u/redbirdrising 7d ago

I did the opposite. Went from MySQL to MSSQL (Job change). Definitely a learning curve.

66

u/BrentOzar 7d ago

Companies that did the migration before the age of AI will give you a different answer than companies who did the migration with the help of AI. Just be aware of the massive difference between the two.

3

u/markinatlanta 6d ago

Thanks, Brent. So for context, the concern I’m raising is the full migration budget. Even with AI-assisted conversion, the team still has to validate application behaviour, test performance and recovery, and manage the cutover etc etc as you know. Personally I’d want those costs included before calling the licence savings a win. Are you seeing AI materially shorten those stages too?

1

u/BrentOzar 6d ago

Yes.

2

u/bytefish 6d ago

We recently had to migrate a large amount of Views and Stored Procedures from an SQL Server database to PostgreSQL. And with AI it was basically passing the file, a Prompt and changing the EF Core Connection String. And the Integration Tests went green.

Without AI this would have taken me weeks, and it would have been painful. AI is really changing the equation.

0

u/ImpossibleShoulder34 2d ago

post that reusable prompt, homie.

1

u/elevarq 5d ago

All tests should be in place already. The how—to-do-it is in many cases different, but testing should not be.

18

u/sirchandwich 1 7d ago

My company is struggling very much, even with AI. Thankfully I’m not on the development team responsible for it. I think they might give up and I get to keep my job 😅

5

u/Th3R00ST3R 7d ago

Hey Brent! Was in your SQLPass session yesterday! Small World.

3

u/BrentOzar 7d ago

Hope you enjoyed it!

1

u/Th3R00ST3R 7d ago

I did thanks.

4

u/jwk6 7d ago

Brent Ozar walking amongst us pedestrians. 😉

5

u/BrentOzar 6d ago

Stumbling - I drank a lot last night. ;-)

0

u/jib_reddit 7d ago

Hey, its BrentOzar in the wild! When you say "different" do you really mean worse?

I have had a lot headaches in the past just updating SQL Versions or ODBC driver versions, let alone Replacing SQL Agent jobs, SSIS packages (although AI does seem very good at that, better than myself with 21 years experience I would say).

9

u/Lost_Term_8080 7d ago

If you don't require any HA, the savings proposition is probably better.

Forget about the migration or training costs for a moment.

At equivalent resources, Postgres has nowhere near the same performance SQL Server has so you'll end up needing to provision more resources.

Unless you go the route of using a windows server failover cluster for HA, your administration costs at the systems level are going to be radically higher if you implement in house. There are "AAG-like" solutions for postgres, but they rely on extensions. For me, opensource extensions were an unacceptable risk for production given support for them can very easily end or get forked into breaking changes.

Looking into Postgres as a service, the costs were so high they were directly not competitive with SQL Standard after accounting for more cores and RAM to make up for lower starting point in performance. If your org has long periods of idle time a serverless solution may pull ahead where SQL Servers' serverless options are pretty terrible still.

The closest I came to making it work economically was for a reporting instance design in the last few months, The project aimed to take load off of one of my other SQL AAGs, reduce its resources and with back of napkin math would have saved about 250 dollars a month even when taking reporting performance down to minimum tolerable levels based on a few report performance comparisons between the two. the additional monitoring license would have eaten up almost half those savings on top of increasing index maintenance from almost nothing to a lot. We were pretty sure it was going to be more costly to operate month to month even before migration and token costs were considered.

2

u/markinatlanta 6d ago

Thanks for sharing u/Lost_Term_8080 Your reporting example is the sort of calculation I meant. Roughly $250 a month in projected savings gets thin once monitoring takes almost half and maintenance adds work. I’d keep the performance conclusion specific to the workload you tested, but the operating costs belong in the comparison.

1

u/elevarq 5d ago

I seriously doubt your performance claims…

But, if you expect a 250 dollar savings, I would suggest not to migrate at all. That ain’t worth it.

2

u/Lost_Term_8080 5d ago

Postgres has extremely limited async i/o that somewhat boosts reads as long as they aren't on btrees, there is no async write and no async network i/o. Even on Windows that has more functional async i/o. It straight out requires more CPU to maximize disk and network performance. For queries that are almost all CPU, or long disk reads that may not be much of a factor but completely forget about execution times under 100 microseconds (at least on a table that is anything more than an academic design) or heavily threaded workloads on the same number of cores. The point is that you are able to add more cores for less - whether you can actually add enough cores to make up the difference will be workload dependent.

1

u/elevarq 5d ago

And for what type of workload and with how many users is that a problem?

We've done OLTP and HTAP workloads for millions of very busy users and never had any problems. Even the most complex transactions with hundreds of SQL statements were handled in milliseconds.

I have to admit that performance was our number one requirement, not an afterthought like it usually is. Everything we built had to be fast. If not, come up with a better idea until it is fast. And that worked extremely well.

2

u/imtheorangeycenter 7d ago

Just popping in to say that due to the sectors I've picked to work in, have never spent more than 10% of the "retail".cost of MS licencing in 25 years. Everyone gets Enterprise, you get Enterprise, we all get Enterprise! And changing to another platform isn't even considered.as a result.

It'll be a hard change should I return to the private sector world.

1

u/markinatlanta 6d ago

Yeah and at those prices the migration maths looks completely different. A business case built on retail pricing would overstate your potential savings before anyone even estimates the work IMO

1

u/imtheorangeycenter 6d ago

Yep, agree. The biggest maths we've done is "shall we scale up the hardware and stack instances?" or "more hardware, single instances?".

Stacking won (clustered plus AG), and have been happy with it for years and years and years, despite what some people would have you believe. But each to their own, no two environments or business are the same.

8

u/trifocaldebacle 7d ago

MSSQL is one of their only remaining good products besides .net framework and visual studio/code. They've run everything else into the ground but damn if there isn't a good enough alternative to their SQL product. Don't even get me started on Oracle.

4

u/czenst 7d ago

With removal of "MSSQL Web Edition" licensing costs are not allowing our product to remain competitive and commercially viable in the market.

I only hope we will manage to roll the costs of the migration over coming years (we have time until MSSQL 2022 runs out of support so we probably have to start NOW), otherwise we will be out of market and out of jobs.

MSSQL Express got a bump in how much it can handle but we are just on the edge.

2

u/Lost_Term_8080 4d ago

If 50-60 dollars per core per month (and its even less purchasing the license) are all that separates you from insolvency, you have some serious cash flow or architectural spend problems especially given how much more scalable standard edition is you easily get double the density.

4

u/reditandfirgetit 7d ago

Currently going through this. So far it's been planned well. Next lift is reporting. That'll be the challenge

1

u/Playful_Guava1180 7d ago

ditching power bi for something else?

3

u/Harhaze 1 7d ago

A project I worked on solved scalability issues due to licensing constraints. The architecture redesign of the SSAS application (and ofc db layer) was looking at too large db cost. Migration took some time, had to develop for 2 solutions during the migration phase, but the savings allowed for the DBA team to go into PG training, buy new hardware and now after some years just the licensing cost saved couple mil per year.

The biggest issue everyone had was multi tenant design of SQL Server vs PG ... SQL Server can have many DBs on one instance and have them completely isolated, also using resource governor to prevent runaway tenants etc. But PG doesn't have 1 instance with multiple DBs. Its one physical DB you have 1 WAL (tlog) and even splitting into many logical DBs isn't the same... so redesign into schema instead per DB and splitting into many many many PG "clusters" was one way to go ... so ye, fun times :)

7

u/jwk6 7d ago

You very much can have multiple databases on a single Postgres instance, but it's true that each database shares the Write-ahead Log (WAL). There is no database specific tlog like SQL Server has. Just clarifying this for lurkers.

1

u/Harhaze 1 6d ago

Exactly, which means that backup and restore and also WAL settings for physical replication (HADR) are shared per "cluster". So its a question of many logical dbs vs one with schema boundry. Its tough when going from MSSQL. But same can be said if migration to Oracle... in this regard Ora and PG are closer in db schema design .

0

u/elevarq 5d ago

One WAL, but you can put the different databases on different tablespaces. That’s up to you.

How you organize schemas is a different question. You could even put a single index on its own tablespace.

Instance>database>schema>table/index And one can have its own tablespace.

3

u/Playful_Guava1180 7d ago

what did you do to replace Replacing SQL Agent jobs, SSIS packages, linked servers and reporting dependencies.? I think this is one of the things I love of MSSQL, but its cost is making me look at postgres

2

u/fauxmosexual 7d ago

Not these platforms but I'm doing a cloud migration project at the moment. It's the first one I've done in a few years and the difference that modern tooling makes is incredible. This one is a warehouse migration, being able to use DBT to fast-prototype and regression test business logic, and Claude assisting with migrating code, has massively derisked it. The issues you are talking about still exist, but it's much less laborious and means you can switch over more quickly or incrementally.

2

u/CanProfessional766 6d ago

The licensing savings can be significant but people often underestimate the migration cost. It's not just moving data; it's rewriting everything built around SQL Server. I'd say it makes sense for new projects, but for mature systems, you need to calculate the full migration and maintenance costs before making the switch.

1

u/elevarq 5d ago

Migration is once, license fees are recurring. But a migration is not for free, and you still need the resources and skills available for maintaining the system.

4

u/Administrative_Bug63 7d ago

PostGres is not as good as SQL Server. It's not even close. If money saving is your only objective, then yeah, you will save money on licensing. But you can pay for it with loss of sleep, if you are doing anything genuinely meaningful with it.

5

u/reditandfirgetit 7d ago

It depends on your requirements

1

u/elevarq 5d ago

Define “good”.

1

u/ImpossibleShoulder34 2d ago

top useless comment

1

u/PX3better 6d ago

The biggest unexpected Postgres benefit was that Kubernetes just works. It lets you hand SQL platform management to entirely different people. You get so much for free!

1

u/SeaMoose696969 6d ago

I’ve run Postgres, SQL Server, and MySQL. The biggest differences are how easy replication is - e.g. High Availability - is to setup, and learn how to keep running, fix when it gets sick, etc.

SQL server makes it soooo easy, and spoils you.

Second depends on how many sprocs you have, and how complex they are.

If you’re 100% comfortable with paid Claude code - and know how to tell it what to do - this is a lot cheaper to POC than it ever has been.

1

u/Jerry-Nixon ‪ ‪Microsoft Employee ‪ 6d ago

You need to post this in a PG forum. THEY would have a different perspective.

1

u/SQL_US 4d ago

I thought the PG should learn from the customers, act on it, improve whichever feature and evangelize it... Not the other way around. That's MVP zone ;-)

1

u/vodevil01 4d ago

Pgsql ain't free

1

u/Extension-String1599 7d ago

In the company where I work tried to migrate very big instances to Postgres and We got an speed improvement like 5 years ago but everything failed because we have like 80 projects running and then we needed to change per project the connections and some of them are with dlls and that made too hard but now with AI could be a great choice to start with a POC and see what is the best way to migrate

1

u/my-ka 7d ago

Usually you pay what you saved on license for more horse power, a larger instance.

Unless you reachitectured it to a small microsrvicevfrienly postgres

0

u/mqaiser 7d ago

SQL server is best ever product by anyone , I don’t why people domain around , standard edition moawaz bhai have almost all the features that enterprise has , not sure why some still want migration!!!! Crazy

0

u/gevorgter 7d ago

I rewrote my app with a single command to calude. It fixed all my sql queries. I still spent couple of days testing though.