1
TCSS 562: Software Engineering School of Engineering and Technology
for Cloud Computing University of Washington – Tacoma
Fall 2021
http://faculty.washington.edu/wlloyd/courses/tcss562
Tutorial 6 – Introduction to Lambda III:
Serverless Databases
Disclaimer: Subject to updates as corrections are found
Version 0.11
Scoring: 20 pts maximum
The purpose of this tutorial is to introduce the use of relational databases from AWS Lambda. This tutorial will
demonstrate the use of SQLite, an in-memory file-based database that runs inside a Lambda function to
provide a “temporary” relational database that lives for the lifetime of the Lambda container. Secondly, the
tutorial demonstrates the use of the Amazon Relational Database Service (RDS) to create a persistent relational
database using Serverless Aurora MySQL 5.6 for data storage and query support for Lambda functions.
Goals of this tutorial include:
1. Introduce the Sqlite database using the command line “sqlite3” tool.
2. Deploy a Lambda Function that uses a file-based SQLite3 database in the “/tmp” directory of the
Lambda container that persists between client function invocations
3. Compare the difference between using file-based and in-memory SQLite DBs on Lambda.
4. Create an Amazon RDS Aurora MySQL Serverless database
5. Launch an EC2 instance and install the mysql command line client to interface with the Aurora
serverless database.
6. Deploy an AWS Lambda function that uses the MySQL Serverless database.
1. Using the SQLite Command Line
To begin, create a directory called “saaf_sqlite”.
Then clone the git repository under the new directory:
If using Windows or Mac, download the “Precompiled binaries” as a zip file from:
https://www.sqlite.org/download.html
On Windows/Mac, unzip the zip file, and then run the sqlite3 program.
On Ubuntu Linux, the package sqlite3 can be installed which is version ~3.31.1 on Ubuntu 20.04 LTS. Then
launch the sqlite3 database client:
文档被以下合辑收录
评论