Proxy API with Circuit Breaker on AWS lambda

Viewed 1548

I'm building an API that will act as a proxy to n underlying API's that all do the same thing. It will use circuit breaker pattern to determine when one of the underlying API's is unavailable, therefore the proxy API will have state. One solution is to run the API on AWS lambda and store the circuit breaker state in AWS ElastiCache.

Is there another more cost effective solution that would not require me to run an 'always on' service like ElasticCache?

1 Answers

Probably what I would do is store some of the state in the lambda with a time code, which I would assume the time to be pretty short. Obviously this data is not guaranteed to be there for you (lambdas spin down and back up are going to be blank), so if it's not there, or greater than some time value that your solution is good with, go grab it from DynamoDB. DynamoDB is a cost effective solution, and fast on look ups by PK. But you'll always want to write any updates to DynamoDB.

I just saw this is 3 years old, so ˜\__(ツ)_/˜

Related