java - How to implement the "Shared database, separate schema" multi-tenant strategy -


Through a different schema approach to shared databases I have to enable a web application multi-tenant application Java / J2EE and Oracle Made using 10g.

I need to have multiple schemas, a single appessor to use a shared database with one schema per customer.

What is the best implementation approach to achieving this?

>

  • What should be done at the middle level (app-server) level?
  • Do I need to have multiple host headers per client?
  • How can I join the right schema based on the client, which is accessing the application?
  • At the higher level, there are some things to consider:

    • You probably want to hide the tenancy ideas with the development of employment. In this way, you would probably hide it as much as possible in your infrastructure and keep it aside from your business logic. You do not always want to check that you are in the context of which tenant ... you just want to be in that context.
    • If you are using a unit of work method, then make sure that any unit of work (except one which is working purely in terms of infrastructure, business Does not refer to) in the context of a tenant if you are not using the unit of pattern of work ... maybe you should be. Not sure how you will follow the advice given above (although you may be able to find a way out)
    • You probably want to place a tenant ID in the headline of each message service or HTTP request is probably better to keep it on the principle of keeping away from business logic outside the body. You can scrape behind this curtain and make sure that any outgoing messages / requests are put behind the scenes.
    • I'm not familiar with Oracle, but in SQL Server and I believe that if you use cloning as a way of switching tenants to PostGrace, it means that every SQL command and query Instead of parameterizing the schema, you can have the same SQL user (without an affiliate login) that has the associated tenant's schema as its default schema Switch to have been kept, and every day thereafter schema-day SQL you must wrap will stop calling the database and call it cloning. As I say, I am not sure how this works in Oracle, but it is a common idea for SQL Server.
    • Authentication and security is a big concern here, what can I discuss about this, but make sure that you are correct

    Comments

    Popular posts from this blog

    c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

    Calling GetGUIThreadInfo from Outlook VBA -

    Obfuscating Python code? -