Tokopedia Mar 22, 2022

Query Hashing to Reduce GraphQL Payload Size

Article Summary

Tokopedia's mobile team was sending massive GraphQL queries with every API call. The network overhead was killing performance on slower connections.

Their engineering team built a custom query hashing system that replaces full GraphQL POST bodies with lightweight hash identifiers. Instead of compressing with standard tools like gunzip, they created a modular solution with Firebase-controlled rollout.

Key Takeaways

Critical Insight

Query hashing cut GraphQL payload sizes by 70%+ and shaved 20 to 40ms off each request for users on slower networks.

The implementation required solving a tricky challenge around hash collision handling and database indexing that most teams overlook.

Recent from Tokopedia

Related Articles