|
1 | | -# lambda-java8-dynamodb |
| 1 | +## Serverless Architecture with Java 8, AWS Lambda, and Amazon DynamoDB |
2 | 2 |
|
3 | 3 | This code base is an example API built with the Java 8 runtime for AWS Lambda, in |
4 | | -the context of a common use case: an API backed by Amazon DynamoDB as its data store. |
5 | | -By using Lambda together with DynamoDB, there is no need to deploy or manage servers |
6 | | -for either the application tier or database tier. If the front end consists of mobile |
7 | | -devices and a web app statically hosted on Amazon S3, the result is a completely serverless |
8 | | -architecture with no need to deploy or manage servers anywhere in the system, in either |
9 | | -the front end or back end. |
| 4 | +the context of a common use case: an API backed by Amazon DynamoDB as its data store. In a production deployment, you would use Amazon API Gateway to proxy RESTful API requests to the Lambda functions, each of which corresponds to a single API call. When API Gateway is added, the architecture is as follows: |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +By using Lambda together with DynamoDB and API Gateway, there is no need to deploy or manage servers for either the application tier or database tier. If the front end consists of mobile devices and a web app statically hosted on Amazon S3, the result is a completely serverless architecture with no need to deploy or manage servers anywhere in the system, in either the front end or back end. For further information, see the following blog post series: |
| 9 | +- [Serverless Architectures with Java 8, AWS Lambda, and Amazon DynamoDB — Part 1](https://aws.amazon.com/blogs/startups/serverless-architectures-with-java-8-aws-lambda-and-amazon-dynamodb-part-1/). |
| 10 | +- [Serverless Architectures with Java 8, AWS Lambda, and Amazon DynamoDB — Part 2](https://aws.amazon.com/blogs/startups/serverless-architectures-with-java-8-aws-lambda-and-amazon-dynamodb-part-2/). |
| 11 | + |
| 12 | +### EXAMPLE USE CASE: |
10 | 13 |
|
11 | 14 | The example use case is a company which maintains a catalog of sports events, and has decided |
12 | 15 | to build an API for that catalog backed by DynamoDB. For each event, the company needs to |
@@ -35,9 +38,15 @@ as a partition or sort key for the table or a Global Secondary Index (GSI): |
35 | 38 | country: String |
36 | 39 |
|
37 | 40 |
|
38 | | -DEPLOYMENT NOTE: |
| 41 | +### DEPLOYMENT NOTE: |
| 42 | + |
| 43 | +Follow these steps to deploy the application: |
| 44 | + |
| 45 | +- Create a DynamoDB table with the keys and attributes mentioned above. |
| 46 | + |
| 47 | +- Create Lambda functions, one for each handler in the EventFunctions class. |
| 48 | + |
| 49 | +- Create a API Gateway API. Note that even if you don't do this step, you can still test the Lambda functions via the Lambda console "test function" tab. |
39 | 50 |
|
40 | | -To deploy this API, consider using AWS SAM (Serverless Application Model). Using SAM can simplify |
41 | | -deploying an API, such as this one, built with a single code base that supports multiple Lambda |
42 | | -functions. See http://docs.aws.amazon.com/lambda/latest/dg/deploying-lambda-apps.html. |
| 51 | +To automate deployment of the Lambda functions and API Gateway, consider using AWS SAM (Serverless Application Model). Using SAM can simplify deploying an API, such as this one, built with a single code base that supports multiple Lambda functions. See http://docs.aws.amazon.com/lambda/latest/dg/deploying-lambda-apps.html. |
43 | 52 |
|
0 commit comments