Monthly Archives: October 2015

The other day I had another conversation about the business logic with one of our new managers.The good thing – since we were writing another paper, I’ve just reviewed my “split logic” principles and explained it to two of my other co-workers. So I was ready to explain it again.

But I keep wondering, why people are so scared to have “a business logic in the database”? At the end of the day we have multiple applications accessing one database. The database is “more permanent” than the app. The same data can’t be processed using “two different logics”. Isn’t it quite natural, that the business logic actually should be reflected in the database?

Another thing is the fear that¬†the code, which is stored in the db in form of ¬†functions, is somewhat different, that just “a code”. Which leads to another scare – that when something is stored in a database, it becomes a black box. I am not sure how to fight those phobias, but I am pretty sure that they do us a disservice, because those are phycological, not logical, and even more not technical reasons to reject the better performing solution… The more I think about it, the more I agree with the statement, that impedance mismatch os more cultural, than anything else…

Leave a comment

Filed under Systems

Changing a schema name

This is a really small thing, but I am so glad one of my co-workers has found it! So – did you know, that changing the schema name does not block anything?!

I did not know, and so I was very scared when we had a need to change the name of the schema “live” on production environment. Yes, we made sure the access path change was ready to go, and yes, fortunately there were no scripts, where the schema name would be explicitly set up. But still.

A couple of tables in this schema were frequently accessed by a number of applications, including more or less constant insert… so I was pretty much sure that we will introduce a chain of locks.

Imagine my surprise, when my co-worker proved me wrong! As an experiment, he started a pretty long-running insert into one of the tables of the schema X, and then while it was running, changes the schema name in another session to Y. And guess what? When this insert was finished (successfully!), the table was already in the schema Y! To be honest, I never tried to check this fact, I was assuming, it will never work this way, and was ready to all sorts of complications.

So nice to find out, that some things might be actually done way easier than you’ve planned!

Leave a comment

Filed under SQL