Arthi Jaganathan, Solutions Architect, ASEAN, AWS. AWS Customer Speaker:
Minh Thuong Nguyen, Full Stack Engineer, Global Fashion Group. What if you could build an application that could rapidly scale on demand to meet high-volume traffic or spikes? What if you could do this without ever having to provision or manage a server, update an operating system, or worry about availability? With serverless computing, developers can focus on building great applications and services in a cost-effective manner without the operational overhead of traditional application development and deployment. Come learn how you can use AWS Lambda, Amazon API Gateway, and other services to build the serverless applications of the future.
4. Lambda execution model
Synchronous Asynchronous Stream-based
Amazon
API Gateway
AWS Lambda
function
Amazon
DynamoDBAmazon
SNS
/order
AWS Lambda
function
Amazon
S3
reqs
Amazon
Kinesis
changes
AWS Lambda
service
function
5. Common Serverless Application Use Cases
Web
applications
• Static
websites
• Complex web
apps
• Packages for
Flask and
Express
Data
processing
• Real-time
• MapReduce
• Batch
• Machine
learning
inference
Chatbots
• Powering
chatbot logic
Backends
• Apps and
services
• Mobile
• IoT
</></>
Amazon
Alexa
• Powering
voice-enabled
apps
• Alexa
Skills Kit
IT
automation
• Policy engines
• Extending
AWS services
• Infrastructure
management
7. Global Fashion Group (GFG)
5 regional companies 24 countries
15M monthly unique visitors3000+ international brands
8. Goal
Improve margin for our online e-commerce by suggesting
recommended price
Characteristics
• Millions of prices to be updated regularly
• Prices changes triggered by events
• Batch feeds
• Unpredictable usage spikes
Pricing Engine
9. • Microservice and event-driven
• “Generic” core engine with “adapted” integration layer with the
Regions
• Full stack (front-end / back-end) mindset
• Agile methodology with continuous deployment
Principles
10. • Full stack, asynchronous, event-driven
• Cloud based, aligned across regions
• Microservices, no DevOps in the
beginning → Lambda
• Messaging system, data storage
→
→
→
→
+
Tech Stack
12. High Level Architecture
Validation Service
External Sources
Big Data
Platform
Lambda
function
Amazon
Kinesis
Publishing Service
Lambda
function
API
Gateway
API
Gateway
Amazon
Kinesis
Recommendation Service
Lambda
function
RDS -
PostgreSQL
Dashboard - Frontend
Amazon
S3
Users
DynamoDB
Integration Layer
Competitor
data
Inventory
data
Sales
data
EC2
Instance
Price Optimizer
13. • Easy to use
• Fast deployment (Serverless framework)
• Autoscaling, charged for usage
• Support of multiple triggers (API, S3, Kinesis, DynamoDB,
Lambda etc.)
Advantages
17. Lambda
function
2. Lambda
function invoked
1. API call made
against API Gateway
Clients
Amazon API
Gateway
Lambda
function
Lambda
function
2. API call made directly
against backing AWS service
API clients
Amazon API
Gateway
Clients
Amazon
S3
Amazon
Kinesis
Amazon
DynamoDB
etc..
2. Step Functions
workflow is executed
1. API call made
against API Gateway
Amazon API
Gateway
Clients
AWS Step
Functions
1. API call made
against API Gateway
API Backend
19. Lambda
function
2. Lambda invoked via rule
1. Error message gets sent
back to SES on delivery
attempt
Amazon
SES
Email failure
notification
Lambda
function
2. Lambda invoked
per matching trigger
1. User registration/
login/forgotten password
Amazon
Cognito
Users
Application Users
20. Databases
Lambda
function
3. Lambda invoked
1. Query executed
Amazon
Aurora - MySQL
SQL Query
2. Stored
Procedure Called
1. Items Inserted/
Updated/ Deleted
Lambda
function
3. Lambda polls
stream
Amazon
Kinesis
Stream
4. Kinesis
returns
stream data
items
DynamoDB
Table
2. Event published
to Kinesis Stream