mardi 21 janvier 2020

Application design: Central vs Private cache

I am writing some library code in Go, where different modules/packages need to cache their credentials like public keys and authentication tokens. I have two ideas:

  1. Each package will take care of it's own caching.
  2. A central cache wrapped over by different implementations of respective packages.
    • There will be an actual cache object holding the key-pairs.
    • Respective implementations for packages will perform operations like get, set and refresh over the cache.
    • Packages will use this implementations.

I am trying to understand pros/cons of both the approaches.

Aucun commentaire:

Enregistrer un commentaire