Efficient scaling of the database #4973
Unanswered
IDIRYACINE
asked this question in
Q&A
Replies: 1 comment
-
Can you share specifically where the system is struggling? Is it at specific points, like checkout? Is the medusa backend version up to date, with all the latest migrations run? Sometimes indexes are added. Also, what version of Postgres are you using? Are you familiar with Postgres vacuuming issues? You would need to be at a pretty mind-boggling scale before it should be giving you trouble unless there is something about the schema or the db instance that needs to be looked at. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to scale the database due to high traffic concerns.
I am plannig to split the initial schema into 4 schemas (Orders/Cart, Product, Customers,?) ps:I just extracted the related tables (didn't change them)
The main idea is each service would connect to its dedicated database instance instead of a single monolithic instance which would make scaling much easier and efficient.
I managed to do this by extending the service repository and using a different datasource than the default one that loaders/database provide
However I am concerned if this would cause any issues or if there is a better way of doing it.
This concern stems from the fact that the default datasource is being registered in the container as well as a pg_connection object which may be used somewhere else that would cause some misbehaving.
loaders/pg-connection container.register( ContainerRegistrationKeys.PG_CONNECTION, asValue(pgConnection) )
loaders/index container.register({ [ContainerRegistrationKeys.MANAGER]: asValue(dataSource.manager), })
Ps : I am fairly new to the Medusa codebase I tried tracking down where they are used but couldn't find anything notable. However since they are being registered in the container their has to be a reason behind that.My main assumption is that third party plugins and modules are using that ?
Beta Was this translation helpful? Give feedback.
All reactions