AWS: API, Dynamo and Lambda
AWS API Gateway Overview
What is Amazon API Gateway? Amazon API Gateway is a managed service that allows developers to:
- Define the HTTP endpoints of a REST API or a WebSocket API: API Gateway sits between the backend services of your API and your API’s users, handling the HTTP requests to your API endpoints and routing them to the correct backends.
- Connect those endpoints with the corresponding backend business logic: It provides a set of tools that help you manage your API definitions and the mappings between endpoints and their respective backend services.
- Handle authentication, access control, monitoring, and tracing of API requests.
- It can generate API references from your definitions and make them available to your users as API documentation.
Why is Amazon API Gateway an important part of the Serverless ecosystem?
- API Gateway is the piece that ties together Serverless functions and API definitions.
- It enables a truly serverless architecture for web applications by triggering the execution of a Serverless function directly in response to an HTTP request.
- When using API Gateway together with other AWS services, it’s possible to build a fully functional customer-facing web application without maintaining a server.
Advantages include:
- Serverless model—scalability
- Low maintenance
- Low cost
How does API Gateway integrate with other AWS services? API Gateway supports direct integrations that can be configured in the API Gateway user interface (or via the API Gateway’s own API) for the following actions:
- Invoking an AWS Lambda function.
- Invoking another HTTP endpoint, with or without VPC Link.
- Making an HTTP call against the API of any AWS service that provides an HTTP API.
- Returning a mock response generated within API Gateway without calling out to other services.
AWS API Gateway
What are the some benefits of using Amazon API Gateway?
- Efficient API development:
- Reliable performance
- Cost savings
- Monitoring
- Security
- Restful API options
What two API types might you choose from?
- RESTful APIs:
- Optimized for serverless workloads and HTTP backends using HTTP APIs.
- HTTP APIs are the best choice for building APIs that only require API proxy functionality.
- If the APIs require API proxy functionality and API management features in a single solution, API Gateway also offers REST APIs.
- WEBSOCKET APIs
- For two-way communication applications, such as chat apps and streaming dashboards.
- Maintains a persistent connection to handle message transfer between backend service and clients.
AWS DynamoDB Guide
What is DynamoDB?
DynamoDB is a hosted NoSQL database offered by Amazon Web Services (AWS). It offers:
- Reliable performance even as it scales
- Managment of infrastructure
- A small, simple API allowing for simple key-value access as well as more advanced query patterns.
Under what circumstances would you recommend DynamoDB over MongoDB?
DynamoDB is a particularly good fit for the following use cases:
- Applications with large amounts of data and strict latency requirements.
- Serverless applications using AWS Lambda.
- Data sets with simple, known access patterns.
AWS DynamoDB
Explain to a non-technical friend how DynamoDB works.
DynamoDB is a database service, whose hardware and other infrastructure os managed by Amazon. It handles security and other features. It is schemaless, meaning that the user can input data onto its tables directly, which allows for more flexible data entry when building or modifying a database. It uses a primary key, called a partition key, to identify and retrieve data, and uses hashing to secure the data.
Dynamoose
What is Dynamoose?
Dynamoose is a modeling tool for Amazon’s DynamoDB.
What are some key features of Dynamoose?
- Type safety
- High level API
- Easy to use syntax
- DynamoDB Single Table Design Support
- Ability to transform data before saving or retrieving items
- Strict data modeling (validation, required attributes, and more)
- Support for DynamoDB Transactions
- Powerful Conditional/Filtering Support
- Callback & Promise support
- AWS Multi-region support