3 ms·
My favorite ORM is TypeORM. A client insisted we use that, mostly because they were already using it. Somehow, a few left joins led to ridiculous (talking tens
by ElFitz 3y ago
My favorite ORM is TypeORM.
A client insisted we use that, mostly because they were already using it.
Somehow, a few left joins led to ridiculous (talking tens of gigabytes of ram when the whole database itself was at most a hundred megabytes) memory leaks, blowing up the instances.
Turns out, it is a known issue [0], and you’re better off joining by hand.
I won’t complain though. I got a nice blog post out of it.
Now, this wont’ be specific to ORMs, and any dependency could blow up your service by leaking all over the place. But so far it’s been the only one to do this to me.
[0]: https://github.com/typeorm/typeorm/issues/4499#issuecomment-852649915 https://github.com/typeorm/typeorm/issues/4499#issuecomment-...
- knocte 3y agoYou say "known issue", and add a link to it, but that's not a link to a bug, it's a bug to a comment from someone that has implemented a workaround to some sort of problem. Then it's not clear if it's really a TypeORM bug or not (if it was, there would be clear aim from the maintainers to fix it).
- ElFitz 3y agoIt is a link to a specific comment on a GitHub issue [0] titled "Excessive memory usage when loading models with relations" where multiple users chime in and report facing the same issue. Someone honestly trying to refute my comment in good faith could have looked around and easily understood this. They would then have found another comment [1], mentioning a pull request [2] supposedly fixing this exact issue, with the explicit aim to fix "performance issues". If that was not a bug, then I don’t know what is. But then, I understand that this can be a lot to ask. Personally, I believe the only valid criticism that could stand here would be that, not having bothered to check if it still was an issue, I perhaps should have instead used the past tense, out of precaution, instead of assuming the bug had been fixed two to three years after being initially reported. And I shall try to remember that. So thank you, I guess. [0]: https://github.com/typeorm/typeorm/issues/4499 https://github.com/typeorm/typeorm/issues/4499 [1]: https://github.com/typeorm/typeorm/issues/4499#issuecomment-1046775521 https://github.com/typeorm/typeorm/issues/4499#issuecomment-... [2]: https://github.com/typeorm/typeorm/pull/8169 https://github.com/typeorm/typeorm/pull/8169