3 ms·
I remember the main reason people start moving away from Express was because the way routing worked in Express it kinda created a performance problem that sever
by DanielHB 2y ago
I remember the main reason people start moving away from Express was because the way routing worked in Express it kinda created a performance problem that severely handicapped the throughput of services. I don't know if it ever got addressed (I think it required breaking changes). But it was this article from 2014 that triggered the move away from express:
https://netflixtechblog.com/node-js-in-flames-ddd073803aa4 https://netflixtechblog.com/node-js-in-flames-ddd073803aa4
But the alternatives like Restify and Fastify are very similar to Express in developer experience, so it was not a huge deal to move away from it. One could think that these new frameworks are just a new major version of Express that had a lot of breaking changes.
- zkldi 2y agoThe blog post you've linked doesn't justify what you've said about it at all. In the netflix blog post they're complaining about increasing latency over time because they have a function that *reloads all express routes in-memory* that didn't properly remove all the previous routes, so the routes array got bigger and bigger. That's not a fundamental problem with express[1], that's an obscure (ab)use case implemented wrong. Hardly a damning indictment of express. > This turned out be caused by a periodic (10/hour) function in our code. The main purpose of this was to refresh our route handlers from an external source. This was implemented by deleting old handlers and adding new ones to the array. Unfortunately, it was also inadvertently adding a static route handler with the same path each time it ran. [1]: Admittedly an array is not the "best" data structure for routing, but that absolutely wasn't the performance issue they were having. Below a couple thousand routes it barely matters.