How lambda function and api gateway handle disaster recovery?

As we all know Lambda is a serverless service that is handled by AWS.

My current flow is:

client(API) -> API gateway -> lambda

I am wondering what happens when the region where my lambda is present goes down? also wondering what happens when the API gateway region goes down.

How it should be handled? is it handled by AWS as it is serverless OR should I handle it myself, how would that be?

Answers 1

  • Both API gateway and lambda are regional services. AWS docs write for lambda:

    Lambda runs your function in multiple Availability Zones to ensure that it is available to process events in case of a service interruption in a single zone.

    Thus, in case an entire region goes down, your functions will go down with it. So you have to be pro-active and have their backups, as well the other parts of your application, ready to run in other region.

    In terms of API gateway, you can run multiple copies of your API gateway in different regions and use Route53 (which is global service) to manage traffic to them as explained in:

    is it handled by AWS as it is serverless OR should I handle it myself, how would that be?

    So ultimately, its your responsibility to design your own disaster recovery strategies for your lambda functions and api gateway.


Related Articles