-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Having a seperate schema per user
PostPosted: Mon Nov 03, 2008 1:22 pm 
Newbie

Joined: Mon Nov 03, 2008 1:08 pm
Posts: 1
Location: UK
Hi,

I'm new to Hibernate and a somewhat novice at databases too. What I am doing is developing an application where I will have multiple users and for most tables not much sharing.

To give some context, it is an application for the legal industry so I will have a table for a client(name, address, etc.), a table for case(case id, name, etc.). Now for all users of the application, they have their own clients, cases, etc.

Given that there is not much sharing of data, I thought I'd create a separate schema per user. How would this be done at runtime as the schema is specified in the hibernate.cfg.xml file or in the annotated class e.g. @Table (name="user", schema="myapp"). In fact is this even good design?

Thanks,
fb


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 03, 2008 1:56 pm 
Beginner
Beginner

Joined: Wed Sep 24, 2008 5:44 pm
Posts: 34
Hmmm, this is very unusual. I think I would recommend not using a schema per user. Having so many schemas is going to be terrifically difficult to manage and would probably be a huge burden to maintain. Especially for someone new to the hibernate/database world.

I wouldn't really use the fact that there isn't much sharing of data to prompt you to use a separate schema per user. Tables often don't share information between rows. Given your description I think a simple database with a single schema with a table structure like:

User
User_Client
Client
Client_Case
Case

would be a good way to lay out your application.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.