How are SaaS applications organized?

Consider a web application (MVC, such as Rails) for several clients as a service.

How to do it?

  • one instance of the application per client? (+ one database for each client)

  • one instance for all clients (+ one database for all clients)

The former one is simple, but ... "inefficient." How about the last one? (best practices, design patterns) How to separate customer data? For example: worker "A" of client "1" has two documents, worker "B" of client "2" has three documents. How to create model associations to protect the data of other users (and customers)? I think that combining each request with a client model is not a good solution.

+3
source share
2 answers

I would suggest looking at an earlier answer to multi-tenant applications in Ruby on Rails .

It really depends on your use case, but the easiest way to deal with this is to have a single database with the scope of specific applications. You can go from there depending on your requirements / budget.

I am a big fan of the postgresql system described in detail in this link: P

0
source

This MSDN article explains well the multi-tenant architecture.

, , ; Rails .

, , .

0

Source: https://habr.com/ru/post/1742944/


All Articles