|
Our company (banking industry, over 500'000 credit cards (at the time I worked in that area, so now it could be doubled), bank accounts, ecc. Split between credit card, bank and hybrid (for both), but that's it so far in DB2 area. There are some ORACLE DBs used mainly internaly and some MS SQL DBs used for internal intranet web sites, but that's OK because totally unrelated.
The signature is in building process.. Please wait...
|
|
|
|
|
I kind of already faced a similar problem with SOA architectures.
If you split your business logic across several self-contained services sooner or latter you'll end up needing to show, on a grid or a report, data that comes from several services.
You shouldn't, even if it's possible, do joins across services databases as it breaks all the decoupling principle but when performance starts to be an issue... you know how the story goes from now on don't you?!
So the only reason I see here (even if it's not a good idea) is an attempt to implement this "SOA" concept but only at DB level (say... Service Oriented Databases? ), separating "services" by database.
Now I'm curious to know if I'm right!
|
|
|
|
|
I think you are right but hope you are wrong The key to SOA is to implement throughout the vertical, if all is not in SOA becomes an inhibitor and a PAIN.
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
I would put them in the same DB, but in different schemas.
|
|
|
|
|
Yep, MS's sample AdventureWorks does exactly this.
I don't understand the reasons, but on SQL Server how much penalty is there to having multiple databases?
|
|
|
|
|
If the databases are all on the same server instance, there is little performance impact. However if on different server instances, there is a big impact.
It complicates issues like disaster recovery - say if one of the databases fails over but the others don't. You also have to keep all the database permissions in synch which can become quite onerous. If a stored procedure accesses tables on 5 different databases it needs to preserve permissions on all of them. You also need to make sure the database-level settings are consistent. Backups need to be coordinated, so if a restore becomes necessary, you're using backups taken at the same time.
My issue is when you have related tables and someone splits them into multiple databases ... I can't see any benefit in the splitting and there are ongoing maintenance problems you introduce by doing it. You also have multiple points of failure. You may want to keep tables which are often JOIN'ed on different physical disks for performance, but another member mentioned that you can do this within the same database using FILEGROUPs.
|
|
|
|
|
"Best practice" or "Common pattern", people tend to confuse the 2... Best practice will have justification(s), common pattern probably won't. Best practice is best for specific reasons / conditions, and those will tell you if it applies to you. Try to get the detail of the best practice and you are likely to find out that it is more common pattern.
Something like this sounds more like common pattern than best practice, but I still don't see the advantage / point of doing it.
IT people (including me) tend to over complicate things, this sounds like one of those.
____________________________________________________________
Be brave little warrior, be VERY brave
|
|
|
|
|
Are they putting the databases on different physical drives? If so, they might not know about filegroups[^], which would allow them to put different tables from the same database on different drives.
Splitting related tables between different databases is a terrible idea. Apart from anything else, you can't have DRI between the tables. You end up using triggers - or worse, external application code - to enforce referential integrity.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I've seen a system spec written up that required the developer to use SMO to create user-specific tables for each new user in a SQL database, e.g.
[dbo].[JohnSmith_Orders]
[dbo].[JohnSmith_Profile]
[dbo].[JohnSmith_Settings]
I think you get the idea. The reasoning behind it?
"Each user gets their own sub-schema so that no user data leaks into another user"
Surely the best way of preventing this would be to have a separate app for each user?
There are people out there who should not be trusted with crayons. stuff like this is proof that yes, you really can get your dick caught in a ceiling fan. you just need to try hard enough.
|
|
|
|
|
I've seen one worse, an events management system that created a new database for each event.
Fortunately, the only involvement I had in the system was recommending it be replaced. I feel sorry for the guys that were trying to report across all the events - especially as the SQL server was having to constantly unload databases to load the new ones...
|
|
|
|
|
Another magnificent specimen for my scrapbook of SQL horrors!!
Why create new rows for an event when you can create a whole new database?
|
|
|
|
|
Yikes!! The wrongness of that approach is almost awe-inspiring!
I'll add it to my scrapbook of SQL horrors.
|
|
|
|
|
I'm re-writing a legacy ASP application. There's an expensive call to an external webservice and a database to determine a calculated setting specific to the person logged in.
On the first page this calculation is done and the result is stored in a session variable.
On every subsequent page the session variable is ignore, the value is recalculated and then stored in the session variable again!
Some days I don't know if to laugh or cry.
|
|
|
|
|
Sometimes, you just want to go into a code review with a baseball bat and a spiked glove...
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
Cool, who ever wrote the code invented the write-only variable.. What shall we call it? "Wrariable"?
|
|
|
|
|
That kind of innovation must be why this guy is now a manager. My only solace in that is that he's no longer writing "code".
|
|
|
|
|
He's a manager now? Well, that explains a lot. I know quite some managers who also write (or wrote) code, and that was among the most horrible code I've ever seen. Think you still might find examples here in TWATW.
|
|
|
|
|
imagiro wrote: He's a manager now? Well, that explains a lot. I know quite some managers who also write (or wrote) code, and that was among the most horrible code I've ever seen. Think you still might find examples here in TWATW. |
Remember the old saying: "Those that can't do, manage!"
Update: LOL ... Isfeasachme, whoever that is, just posted a flaming reply to my message. Listen sport, I have been writing code probably since you were born, enough with the sanctimony. I've seen plenty of inept management in my days and very frequently they were coder's who couldn't hack it (no pun intended). As sharp as you are, you couldn't refrain from a flame which was copied to my inbox before you removed same. Chill out man!
|
|
|
|
|
AnalogNerd wrote: My only solace in that is that he's no longer writing "code". I had the same feelings about my former Bitch Supervisor From Helltm.
She barely understood coding concepts and management recognized that she knew enough to be dangerous and she was good at cracking the whip, so she was promoted to supervisor.
She was terribly insecure and terrified that I wanted her job (I didn't) and compensated by being a total control freak.
Those of us on her team have hours of stories we could tell about her incompetence.
I always said that if her manager had ever come to an abrupt halt, they'd need an emergency room proctologist to save her.
Instead she was eventually promoted to be the assistant to the new technology vice-president.
However after the company realized he was only a hot bag of buzzwords and equally incompetent, he was given the boot and she was out the door shortly after.
Psychosis at 10
Film at 11
Those who do not remember the past, are doomed to repeat it.
Those who do not remember the past, cannot build upon it.
|
|
|
|
|
There are millions of write only variables in code is use daily. I bet you have some in your own code right now.
For the database problem, someone intended to use the variable, but either forgot it was there or it was unknown to next programmer in line.
|
|
|
|
|
Think the write only variable is probably related to 'Planck's variable constant' - something that that we used to make physics experiments work during school labs!
|
|
|
|
|
Yeah, I work with a guy who puts whole serialized datasets in session variables.
And I can't even complain about it to the big boss, because they are kinda buddies.
modified 20-Oct-19 21:02pm.
|
|
|
|
|
You never know, maybe the external system changed its mind after the first call to it...
|
|
|
|
|
I am relatively new to this sort of thing and I currently use a different language but reading this thread makes me wonder if there is an issue with using session variables?
I am upgrading a program that currently uses POST method to transfer small portions of data between screens and I want to reduce the number of screens and to do this I need to transfer larger data sets. Using Session variables seem like a better idea since they are more persistent and are there through the whole session.
For the original poster it would seem that it would be easy to check the session variable to see if it exists and if it doesn't then calculate it otherwise use the session variable and continue? Seems like a simple bug to fix to me. But I only have experience with PHP with this at this point and am still learning. I have not even attempted to learn ASP.
|
|
|
|
|
What you say is what should have been done. The code should check the session variable, if it is null then go to the database and 3rd party API and calculate the value needed, and store it in the session variable for later use. In this way it's basically using the session variable for caching a value that is expensive to calculate and doesn't change often.
I posted this because what the person who actually wrote this did was kind of a face-palm moment. They write the value into the session variable and then never read from the session variable again. Every time this value was needed they calculated it, then wrote the calculated value into the session variable only to never retreive it and do anything with it.
|
|
|
|