Answer the question
In order to leave comments, you need to log in
The problem with the database architecture of the future application, how to organize it correctly?
Good afternoon!
Briefly about the project
There are 16 sites on WP, on average 200 unique visitors come to each site.
These sites are served by 8 people (fill and edit articles).
I have the following problem. It is planned to develop a large project, I took yii2 + psql as the core.
This application will link 16 sites. Prompt as to me it is correct architecture of a DB.
Should I create a separate database for each site or store everything in one big database?
If we take the option of creating a separate database for each site, then a reasonable question arises, organizing user access to the admin panel (each user had access only to his own database)?
In the case of the second option, how best to organize the work of the database (create replication, look towards sharding when entraining loads)?
PS I apologize for the confusion, I did not correctly calculate the load on the server, the sites are hosted, I requested statistics from technical support
Answer the question
In order to leave comments, you need to log in
Few data.
What is the project? Loads? Visits? Planned database growth? Approximately transactions per second? Reader/writer ratio? and many, many more.
Want a sensible answer - describe what kind of project. Otherwise, you will get no less vague answers.
Did I understand correctly that you want to abandon WP and rewrite everything in YII?
If these sites strongly interact with each other, I would make one database, if the problem is only in authorization, then they are different, and I moved the authorization to a separate service.
I would not worry at all about performance (with 200 * 16 visitors per day, although you need to look at your requests). I think there will be enough properly built indexes, caching, loading into memory (in-memory storage/redis/memcache). Well, even if it doesn’t help, then there are no problems to do the same replication / sharding / partitioning / clustering / replacing the disk with an SSD, etc.
yii1 is morally obsolete
yii2 is friends with PHP5.4 and now PHP7 support is just being completed
In phalcon 2.1 there is already rudimentary PHP7 support, it remains only to wait a month or two until they finish it.
Symfony3 (that's already 3!) has full support for PHP7 since the previous year.
If you start rewriting something to something PHP, you need to understand that now PHP7 solutions will be finished and everything will become obsolete automatically, or it will fall off due to lack of backward compatibility.
It is advisable to take the symphony and Sonata-Project bundles at once - this will be an ideal replacement for the same WP.
Even in the case of PostgreSQL, DBMSs have enough levels of encapsulation to allow multiple tablespaces and schemas to be shared within the same database.
You can separate everything into directories corresponding to databases, schemas and tablespaces - there is no point in keeping everything in one database, just as there is no point in bothering with the ubiquitous table prefixes of MySQL 3 times.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question