Backend performance improvements
We have made some performance improvements to the backend that should make the platform faster and more responsive, especially during the event day when there are many scans and donations happening at the same time. These changes were motivated by the fact that during the last events we sometimes experienced performance issues during the event day, especially when there were many scans happening at the same time.
The main performance improvements are:
- Switched out argon2 for hmac via sha256 for hashing/verifying the API keys of the scanner stations.
- Introduced a new caching layer powered by NATS JetStream for caching
- Runner card to runner mappings
- Runner latest scan tracking (for cheating validation)
- Runner current distance tracking
- Scan station authentication results
- Scan station to track mappings
- Stats results
- Updated to new versions of TypeScript for improved compilation performance and better code quality
We also made some improvements to the developer experience by switching the runtime to bun, this enables:
- Faster startup times
- Faster test execution
- Fewer dependencies thanks to bun’s built-in functionality and modern TypeScript features
Overall, we are very happy with the performance improvements and we are confident that they will make the platform faster and more responsive during the event day.
These optimizations were introduced in the backend releases 1.6.0, 1.7.0, 1.7.1, 1.7.2, 1.8.0 and 1.8.1.