Re: Thoughts on "Love Your Database" - Mailing list pgsql-general

From Will McCormick
Subject Re: Thoughts on "Love Your Database"
Date
Msg-id CA+jgkY6zjtUBGnzBmet17QE4RP01ijO6FYtTdb5C25Sopv=zCw@mail.gmail.com
Whole thread Raw
In response to Re: Thoughts on "Love Your Database"  (Szymon Lipiński <mabewlun@gmail.com>)
Responses Re: Thoughts on "Love Your Database"
List pgsql-general
I agree that it's not like turning on the light switch. And I'm not implying there isn't a logic layer between the database and the application. Based off my past experiences I would likely not put business logic in the database unless it was a critical for performance. This does not make it portable and does the performance of my product require it? It really comes down to the application there is not one big paint brush. We have all be around and get this. I would not likely design a solution that had the database and the application layers both containing the business logic. I have seen this and the unexpected behavior as assumptions are made on both ends of that spectrum. I like to keep it simple where I can. This all being said I think database minded folks should own DAO's. I think if your a database guy and you don't own the DAO's you are missing an opportunity to really make a difference and get more aligned with your development staff. Doesn't matter what code base DAO's are in it's a repetitive pattern that any database person can pick up. 

On Wed, May 4, 2016 at 12:29 PM, Szymon Lipiński <mabewlun@gmail.com> wrote:


On 4 May 2016 at 18:14, Will McCormick <wmccormick@gmail.com> wrote:
I agree it's typically political but so are most things business. Examples:  Companies buy other companies - You are using a competitors data store and want to replace it.  Company needs to compete with competitors and wants to reduce cost ... these are not technical requirements and it's certainly not vapor ideology. I have only worked for startups and have seen this happen at every company i have worked for, yes it is political but yes it happens. Smaller companies are more susceptible to it. 

The reality is somewhere in the middle as it often is. My point is you don't have to replace a million lines of code if you plan upfront. If you don't .. you do.


On Wed, May 4, 2016 at 11:29 AM, Uwe Schroeder <uwe@oss4u.com> wrote:

On Wed, May 04, 2016 11:05:25 AM Will McCormick wrote:

A reason to consider may be portability. What happens if I want to let my customer chose their data store or I just don't want to put all my eggs in one basket.Technically there are truths but you cannot ignore the business side either. If a we can exceed our performance requirements and keep things generic/portable this is the best of both worlds.I think this is the main reason people separate the business logic from the database. How many of you have ported databases between platforms? Or had multiple types of data stores in the same company?

I have been waiting for the portability argument for the last 20+ posts :-) Everyone who did any type of consulting/working in this field knows that latest the second argument from management is “portability”. I have yet to see anyone who really needed to move to a different database. If they did it usually is a political issue and not a technical one (uhh, we hired this new operations manager and MS SQL is so much better than postgresql …) Unless you develop a generic software to be sold to many clients, the choice of data storage is rarely a real concern unless someone who feels the urge to be important starts throwing words he read in a magazine at management. None of my clients ever questioned the database. They either had one which they wanted to use (i.e. they had a big iron IBM with DB2 on it plus a DBA who knew what he was doing) or they didn't care as long as it worked as expected and came with a maintenance contract of sorts.

If you're developing a web application, the least concern is portability (you're not going to replace the million lines of PHP either). The biggest concern should lie with data integrity and API's that protect your data and business logic so you can hire that cheap app development company from overseas your boss recommended (based on a spam email) without running the risk of compromising everything.

Uwe



I'm not sure that when a company buys another company they can just migrate the other database without any logic layer. The data is usually useless without the business layer which tells how to merge all the parts together to have a simple answer to a question like "do we have this in stock". And for such a migration that's not too important if we have the logic in database, or in some other layer. Of course it is always simpler to migrate a database treated like a CSV file, where all the logic (including constraints) is in an external application. But do we really want that?

On the other hand, when I was trying to store all my logic in a database, there was just one thing that made me hate it. Testing. Testing the procedures inside the database was not easy, not funny, and too much time consuming. 

--
    regards Szymon Lipiński

pgsql-general by date:

Previous
From: Paul Jungwirth
Date:
Subject: Re: Thoughts on "Love Your Database"
Next
From: Szymon Lipiński
Date:
Subject: Re: Thoughts on "Love Your Database"