SlideShare a Scribd company logo
1 of 29
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How HSBC Uses Serverless to Process
Millions of Transactions in Real Time
Mainframe to Mobile In Near Real-Time using Serverless Technologies
Srimanth Rudraraju
Lead Digital Solutions Architect
HSBC
S e s s i o n I D : F S V 3 0 5
Santiago Freitas
Principal Solutions Architect
AWS Global Financial Services
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Objective
• Provide a reference architecture to build a distributed system leveraging
serverless services
• Share the lessons learned so you don’t make the same mistakes we did….
Instead you make new ones 
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
• HSBC Overview
• Customer Centric Communications
• Realtime Serverless Event Processing
• Design Considerations and Lessons Learned
• Monitoring and Alerting at Scale
• Key Takeaways
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
HSBC - The Worlds
Leading International
Bank
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The Diversity of our Business makes Technology
Complex
Multiple
banking
platforms
Geographically
dispersed
people and
systems
Highly
regulated
operating
environment
Rapidly
evolving
customer
needs and
expectations
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
HSBC Digital
• Simplification
• Innovation
• Better Customer Experiences
delivery
velocity value and
insights
more quickly
engaging
experiences
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Reasons to communicate
We’re here to make customers’ lives simple, so they can focus on what
matters
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Solution Overview
HSBC UK
Mainframes
Mapper
EMR
Spark
Kinesis
StreamsDirect
Connect
Customer Preferences
DynamoDB Lambda API Gateway
Data Service
AuroraEMRDynamoDBAPI GatewayKinesis
Streams
Event Engine
Kinesis
Streams
Lambda
Push Notifications
Notification Service
API GatewayKinesis
Streams
Lambda
Message Service
API GatewayDynamoDBKinesis
Streams
Lambda
JSON
ASCII
Dead Letter Queues
SNSSQSVPC CloudWatch KMS
Common Services
EU-West-1
AVRO
EBCDIC
Kafka
AVRO
EBCDIC
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Kinesis Data Streams (KDS) key concepts
• Shard: base throughput unit of a stream.
Contains an ordered sequence of records
ordered by arrival time.
• Data Stream: logical grouping of shards.
• Partition Key: a identifier specified by
data producer used to route data records
to different shards.
• Producer: sends records to a stream and
assign partition keys to records.
• Data Record: composed of a sequence
number, partition key, and data blob.
• Consumer: retrieves data from a shard in
a stream.
Lambda functions
Lambda functions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda with KDS - Scaling Behavior
• Number of Kinesis Data Streams shards is the unit
of concurrency
• E.g. 10 shards = 10 concurrent executions
• FIFO behaviour is per shard
• If there are no records in a shard, the respective
execution environment may go cold
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda with Kinesis Data Streams
• Subscribe Lambda functions to automatically read batches of records off your
Kinesis Data Streams stream. Lambda polls the stream.
• When (not if) exception occurs, the shard is blocked but records from the other
shards do not throw errors and will proceed as normal
• No default Dead Letter Queues (DLQ) – you need to build one
Any Endpoint
Remote Call
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
We need a repeatable unique correlation ID
Infosphere CDC Kafka
Avro
Payload =
ID +
Transaction Data
NiFi
Avro
Payload =
ID +
Transaction Data
“Throughout the system we use the ID generated at source to track a transaction end to end”
JSON
Kinesis Event
Lambda
Processor
JSON
put-record
Kinesis Data
Streams (KDS)
{
"Data": ID + Transaction Data,
"PartitionKey": "ID",
"StreamName": "name"
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Processing records at most once and at least once
Kinesis Data
Streams (KDS)
Function Invocation
“ID”
Service State
Table
{
id: “a8098c1a-f86e-11da-bd1a”,
id_state: “processed”,
processed_tstamp: “1538747486”
}
Batch
Kinesis Data
Streams (KDS)
Shards Shards
SNSSQS
Error
Replay
Same pattern with “Service State Table”
repeated within each service
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda and Kinesis Data Streams Lessons Learned
• Increasing number of Kinesis Data Streams shards may not increase system
performance, batch size matters. Perform load test.
• Consider the impact of language and VPC usage on Lambda startup time vs. Lambda
execution time
• Java-based functions start slower vs. Python/Node but executes faster
• 3GB memory isn’t always fastest for VPC attached Lambdas. Most optimum mem
allocation for Java-based functions was 1GB. Consider ENI-reuse.
• Consider pre-warming VPC attached functions to achieve your latency SLA
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Providing internet access in a highly controlled way
Internet
Proxy Fleet
Network Load
Balancer
EU-West-1-A
Internet
Proxy Fleet
EU-West-1-B EU-West-1-C
Internet
Proxy Fleet
Auto Scaling / Endpoint Service
VPC
Endpoint
Application
Lambda
security group
Internet
gateway
• Lambda can optionally be attached to a VPC. At HSBC all Lambdas are within a VPC
• Internet access is controlled by an immutable sidecar proxy fleet with a restricted whitelist
• Design limits blast radius if any malicious code is deployed to a function
• Removed the requirement for VPC peering, simplifying routing tables and increasing isolation between VPCs
Notification
Service VPC
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Loosely coupled network architecture to enable scale
EU-West-1-A EU-West-1-B EU-West-1-C
Platform VPC
Bank bound VPC
Endpoint
VPC subnet
1 X
…
VPC subnet
1 X
…
VPC subnet
1 X
…
• As VPC attached Lambda function scales, subnets must have available IP addresses to
match the number of ENIs = large CIDR block required to your VPC
• Access to on-premise provided via VPC endpoint which encapsulates a set of proxy servers
located on a VPC with Direct Connect = small CIDR used on VPC connected to on-premise
Large CIDR block
Bank Bound
Proxy Fleet
EU-West-1-A
Bank Bound
Proxy Fleet
EU-West-1-B EU-West-1-C
Bank Bound
Proxy Fleet
Platform DX VPC
Endpoint service
Network
Load
Balancer
Small CIDR block
HSBC UK
Direct
Connect
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Networking lessons learned
• Have a network resource as part your cross-functional team, will save you time
• Consider isolating Lambda functions within a VPC with a large CIDR to ensure
that if you are scaling, you don’t run out of IP addresses
• Lambda functions attached to a VPC support Security Group and VPC Flow Logs,
your security team may require them
• Lambda Invoke API is not available as a VPC endpoint, caused functions
previously working outside a VPC to fail. Alternatively use API GW or Kinesis
Data Streams
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Monitoring and Alerting
• Key Metrics
• Throughput
• Latency
• Errors
• System Health
CloudWatch
Custom Metrics
Out of the box
Metrics
Poll Data
• Key Challenges
• Calculating Latency across
serverless components
• AWS Tagging strategy to make
sense of metrics in DataDog
Dashboards
Alerts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dashboards
• Automatically deployed via
pipeline alongside app code
• Logically grouped by app and
infra services
• Leverages anomaly detection
for smart detection and
interpretation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Key Takeaways
• Follow the principle of "extract data once and reuse multiple times” to power new
customer experiences
• Generating a repeatable correlation ID from source is critical in a distributed system
• Perform load tests to fine tune your system and identify choke points
• Know the AWS services soft and hard limits
• Plan your network architecture to provide service isolation and to support production scale
• Consider how to unify your existing and cloud operation model – logging, monitoring and
alerting
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

AWS Control Tower
AWS Control TowerAWS Control Tower
AWS Control TowerCloudHesive
 
10월 웨비나 - AWS에서 Active Directory 구축 및 연동 옵션 살펴보기 (김용우 솔루션즈 아키텍트)
10월 웨비나 - AWS에서 Active Directory 구축 및 연동 옵션 살펴보기 (김용우 솔루션즈 아키텍트)10월 웨비나 - AWS에서 Active Directory 구축 및 연동 옵션 살펴보기 (김용우 솔루션즈 아키텍트)
10월 웨비나 - AWS에서 Active Directory 구축 및 연동 옵션 살펴보기 (김용우 솔루션즈 아키텍트)Amazon Web Services Korea
 
Serverless computing with AWS Lambda
Serverless computing with AWS Lambda Serverless computing with AWS Lambda
Serverless computing with AWS Lambda Apigee | Google Cloud
 
The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019
The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019 The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019
The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019 Amazon Web Services
 
Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...Amazon Web Services
 
AWS Security Best Practices and Design Patterns
AWS Security Best Practices and Design PatternsAWS Security Best Practices and Design Patterns
AWS Security Best Practices and Design PatternsAmazon Web Services
 
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019 Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019 Amazon Web Services
 
AWS Security Week: AWS Secrets Manager
AWS Security Week: AWS Secrets ManagerAWS Security Week: AWS Secrets Manager
AWS Security Week: AWS Secrets ManagerAmazon Web Services
 
Deploy and Govern at Scale with AWS Control Tower
Deploy and Govern at Scale with AWS Control TowerDeploy and Govern at Scale with AWS Control Tower
Deploy and Govern at Scale with AWS Control TowerAmazon Web Services
 
Managing and governing multi-account AWS environments using AWS Organizations...
Managing and governing multi-account AWS environments using AWS Organizations...Managing and governing multi-account AWS environments using AWS Organizations...
Managing and governing multi-account AWS environments using AWS Organizations...Amazon Web Services
 
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
Elastic  Load Balancing Deep Dive - AWS Online Tech TalkElastic  Load Balancing Deep Dive - AWS Online Tech Talk
Elastic Load Balancing Deep Dive - AWS Online Tech TalkAmazon Web Services
 
Automated Solution for Deploying AWS Landing Zone (GPSWS407) - AWS re:Invent ...
Automated Solution for Deploying AWS Landing Zone (GPSWS407) - AWS re:Invent ...Automated Solution for Deploying AWS Landing Zone (GPSWS407) - AWS re:Invent ...
Automated Solution for Deploying AWS Landing Zone (GPSWS407) - AWS re:Invent ...Amazon Web Services
 
Introduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesIntroduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesGary Silverman
 
Various Cloud offerings AWS/AZURE/GCP
Various Cloud offerings AWS/AZURE/GCPVarious Cloud offerings AWS/AZURE/GCP
Various Cloud offerings AWS/AZURE/GCPMohammad Imran Ansari
 

What's hot (20)

Deep Dive on AWS Lambda
Deep Dive on AWS LambdaDeep Dive on AWS Lambda
Deep Dive on AWS Lambda
 
AWS Control Tower
AWS Control TowerAWS Control Tower
AWS Control Tower
 
HSBC and AWS
HSBC and AWSHSBC and AWS
HSBC and AWS
 
10월 웨비나 - AWS에서 Active Directory 구축 및 연동 옵션 살펴보기 (김용우 솔루션즈 아키텍트)
10월 웨비나 - AWS에서 Active Directory 구축 및 연동 옵션 살펴보기 (김용우 솔루션즈 아키텍트)10월 웨비나 - AWS에서 Active Directory 구축 및 연동 옵션 살펴보기 (김용우 솔루션즈 아키텍트)
10월 웨비나 - AWS에서 Active Directory 구축 및 연동 옵션 살펴보기 (김용우 솔루션즈 아키텍트)
 
Serverless computing with AWS Lambda
Serverless computing with AWS Lambda Serverless computing with AWS Lambda
Serverless computing with AWS Lambda
 
The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019
The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019 The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019
The fundamentals of AWS cloud security - FND209-R - AWS re:Inforce 2019
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...Using AWS Control Tower to govern multi-account AWS environments at scale - G...
Using AWS Control Tower to govern multi-account AWS environments at scale - G...
 
Boot camp - Migration to AWS
Boot camp - Migration to AWSBoot camp - Migration to AWS
Boot camp - Migration to AWS
 
AWS Security Best Practices and Design Patterns
AWS Security Best Practices and Design PatternsAWS Security Best Practices and Design Patterns
AWS Security Best Practices and Design Patterns
 
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019 Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
Security best practices the well-architected way - SDD318 - AWS re:Inforce 2019
 
AWS Security Week: AWS Secrets Manager
AWS Security Week: AWS Secrets ManagerAWS Security Week: AWS Secrets Manager
AWS Security Week: AWS Secrets Manager
 
AWS Lambda Features and Uses
AWS Lambda Features and UsesAWS Lambda Features and Uses
AWS Lambda Features and Uses
 
Deploy and Govern at Scale with AWS Control Tower
Deploy and Govern at Scale with AWS Control TowerDeploy and Govern at Scale with AWS Control Tower
Deploy and Govern at Scale with AWS Control Tower
 
Managing and governing multi-account AWS environments using AWS Organizations...
Managing and governing multi-account AWS environments using AWS Organizations...Managing and governing multi-account AWS environments using AWS Organizations...
Managing and governing multi-account AWS environments using AWS Organizations...
 
Intro to AWS Lambda
Intro to AWS Lambda Intro to AWS Lambda
Intro to AWS Lambda
 
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
Elastic  Load Balancing Deep Dive - AWS Online Tech TalkElastic  Load Balancing Deep Dive - AWS Online Tech Talk
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
 
Automated Solution for Deploying AWS Landing Zone (GPSWS407) - AWS re:Invent ...
Automated Solution for Deploying AWS Landing Zone (GPSWS407) - AWS re:Invent ...Automated Solution for Deploying AWS Landing Zone (GPSWS407) - AWS re:Invent ...
Automated Solution for Deploying AWS Landing Zone (GPSWS407) - AWS re:Invent ...
 
Introduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesIntroduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best Practices
 
Various Cloud offerings AWS/AZURE/GCP
Various Cloud offerings AWS/AZURE/GCPVarious Cloud offerings AWS/AZURE/GCP
Various Cloud offerings AWS/AZURE/GCP
 

Similar to How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FSV305) - AWS re:Invent 2018

PrivateLink for Partners: Connectivity, Scale, Security (GPSTEC306) - AWS re:...
PrivateLink for Partners: Connectivity, Scale, Security (GPSTEC306) - AWS re:...PrivateLink for Partners: Connectivity, Scale, Security (GPSTEC306) - AWS re:...
PrivateLink for Partners: Connectivity, Scale, Security (GPSTEC306) - AWS re:...Amazon Web Services
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingAmazon Web Services
 
Microservices & Data Design: Database Week SF
Microservices & Data Design: Database Week SFMicroservices & Data Design: Database Week SF
Microservices & Data Design: Database Week SFAmazon Web Services
 
Microservices and Data Design
Microservices and Data DesignMicroservices and Data Design
Microservices and Data DesignAWS Germany
 
Microservices & Data Design: Database Week San Francisco
Microservices & Data Design: Database Week San FranciscoMicroservices & Data Design: Database Week San Francisco
Microservices & Data Design: Database Week San FranciscoAmazon Web Services
 
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...Amazon Web Services
 
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft BroadridgeAWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft BroadridgeAmazon Web Services
 
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)Amazon Web Services
 
Microservices: Data & Design - Miguel Cervantes
Microservices: Data & Design - Miguel CervantesMicroservices: Data & Design - Miguel Cervantes
Microservices: Data & Design - Miguel CervantesAmazon Web Services
 
Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018
Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018
Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018Amazon Web Services
 
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018Amazon Web Services
 
Building Modern Applications on AWS.pptx
Building Modern Applications on AWS.pptxBuilding Modern Applications on AWS.pptx
Building Modern Applications on AWS.pptxNelson Kimathi
 
Cloud DevSecOps and compliance considerations leveraging AWS Marketplace sellers
Cloud DevSecOps and compliance considerations leveraging AWS Marketplace sellersCloud DevSecOps and compliance considerations leveraging AWS Marketplace sellers
Cloud DevSecOps and compliance considerations leveraging AWS Marketplace sellersAmazon Web Services
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesVladimir Simek
 
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 SRV205 Architectures and Strategies for Building Modern Applications on AWS SRV205 Architectures and Strategies for Building Modern Applications on AWS
SRV205 Architectures and Strategies for Building Modern Applications on AWSAmazon Web Services
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Amazon Web Services
 
Serverless Stream Processing Pipeline Best Practices (SRV316-R1) - AWS re:Inv...
Serverless Stream Processing Pipeline Best Practices (SRV316-R1) - AWS re:Inv...Serverless Stream Processing Pipeline Best Practices (SRV316-R1) - AWS re:Inv...
Serverless Stream Processing Pipeline Best Practices (SRV316-R1) - AWS re:Inv...Amazon Web Services
 
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...Amazon Web Services
 

Similar to How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FSV305) - AWS re:Invent 2018 (20)

PrivateLink for Partners: Connectivity, Scale, Security (GPSTEC306) - AWS re:...
PrivateLink for Partners: Connectivity, Scale, Security (GPSTEC306) - AWS re:...PrivateLink for Partners: Connectivity, Scale, Security (GPSTEC306) - AWS re:...
PrivateLink for Partners: Connectivity, Scale, Security (GPSTEC306) - AWS re:...
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
 
Microservices & Data Design: Database Week SF
Microservices & Data Design: Database Week SFMicroservices & Data Design: Database Week SF
Microservices & Data Design: Database Week SF
 
Microservices and Data Design
Microservices and Data DesignMicroservices and Data Design
Microservices and Data Design
 
Microservices & Data Design: Database Week San Francisco
Microservices & Data Design: Database Week San FranciscoMicroservices & Data Design: Database Week San Francisco
Microservices & Data Design: Database Week San Francisco
 
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
 
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft BroadridgeAWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
 
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
運用 AWS Edge Services 作為遊戲行業的關鍵基礎設施元件 (Level 200)
 
Microservices & Data Design
Microservices & Data DesignMicroservices & Data Design
Microservices & Data Design
 
Microservices: Data & Design - Miguel Cervantes
Microservices: Data & Design - Miguel CervantesMicroservices: Data & Design - Miguel Cervantes
Microservices: Data & Design - Miguel Cervantes
 
Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018
Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018
Driving Innovation with Serverless Applications (GPSBUS212) - AWS re:Invent 2018
 
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
 
Building Modern Applications on AWS.pptx
Building Modern Applications on AWS.pptxBuilding Modern Applications on AWS.pptx
Building Modern Applications on AWS.pptx
 
Cloud DevSecOps and compliance considerations leveraging AWS Marketplace sellers
Cloud DevSecOps and compliance considerations leveraging AWS Marketplace sellersCloud DevSecOps and compliance considerations leveraging AWS Marketplace sellers
Cloud DevSecOps and compliance considerations leveraging AWS Marketplace sellers
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best Practices
 
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 SRV205 Architectures and Strategies for Building Modern Applications on AWS SRV205 Architectures and Strategies for Building Modern Applications on AWS
SRV205 Architectures and Strategies for Building Modern Applications on AWS
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
 
Serverless Stream Processing Pipeline Best Practices (SRV316-R1) - AWS re:Inv...
Serverless Stream Processing Pipeline Best Practices (SRV316-R1) - AWS re:Inv...Serverless Stream Processing Pipeline Best Practices (SRV316-R1) - AWS re:Inv...
Serverless Stream Processing Pipeline Best Practices (SRV316-R1) - AWS re:Inv...
 
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
Enabling Your Organization’s Amazon Redshift Adoption – Going from Zero to He...
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

How HSBC Uses Serverless to Process Millions of Transactions in Real Time (FSV305) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How HSBC Uses Serverless to Process Millions of Transactions in Real Time Mainframe to Mobile In Near Real-Time using Serverless Technologies Srimanth Rudraraju Lead Digital Solutions Architect HSBC S e s s i o n I D : F S V 3 0 5 Santiago Freitas Principal Solutions Architect AWS Global Financial Services
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Objective • Provide a reference architecture to build a distributed system leveraging serverless services • Share the lessons learned so you don’t make the same mistakes we did…. Instead you make new ones 
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda • HSBC Overview • Customer Centric Communications • Realtime Serverless Event Processing • Design Considerations and Lessons Learned • Monitoring and Alerting at Scale • Key Takeaways
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. HSBC - The Worlds Leading International Bank
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The Diversity of our Business makes Technology Complex Multiple banking platforms Geographically dispersed people and systems Highly regulated operating environment Rapidly evolving customer needs and expectations
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. HSBC Digital • Simplification • Innovation • Better Customer Experiences delivery velocity value and insights more quickly engaging experiences
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Reasons to communicate We’re here to make customers’ lives simple, so they can focus on what matters
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Solution Overview HSBC UK Mainframes Mapper EMR Spark Kinesis StreamsDirect Connect Customer Preferences DynamoDB Lambda API Gateway Data Service AuroraEMRDynamoDBAPI GatewayKinesis Streams Event Engine Kinesis Streams Lambda Push Notifications Notification Service API GatewayKinesis Streams Lambda Message Service API GatewayDynamoDBKinesis Streams Lambda JSON ASCII Dead Letter Queues SNSSQSVPC CloudWatch KMS Common Services EU-West-1 AVRO EBCDIC Kafka AVRO EBCDIC
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Kinesis Data Streams (KDS) key concepts • Shard: base throughput unit of a stream. Contains an ordered sequence of records ordered by arrival time. • Data Stream: logical grouping of shards. • Partition Key: a identifier specified by data producer used to route data records to different shards. • Producer: sends records to a stream and assign partition keys to records. • Data Record: composed of a sequence number, partition key, and data blob. • Consumer: retrieves data from a shard in a stream. Lambda functions Lambda functions
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambda with KDS - Scaling Behavior • Number of Kinesis Data Streams shards is the unit of concurrency • E.g. 10 shards = 10 concurrent executions • FIFO behaviour is per shard • If there are no records in a shard, the respective execution environment may go cold
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambda with Kinesis Data Streams • Subscribe Lambda functions to automatically read batches of records off your Kinesis Data Streams stream. Lambda polls the stream. • When (not if) exception occurs, the shard is blocked but records from the other shards do not throw errors and will proceed as normal • No default Dead Letter Queues (DLQ) – you need to build one Any Endpoint Remote Call
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. We need a repeatable unique correlation ID Infosphere CDC Kafka Avro Payload = ID + Transaction Data NiFi Avro Payload = ID + Transaction Data “Throughout the system we use the ID generated at source to track a transaction end to end” JSON Kinesis Event Lambda Processor JSON put-record Kinesis Data Streams (KDS) { "Data": ID + Transaction Data, "PartitionKey": "ID", "StreamName": "name" }
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Processing records at most once and at least once Kinesis Data Streams (KDS) Function Invocation “ID” Service State Table { id: “a8098c1a-f86e-11da-bd1a”, id_state: “processed”, processed_tstamp: “1538747486” } Batch Kinesis Data Streams (KDS) Shards Shards SNSSQS Error Replay Same pattern with “Service State Table” repeated within each service
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda and Kinesis Data Streams Lessons Learned • Increasing number of Kinesis Data Streams shards may not increase system performance, batch size matters. Perform load test. • Consider the impact of language and VPC usage on Lambda startup time vs. Lambda execution time • Java-based functions start slower vs. Python/Node but executes faster • 3GB memory isn’t always fastest for VPC attached Lambdas. Most optimum mem allocation for Java-based functions was 1GB. Consider ENI-reuse. • Consider pre-warming VPC attached functions to achieve your latency SLA
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Providing internet access in a highly controlled way Internet Proxy Fleet Network Load Balancer EU-West-1-A Internet Proxy Fleet EU-West-1-B EU-West-1-C Internet Proxy Fleet Auto Scaling / Endpoint Service VPC Endpoint Application Lambda security group Internet gateway • Lambda can optionally be attached to a VPC. At HSBC all Lambdas are within a VPC • Internet access is controlled by an immutable sidecar proxy fleet with a restricted whitelist • Design limits blast radius if any malicious code is deployed to a function • Removed the requirement for VPC peering, simplifying routing tables and increasing isolation between VPCs Notification Service VPC
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Loosely coupled network architecture to enable scale EU-West-1-A EU-West-1-B EU-West-1-C Platform VPC Bank bound VPC Endpoint VPC subnet 1 X … VPC subnet 1 X … VPC subnet 1 X … • As VPC attached Lambda function scales, subnets must have available IP addresses to match the number of ENIs = large CIDR block required to your VPC • Access to on-premise provided via VPC endpoint which encapsulates a set of proxy servers located on a VPC with Direct Connect = small CIDR used on VPC connected to on-premise Large CIDR block Bank Bound Proxy Fleet EU-West-1-A Bank Bound Proxy Fleet EU-West-1-B EU-West-1-C Bank Bound Proxy Fleet Platform DX VPC Endpoint service Network Load Balancer Small CIDR block HSBC UK Direct Connect
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Networking lessons learned • Have a network resource as part your cross-functional team, will save you time • Consider isolating Lambda functions within a VPC with a large CIDR to ensure that if you are scaling, you don’t run out of IP addresses • Lambda functions attached to a VPC support Security Group and VPC Flow Logs, your security team may require them • Lambda Invoke API is not available as a VPC endpoint, caused functions previously working outside a VPC to fail. Alternatively use API GW or Kinesis Data Streams
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Monitoring and Alerting • Key Metrics • Throughput • Latency • Errors • System Health CloudWatch Custom Metrics Out of the box Metrics Poll Data • Key Challenges • Calculating Latency across serverless components • AWS Tagging strategy to make sense of metrics in DataDog Dashboards Alerts
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Dashboards • Automatically deployed via pipeline alongside app code • Logically grouped by app and infra services • Leverages anomaly detection for smart detection and interpretation
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Key Takeaways • Follow the principle of "extract data once and reuse multiple times” to power new customer experiences • Generating a repeatable correlation ID from source is critical in a distributed system • Perform load tests to fine tune your system and identify choke points • Know the AWS services soft and hard limits • Plan your network architecture to provide service isolation and to support production scale • Consider how to unify your existing and cloud operation model – logging, monitoring and alerting
  • 28. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.