pwrdrvr/microapps-core

Lazy Cache Version Metadata in Edge-to-Origin Lambda

Closed this issue · 0 comments

Motivations

  • Each request is re-fetching metadata about versions from the DB
  • This data is immutable so it can be lazily cached / saved in memory
  • At this point there is not a need to use an LRU as there simply is not enough data about versions to use more than a reasonable amount of memory

Brainstorming Options

  • Denormalize the default version info (url, etc.) into the default rule record
    • This makes it so that all rules do not need to be downloaded
    • Can download only the default rule and embedded info about current default version
    • That enables building a lazy cache of other discovered versions
    • Only 1 record has to be checked when routing an app request

To-Do

  • Save info into { [appname: string]: { [semver: string]: { ... } } } object
  • Check the object first before hitting DB