I am trying to create a java web application using Spring mvc. The purpose of this application is to serve different groups of users from different business units in the enterprise. So, for instance, if you think of it as a shopping experience kind of application, where the application is functionally about
- picking what you want
- adding what you pick to the cart
- checking out from cart
then, I need to list plumbing items for plumbing department, electrical items for electrical department and and so on.
So, I decided to have two different schemas with identical table structure. So schema 'PLUMB' will store plumbing dept users who can use the application, and items related to plumbing in USERS and ITEMS table of the PLUMB schema. Similarly, electrical department has its own schema. That's for multitenancy on database side.
For the application/deployment side, the code of the webapp remains the same except for the one property that tells that application which schema it needs to query (this would be obviously different on each instance). So, I am thinking about deploying
Are there any known anti patterns to this kind of architecture? I see one down side is that I will now have multiple environments to manage - like dev.mycompany.com/plumbingapp and test.mycompany.com/plumbingapp. Other than that, I think this allows for cleaner separation than having one single app that authenticates the user and then asks him to pick from which department he wants to go to and depending on department he picks, I would populate the webpage.
Have you used this kind of structure before? Are there any known down sides to this kind of design/architecture? If I deploy multiple instances, is it a multi-tenant application anymore?