When using a stand alone database as a membership provider, is it usual to then have an application specific users table in the database serving the application?
For example say I have an application that manages messages for a user. Normally I would have a user_messages table and reference the users table foreign key? However if I just use the id in the membership db I can not reference the messages by a user by foreign key.
Any pointers much appreciated
The issue here is enforcement of the foreign key. I don’t know of any DBMS which supports foreign keys which reference a table across a database link. And even if it were possible would it be desirable? Such an arrangement would mean that we couldn’t insert child records in our local database if the remote database is offline for any reason.
The normal workaround in such a scenario is replication, that is, maintaining a copy of the remote table in the local database. If we have a DBMS which supports remote Materialized Views this is can be a pretty straightforward implementation.