---
title: "Comment by Vasu Rangpariya on \"How To Make Your Node.js API 5x Faster With Platformatic\" | Hashnode"
description: "How to implement deduplication without using platformatic with Fastify. Is there any demo code to implement it with a route or controller?"
url: "https://hashnode.com/posts/how-to-make-your-nodejs-api-5x-faster-with-platformatic/653a4ec7a170ffcca0d38b93/comment/65dc7afd2e8d35e063a47b49"
---

[Discussion](https://hashnode.com/posts/how-to-make-your-nodejs-api-5x-faster-with-platformatic/653a4ec7a170ffcca0d38b93)

Comment [How To Make Your Node.js API 5x Faster With Platformatic](https://hashnode.com/posts/how-to-make-your-nodejs-api-5x-faster-with-platformatic/653a4ec7a170ffcca0d38b93)

[Vasu Rangpariya](https://hashnode.com/@vasurangpariya)

[Feb 26, 2024](https://hashnode.com/posts/how-to-make-your-nodejs-api-5x-faster-with-platformatic/653a4ec7a170ffcca0d38b93/comment/65dc7afd2e8d35e063a47b49)

How to implement deduplication without using platformatic with Fastify. Is there any demo code to implement it with a route or controller?

[Melroy van den Berg](https://hashnode.com/@melroy89)

[Mar 18, 2024](https://hashnode.com/posts/how-to-make-your-nodejs-api-5x-faster-with-platformatic/653a4ec7a170ffcca0d38b93/comment/65dc7afd2e8d35e063a47b49#reply-65f79e633e29f61c5350cee6)

I guess implement the package yourself in your Fastify app: [github.com/mcollina/async-cache-dedupe](https://github.com/mcollina/async-cache-dedupe)

I guess just adding a cache behind each DB call? See some TS example code: [github.com/mcollina/async-cache-dedupe](https://github.com/mcollina/async-cache-dedupe?tab=readme-ov-file#typescript)

Here another example implementation: [github.com/Shyam-Chen/Fastify-Starter/blob/a17460…](https://github.com/Shyam-Chen/Fastify-Starter/blob/a1746035a40bf49d5d095b0b2c16cfa5e2493a40/app/src/routes/hello-world/caching-dedupe/%5Bid%5D-redis/%2Bhandler.ts#L4)

[Melroy van den Berg](https://hashnode.com/@melroy89)

[Mar 18, 2024](https://hashnode.com/posts/how-to-make-your-nodejs-api-5x-faster-with-platformatic/653a4ec7a170ffcca0d38b93/comment/65dc7afd2e8d35e063a47b49#reply-65f7a1803e29f61c5350ceeb)

If you are more advanced... And understand the examples above.

You could also checkout the Platformatic code, if you want to see a template style of implementing it, thus it can be used in a very general way: [github.com/platformatic/platformatic/blob/b0cbad3…](https://github.com/platformatic/platformatic/blob/b0cbad33354dacf2f018ddf4d62bee4f412b420c/packages/sql-mapper/lib/cache.js#L2)

Then the `setupCache` method is used here: [github.com/platformatic/platformatic/blob/b0cbad3…](https://github.com/platformatic/platformatic/blob/b0cbad33354dacf2f018ddf4d62bee4f412b420c/packages/sql-mapper/mapper.js#L10)
