SaaS application on a shared server with multiple databases

I am going to create a SaaS application in PHP. In this application, the user can create and manage multiple tables to expand functionality. After completing the application, it can load the php code and database.

We will also provide sql import functionality so that the user can create a schema from a file (.sql).

I am searching on google but have not found a suitable solution. Here you can consider sqlfiddle functionality.

I have two options, but I need a better solution: 1) To create several databases and its tables, use the table prefix as a solution 2) Convert mysql to sqlite. At boot time, create the export as a mysql file (.sql).

It may have aprox. 10,000 users / databases. Please suggest a solution to provide each user with a separate database, if any.

If the shared server will not work, I will buy VPS. The main requirement is to provide each user with their own database.

+4
source share
1 answer

I am going to choose sqlite as the choice for db. After running some tests, sqlite seems like a good option for DDL and DML to work.

I will use mysql for sqlite.sql converter: https://github.com/sutara79/convert-mysql-to-sqlite

To improve speed, I follow the following stackoverflow article: Improve SQLite performance per second per second?

0
source

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


All Articles