Moving from MS SQL to PostgreSQL

Not really AWS specific, but the PostgreSQL subreddit is sparsely used.

Our business continues to grow and the costs of running our databases in MS SQL are getting rather high. After comparing MySQL and PostgreSQL, we think that PostgreSQL is the better fit for us. AWS offers the database migration service and we did a test migration just to see what it looked like. There were a lot of small errors that seemed easily correctable but it doesn’t handle stored procedures at all, of which we have about 50 of them.

I’ve done some googling to try and find some additional info on moving to Postgre but everything I’ve found seems to be light on the technical aspects of it. Is anyone aware of some good documentation that outlines the best way to move?


Related discussions:

Not quite what you asked, so feel free to ignore, but with only 50 stored procedures, maybe this is the time to consider engineering them out and putting the logic in the application(s).

Having business logic in both applications and the database is an ongoing maintenance headache. Stored procedures were one of those “good ideas at the time” that turn out to be technical debt, as you’re seeing.

They interfere with any future rearchitecture toward microservices, too.

To be honest, we had thought about that too. We’re trying not to do a complete rearchitecture at once.

Are you running in AWS now? If so, all/some?

You don’t have to Big Bang the rearchitecture. You could review the inputs leading to outputs and take the monolithic DB apart, associating each resulting part with the business logic that reads it and, perhaps separately, writes to it.

That lets each database part and associated logic develop independently, which allows faster iteration to include, perhaps, enhancements that would be helpful to the Line of Business customers.

You have to assess effort, resources, and risk, but you could start moving functions to the replacement, smaller apps along with their associated, smaller DB.

The replacement DBs could, possibly, be in Postgres, MySQL, or Aurora. This works because you don’t address the DBs directly except through applications.