Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referential Integrity of Data Between Services

In SOA I have been confused about how a service that works with data from different databases, or different services even, can have referential integrity so that minimal data is duplicated across databases or services.

For example, you have a user table in some kind of authentication database and you want to reuse this user information in another database. You also want to enforce that user's record to exist in the authentication database. Let’s say you want to associate a user’s account in the authentication database with a news article in another database. How is that done? How would you do that using something like LDAP?

If the authentication information was contained in the same database, just a different table, then I could see how you could just use foreign keys to create an association between a news article and the user account.

I have been trying to search for answers about this concern but I must be using the wrong phrases because I am not coming up with anything useful.

like image 760
Walt Avatar asked Nov 13 '22 02:11

Walt


1 Answers

Some platforms allow foreign key constraints between databases, and some don't. If you need referential integrity between databases, you need to pick a platform that supports it. Normalization--a different issue--never says "move these columns to a different database."

In a multi-tenant database, you'd usually choose a different architecture. (You wouldn't normally put authentication for all users in one database, and the stuff they're authenticated to use in another.)

Browse questions tagged "multi-tenant"; that might be a term that will help you. MSDN has a fairly good bird's-eye view.

like image 168
Mike Sherrill 'Cat Recall' Avatar answered Dec 24 '22 05:12

Mike Sherrill 'Cat Recall'