0

I have a NextJS app for which I want to cache data from our backend APIs to reduce the load when we have high volumes of concurrent users scrolling through (or search) years-worth of historical data.

Data flow is unidirectional with the cache only ever being updated via our APIs. Cached data is eventually consistent. Ideally this cache/database would also support join queries.

One potential solution is a SQLite database stored on the user's device via Origin Private File System. Limitations include the complexity/memory usage of loading up the DB via WASM and web workers, the DB being wiped away when browser data is cleared (and thus needing to be re-populated which puts a strain on our APIs), as well as the fact that we'd need to refactor our app such that much of the server-side components would be pushed into the client.

I am also exploring server-side caching solutions however this would be more expensive to scale, in addition to increasing latency when an update occurs via the client.

asked Mar 31, 2024 at 12:18
2
  • looks interesting, you can use local storage and or cookies but the space is limited Commented Mar 31, 2024 at 13:39
  • The crux of the problem is the definition of real-time. Once you define the acceptable timespan, you can pick your caching solution based on the required performance target. Commented Apr 1, 2024 at 0:21

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.