Skip to content

⚡ Improve backend performance and caching #560

@EightBitByte

Description

@EightBitByte

Summary

There are a few performance enhancements we can apply to make our backend procedures a little speedier, as well as cache on the frontend to avoid unnecessary calls to the backend.

Backend Optimizations

  • The weekly job currently processes restaurants sequentially. You can improve this by running them in parallel.
  • The daily function already uses Promise.allSettled but could benefit from connection pooling optimization.

Frontend Optimizations

  • Increase stale time and add selective refetching to tRPC
  • Use Zustand to store information on the frontend and avoid repetitive fetching. You will need to decide what information exactly should be stored, such as meal information, favorites, ratings, etc.

Memoize the following

  • Date calculations in render body
  • No memoization of derived data
  • tRPC query could have better caching

See this DeepWiki search for more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendRelating to tRPC, DB, APIfrontendRelating to Next.js, PWAperfA performance enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions