I'm working on a software that uses JSF(2.1)/JPA(Hibernate)/Spring/Jboss7.1. The user will have many clients, and their data wont be used together.
So, I have these tables:
Company
ID | Name
1 | Foo
2 | Bar
Products
ID | Company_ID | Name
1 | 1 | Doll 01
2 | 1 | Doll 02
3 | 2 | Candy
When working on company 1, the user doesn't need the data from Company 2.
Today, all I have to do is use a where clause.
However the DBA thinks we might have problems when the data get really high, and suggests we should use One scheme for each company.
So, the above structure would be something like this:
GeneralScheme.Company
ID | Name
1 | Foo
2 | Bar
Company1.Products Company2.Products
ID | Name ID | Name
1 | Doll 01 3 | Candy
2 | Doll 02
He says, this way would be easier to make specifics backups, and performance could be better as well. But, is it possible to work this way on JPA? Changing the scheme at runtime? And creating new schemes as well since the user might add others companies?
Thanks.