Menu

I moved a search API from NestJS to Rust. Rust saved about 1 ms.
📰

I moved a search API from NestJS to Rust. Rust saved about 1 ms.

DEV Community: nestjs·Vladimir Pirotskiy·4 days ago
#b8XBT4d1
#devtonestjs#devto#dev#rust#service
Long article (1145 words) — no AI summary yet.
Reading 0:00
15s threshold

Until October 2026 I led engineering on a commerce platform. Its search API ran on NestJS. In October we replaced it with a Rust service: in production on 8 October, the old service deleted on 10 October. I can't name the client or publish the code, so this post keeps to what carries over to other projects: why we moved, how we made the cutover boring, and the traps that cost us time.

The language was not the reason

Before deciding, on 28 and 29 September, we measured the service we had. Container CPU sat at a p50 of about 2.4%. On 2 October we profiled search and autocomplete: 98 to 99% of their time was in PostgreSQL, and porting the request handling to Rust saves about 1 ms per request. Speed was not the argument, and I don't credit the move with it.

Search did get much faster over the same weeks. The rewrite went together with database work: we reworked the data, the queries and how the database serves reads.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.