lundi 25 novembre 2019

Shared access tokens in a distributed system

'm building a system that horizontally scales with many nodes. Any of these nodes could consume an API that's hosted on https://example.com/api. The authentication for this API is token based.

My question is, should each of my nodes authenticate separately and fetch their own token? Or should I build a shared cache between them and store the token there?

If latter, are there any standards for this design pattern, or better yet libraries that can do this for me? ie. stores the token in cache, and takes a lambda function + ttl for auth or renewal)

Thanks!

Aucun commentaire:

Enregistrer un commentaire