Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > MySQL and Privacy

MySQL and Privacy
Thread Tools
Junior Member
Join Date: Aug 2002
Status: Offline
Reply With Quote
May 22, 2003, 11:41 AM
 
I am creating a site that will host data for several independent clients. The data are sensitive and should not be viewed by the public or the other clients. I have this mostly worked out, but have a best practices question.

I have a table structure devised that will run the show. My current way of doing things is to make sure that each entry is linked to a client through a column (clientID). When pulling records from the database, the scripts I have created pull only the data for the clientID requesting the data.

Is this right/safe? Or should I replicate the table structure for each client to keep the data "walled off" from each other?

I am uncomfortable having the data for many different clients sharing the same set of tables.

How is this done in the "real world"?
Austin Jackson
EducatorsHandbook.com - because great decisions are based on great data.
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
May 22, 2003, 10:24 PM
 
Every client should have their own database. Not just their own tables, but their own database entirely. I assume MySQL can do this -- I know it's trivial in PostreSQL or Oracle.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
May 23, 2003, 04:30 AM
 
by hand:
Code:
CREATE DATABASE new_client; USE new_client; CREATE TABLE `info` ( `id` INT NOT NULL AUTO_INCREMENT , `blah1 VARCHAR (75 )NOT NULL , `blah2` VARCHAR (75 )NOT NULL , `blah3` VARCHAR (5 )NOT NULL , PRIMARY KEY (`id` ) );
...or just use phpMyAdmin
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Registered User
Join Date: Sep 2002
Location: New York City
Status: Offline
Reply With Quote
May 23, 2003, 08:47 AM
 
I have seen an enterprise solution where one database was used to store the data for many independent groups. This was a software package for HR to maintain salary information for many independent groups within one large organization. Each group could have used their own database (each one had enough data for their own db), but the architecture of the web app. was structured for one interface for everyone, with one primary db.

I'm not saying this is the best solution. Just wanted to mention that this was done by a major company, and the data was highly sensitive.

As long as you clearly seperate the data with business logic, then you could use one database.

I could think of 3 options:

1) use one db, same tables, seperation of data is done with sql statement
2) use one db, multiple tables, a different connection (with table priviledges) for each set of users...so group A would have UserA connection and could only read from tables assigned to group A, and so on for the other groups
3) use multiple databases

good luck.
     
Junior Member
Join Date: Aug 2002
Status: Offline
Reply With Quote
May 27, 2003, 09:51 PM
 
Thanks for the replies.

The reason I was interested in using one database was because of hosting considerations. Does anyone know a good hosting place that will allow multiple MySQL accounts and permission to create them?

Aj
Austin Jackson
EducatorsHandbook.com - because great decisions are based on great data.
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
May 28, 2003, 02:20 AM
 
Originally posted by austinjackson:
Does anyone know a good hosting place that will allow multiple MySQL accounts and permission to create them?
www.phpwebhosting.com
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:34 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2