Features
In 1.10.0, we changed the mechanism for loading relations in Typeorm from join
to query
, which meant that instead of firing one large query with joins, we fire separate queries for each requested relation. This was added to improve performance and eliminate an issue with heavy memory usage. Read more about it in the release notes for 1.10.0.
Unfortunately, we found the query
strategy to come with unexpected issues related to database connection management. In short, it turned out the query
strategy obtains a new database connection for each separate query – instead of reusing the already established connection – leading to a drained connection pool and eventually unresponsive applications.
To eliminate these issues (and potential future ones), we've decided to ditch the query strategy. Instead, we are bringing back our (own) custom query strategies for Carts, Products, and Orders to maintain highly performant APIs while mitigating the risk of unexpected memory and/or database connection problems.
This also means we'll be moving away from our Typeorm fork, as the fix related to the query strategy is now irrelevant. You should update your project to use the official Typeorm package.
In your package.json
, replace our forked version with the latest from Typeorm:
"typeorm": "^0.3.16"
This is in addition to bumping all you Medusa-related packages to their latest versions.
- feat(medusa,utils): Add support for multiple where condition on the same column by @adrien2p in #4046
- feat(medusa): Cart custom query strategy by @olivermrbl in #4083
- feat(medusa): Product custom query strategy by @adrien2p and @riqwan in #4084
Bugs
Chores
- chore(medusa): Expose
ioredis
options by @olivermrbl in #4073 - chore: Revert to official Typeorm package by @olivermrbl in #4072
Full Changelog: v1.10.1...v1.11.0