Answer the question
In order to leave comments, you need to log in
Are there any examples of horizontal DB scaling on Laravel?
There is an application on laravel 5.1. It works with PostgreSQL database. Since the load on the application and the database increases each time, it became necessary to implement horizontal scaling. It is required to separate the data of some tables on different servers depending on the company ID (as an example).
I understand the algorithm for implementing this functionality. But in doubt about this scaling within the Eloquent ORM, because out of the box, there is no possibility of splitting the data of the same tables across different servers. Unfortunately, I couldn't find any answers about this on Google.
Who has experience in developing such a solution on laravel or who can see examples of implementation, please share the information.
Answer the question
In order to leave comments, you need to log in
Use some Postgres-XL and solve database problems on the database side, instead of dragging this logic into the application.
Eloquent has a
T.o. you can set in the model code which database to access for the operation:
public function save()
{
$this->setConnection('mysql2');
parent::save();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question