Hacker News new | ask | show | jobs
by princesse 1802 days ago
> But as things get more complicated, where does the business logic live? Maybe in the database as stored procedures? It's less crazy than it sounds.

I've worked with a bunch of systems like this before. One was just a collection of PHP scripts that would trigger SQL queries. Another one was all lambdas and Cron jobs on top of mssql stored procedures.

If you have a decent team and if you use version control as intensely as you would with code, I have no reason to believe this cannot work. To be fair, those condition are true regarding of tech and architecture.

What you cannot do easily though is pivot, hire, and scale. This is what bit those teams I worked with and why those specific systems are no longer around.

2 comments

I used to avoid things like stored procedures like the plague, because of my fear that crucial business logic would end up outside of version control.

These days I'm comfortable enough driving EVERY database change through a version controlled migration system (usually Django migrations) that I'm not concerned about this any more. It's not hard to enforce version controlled migrations for this kind of thing, provided you have a good migration system in place.

> One was just a collection of PHP scripts that would trigger SQL queries.

Yes, I've had to build a system like that (Java, but same diff.)

This model is popular in particular with banks, because they can split sensitive responsibilities in a way that makes sense to them.

It works fine if you have good communications between developers and DBAs. If you don't... well, I won't have to suggest finding another gig, you already want to.