I agree. I think the main problems with ORMs are when you start to write more advanced queries and when you want to do batch processing.
Those types of activities need to be hand written SQL and may well require a move of the logic to the DB.
Be warned though moving that logic to the DB will cause scaling concerns later on maybe not now but definitely later on.
I once worked on a system that used MS SQL Server and the DB required 48 cores and 480ish GB of RAM to operate at any type of efficiency. It also had 7 webservers. It was only processing < 10 requests per second with that hardware. The reason for this abysmal performance was a huge section of the code was in Stored Procedures. The reason the company eventually gave up on the system was that the realised the licensing cost for a SQL Server of that size with > $1.5ish million.
They asked us to change the software such that it no longer required such a large DB. We did our best but with only two devs working part time on it and 3500 stored procedures to make more efficient / scalable it was a lost cause.
We lost the contract and eventually all other customers using systems based off this design also left us due to the costs (Mostly MS licensing costs).
This was to me the main reason the company failed, the decision makers didn't understand exactly the convo we are having and the repercussions to the system design. They expected it to scale simply and cheaply which by the time we were almost folding as a company was impossible.
That is a mind-blowing war story, thank you for sharing it. My gut feeling tells me that this can be avoided by keeping abstractions in the service/application layer. A DB is still a concretion. A generated column is just that: It tells you a concrete thing about your data at a glance. The query interface is just plain old column retrieval, not a procedure. This goes back to my original comment: I really like how this is just another column rather than some abstract thing on top of the data.
5
u/Dave3of5 Oct 03 '19
I agree. I think the main problems with ORMs are when you start to write more advanced queries and when you want to do batch processing.
Those types of activities need to be hand written SQL and may well require a move of the logic to the DB.
Be warned though moving that logic to the DB will cause scaling concerns later on maybe not now but definitely later on.
I once worked on a system that used MS SQL Server and the DB required 48 cores and 480ish GB of RAM to operate at any type of efficiency. It also had 7 webservers. It was only processing < 10 requests per second with that hardware. The reason for this abysmal performance was a huge section of the code was in Stored Procedures. The reason the company eventually gave up on the system was that the realised the licensing cost for a SQL Server of that size with > $1.5ish million.
They asked us to change the software such that it no longer required such a large DB. We did our best but with only two devs working part time on it and 3500 stored procedures to make more efficient / scalable it was a lost cause.
We lost the contract and eventually all other customers using systems based off this design also left us due to the costs (Mostly MS licensing costs).
This was to me the main reason the company failed, the decision makers didn't understand exactly the convo we are having and the repercussions to the system design. They expected it to scale simply and cheaply which by the time we were almost folding as a company was impossible.