Using External Storage

In this lesson, you'll explore and evaluate the different external storage options you have when using Lambda functions!

This chapter explains how to connect a Lambda function to persistent storage such as a file system or a database. You’ll also learn about passing configurations to Lambda functions, and dealing with resource access permissions.

The application you deployed in the previous chapter is stateless. It thanks the user for submitting a form, but you are not really preserving that data anywhere. Your users won’t really like just being ignored.

Lambda instances have a local file system you can write to, connected to the system’s temporary path. Anything stored there is only accessible to that particular container, and it will be lost once the instance is stopped. This might be useful for temporarily caching results, but not for persistent storage. You’ll need to move the user data outside the container.

Cloud storage options #

There are three main choices for persistent storage in the cloud:

  • Network file systems
  • Relational databases
  • Key-value stores

Network file systems #

Network file systems are generally not a good choice for Lambda functions for two reasons. The first is that attaching an external file system volume takes a significant amount of ...