Multitenancy

February 13, 2016

What is it multitenancy? In SaaS applications it means that every client have a document space and can not access any documents outside of it. For sample, you can create a free mailbox at Yahoo.com. There are lots of users and every one of them have a mailbox. There are two ways to implement it:

1) create a single DB table MAILBOX with column USER_ID and use this column to limit search results when user is searching inside his mailbox
2) create a separate DB per user
3) virtualization

All the approaches are multitenant, but the second and thirs ones are 1) more scalable because you can spread 10000 mailboxes between 100 servers with no problems 2) more secure because in case of programmer makes a mistake, and security hole appear, there is no way to access anything outside of DB anyway. Hackers will not be able to steal all the data, in worst case leak will be limited to one client’s DB.