Qeraunos

Qeraunos

An ultrafast, lightweight caching solution for GraphQL.

32 followers

Qeraunos is a custom built middleware cache based on a mix of LFU and LRU eviction policies that adds the ability to cache GraphQL queries and mutations. With Qeraunos you have the option to either implement it utilizing client side or server side caching.
Qeraunos gallery image
Free
Launch Team
OS Ninja
OS Ninja
Explore and Learn Open Source using AI
Promoted

What do you think? …

Arthur Huynh
Qeraunos can be implemented on both the client side and server side, utilizing our custom caching algorithm to effectively store GraphQL queries. Our algorithm uses a mixture of LFU and LRU eviction policies to keep the queries you use the most, while evicting the least frequently and recently used for a robust and effective eviction policy. This efficient design allowed for the most optimal time complexity of O(1) for insertion, deletion, and lookup. On the client side, we employed LocalForage to provide faster access and larger storage capacity alongside our algorithm to bring query speeds down to under 1ms, an average decrease of around 99.8%. In fact, it's so fast, we thought it was an error when we saw a response time of 0ms. However, at this time, client side caching does not support mutations. Qeraunos utilizes the same efficient technology on the server side with our own custom cache. Response times are just a bit slower than the client side of course, but are still blazing fast with an average of 10ms, for an average decrease in response times of around 98%. It has the additional capability to cache mutations as well. With each mutation you make, every associated item in the cache will be updated with the new values from the mutation. Our custom key generator uses GraphQL's AST to parse through queries and join together data in a meaningful way that allows for advanced queries such as mutations. Additionally, since Redis is a popular database to use for caching, we integrated full Redis compatibility in Qeraunos on the server side. However, if you do choose to use Redis to cache your GraphQL queries, please take note that it's not nearly as fast as ours since it clocks in at approximately 20ms, for an average decrease of around 96%. It does have the benefit of a larger storage space solution if you need to scale though.
Usama Ejaz
Congrats on the launch of Qeraunos! It looks like an amazing solution for caching GraphQL queries and mutations. I'm curious to learn more about how the LFU and LRU eviction policies work together!
Arthur Huynh
@usamaejaz Thanks Usama! Right now once the cache is filled, queries will be evicted based on LFU, and if there are multiple values within the same frequency, then it will kick out the least recently used value. If you want to take a closer look at our GitHub! We're always looking to improve so if you have any suggestions feel free to drop us a pull request.
Usama Ejaz
@arthurynh thank you for your reply. i will surely have a look at your github.
Paolo De Giglio 🚀
Woohoo! 🎉 Congrats on the launch of Qeraunos! 🎉 Does the server side cache support complex queries? 🤔 I'm sure the response times are so fast that the queries actually get to the server before they're sent! 🤪
Arthur Huynh
@paolo_degiglio Thanks Paolo! The server side does support complex queries, but doesn't account for certain types of queries such as alias and fragments. We're working on integrated that though so stay tuned!
Johan Steneros
Interesting. Forwarding this to my tech team.