I am going to be building a pretty big web application, and I'm trying
to figure out the best way to store the data. This application will
have users, and users will own certain records from various tables.
I've come up with 3 possible solutions. Which one is best, and why?

Possible solutions for keeping users data private / secure, and site
running quickly.

1) Assign a "owner" id to every entry in database. This is the
simplest way, but it limits to a 1 to many relationship.

owners
------
id
name

items
-----
id
ownerId
title
description


2) Use a linking table - this would require 2x as many tables, as
every table that stores info thats owned by a person would also need a
linking table

owners
------
id
name

items
-----
id
title
description

owners_items
------------
id
ownerId
itemId


3) Use a master linking table - easy, but could be slow?

owners
------
id
name

items
-----
id
title
description

files
------
id
filename
description

ownership
----------
id
ownerId
table ('items' or 'things')
tableId (id of record in table)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"mysql" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/mysql
-~----------~----~----~----~------~----~------~--~---

Reply via email to