Yosapol Jitrak

Yosapol Jitrak

Freelance Developer

Sikkapat Sricheangsa

Sikkapat Sricheangsa

Technical Leader at Factsblend

Redis cache decorator for hexagonal architecture in NestJS

(Sat) 19 October 2024, 16:25 @Classroom 7 (2nd Fl.)

We designed our system with a hexagonal architecture in NestJS. Our database is MongoDB. But we don't want to hit MongoDB with every request. We want to use cached data from Redis without changing a lot of our hexagonal code. Finally, we chose a decorator to solve this problem. We have 2 decorators. 1. Cache decorator 2. Invalid cache decorator