Individual schema Vs Single schema for hosted environment
Ravikanth Beevanapalli, December 01, 2014 - 11:56 pm UTC
Hi Tom,
What is your opinion over spawning a unique schema for each customer Vs client_id approach? It would be good for data isolation but only thing i could think of is software maintenance. For example, we have to install our product on each of the instances and any change in structure or code should be applied to all the instances.
Thanks.
December 02, 2014 - 12:11 pm UTC
In version 12c - multi-tenant will be the way to go.
Prior to that, I would follow the path of single instance, single schema, and a view that incorporates a client_id in the predicate. You can use partitioning for big customers (they get their own list partition) when necessary.
Multiple instances is problematic to manage (upgrade, patch, upgrade your app, making sure instance 1 doesn't consume all of the resources making instances 2-100 dead in the water and so on
Individual schema Vs Single schema for hosted environment
Ravikanth Beevanapalli, December 02, 2014 - 5:37 pm UTC
Thanks Tom for your response. Good to see you back.
I agree 12c would be way to go. I got very good insight in Oracle Open World. But we are still on 11gR2 and might take a while to migrate. The design that has been proposed in our company is individual USER/SCHEMA per client in the same instance as apposed to separate instance for each client. Do you see any issue with this method?
Thanks!
December 02, 2014 - 5:44 pm UTC
big time.
Say you have 200 clients. Your application logs in as user1, user2, userN.
Your application issues "select * from t", but that is really "select from userN.t", but in the shared pool all we see is "select * from t"
so, your 200 clients run the application. They all think they are parsing the same sql but they are not. the shared pool will become flooded with cursors that look the same but are different. It'll take longer and longer to parse as we have a longer and longer list to look through. Additionally - we'll only cache about 100 child cursors per sql statement so you'll be hard parsing like mad too (client 1's sql gets aged out and we'll have to parse it again - kicking out client 2's sql - who will have to parse it again and so on)
You'd want to make sure your application issues "select * from USER1.t", not "select * from t" to ensure they are all using distinct sql.
multi-tenant will not make you do that. single instance, one database will.
Individual schema Vs Single schema for hosted environment
Ravikanth Beevanapalli, December 02, 2014 - 5:48 pm UTC
Thanks Tom, very helpful!