Thanks. All these 3 approaches have their own pros and cons based on cost and long term maintenance.
As per my experience, I still find approach 3 as a good start which can be achieved by adding client_id/tenant_id in all tables because of following reasons:
- Relatively Easy to launch MVP with just code and minor schema change. Why easy, because client_id addition should be a uniform change. (No complex logic is required)
- Low cost until you get high volume traffic. Good for startups/individuals with limited funds. Shared resources.
You never know, how many months your app will be ideal/low traffic after launch and you may want to launch free tier as well, so approach-1 will definitely painful if there is cost constrain. You will die every month by looking into free users consuming dedicated infra resources. 😄
- Easy migrations/roll out features. No need to handle infra level complexity.
Rest 2 approaches can be implemented later when you have a team/fund/ MVP in right direction or any client looking for specific use case like data isolation etc.
Overall, if you have huge fund to pump.. and market clients ready, go with approach-1 or 2 otherwise 3.