Microservices
• Chose Framework
• Define Principles
• Develop
• Deploy – CI/CD - ELB - Capacity Planning…
Adopting Serverless Architecture
Adopting Serverless
Culture
Architecture
Guruprasad Holla
Founder, Quiznext
Head of Engineering @Vidyanext
Principle Architect @Harman, @ADITI
15+Years building solutions for ISVs, B2B and B2C
QuizNext- 3x Practice App for CBSE&ICSE
• Gamified learning app
• Supports real time 1:1 challenges, Delivers Quizzes, Live
completions for CBSE/ICSE 6-10
• Backed completely by serverless
• ~100K users
• 10M+ Server calls
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
• Amplify client for GraphQL
• Two API end points
• Content Access
• Quiz Service - user data,
performance, points,
challenges etc
• Subscriptions for live challenges and
leader board updates
• In app notifications
• GraphQL - Offline access to data
AWS AppSync
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
• User authentication
• Phone number validation
• OTP Verification(SNS)
Amazon Cognito
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
• User data, Challenges data,
recommendations and some content
meta data
• Most of direct CRUD operations are
driven by Appsync – dynamo db
templates
• Some data access is routed through
lambda functions
Amazon DynamoDB
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
• Question Content storage
• Question Templates, Live
quiz questions
• Dynamo DB archived
elements
• App Images
AWS S3
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
• Triggered from appsync
• Event driven cleanup jobs
• ranking jobs
• test creation jobs etc
• Recommendation generations
• SQS based auto respond jobs
• In memory cache
AWS Lambda
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
QuizNext
Architecture
(AWS)
AWS Cloud
AWS Lambda
Amazon CloudWatch
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
Amazon Simple
Notification Service
Amazon Simple
Queue Service
Amazon Athena
QuizNext
Architecture
AWS Cloud
AWS Lambda
Cloud Watch
Events
Amazon Cognito
AWS S3
GraphQL
AWS AppSync
Amazon DynamoDB
Amazon Pinpoint
SNS
SQS
Amazon Athena
Amazon EC2
How did we land here?
Webhooks for CRM
• HA Service for sales reversal
• Not too simple, not too complex
• Unpredictable load
• Internal CRM Users
• Stateless
Amazon API Gateway
AWS Lambda
Payment Receiver Webhook
• HA Service
• Used only during end of the month
• High traceability and logging
• Independent DB
• CRM Integration
Amazon API Gateway
AWS Lambda
Amazon DynamoDB
Today at QuizNext
< 100$/Month to
support 20K active
users
AppSync 10M server
calls a month for
20$
0 downtime
Incremental
deployments
No peak time panics No log cleaning, disc
overrun etc
3 environments
automated by cloud
formation
All configurations are backed
on Git
What did we learn?
“Change the way we look at services”
FaaS
Function 1
Function 2
Function 3
Function 4
Function 5
+ BaaS
Think about scale on day 1
• Is your implementation scalable?
• Can code run multi instance?
• Will your code timeout?
• DynamoDB Scan vs Query
• Indexes, Composite keys
• Host affinity?
Think about atomicity
• Triggers are not evil
• Resources as packages
• Explore SQS, S3, Cloudwatch etc
Update Score
Calculate Rank
Update Score
Trigger Ranker
Calculate Rank
Think of micro jobs
• Explore triggers
• Can we delay this?
• Can we clean it up later?
• Aggregation, rollups etc
• Look for timeouts
Update Score
Calculate Rank
MVP at architecture level
• Know your extension options
• Throwing hardware/resource is easy and cheaper
• Cost of redesign is smaller
Resolver
Templates
Think about cost
• Understand how you are billed
• Its complicated - so tag resources
• Use cost explorer and breakdown costing data
• Set min capacity for dev/test environment
Think about UX
• Are you writing critical data?
• When do you need confirmations
• What can be delay executed
Update Score
Calculate Rank
Update Score
Trigger Ranker
Calculate Rank
Be script ready
Everything is programmable
• Migrations are easy
• You can modify resources
• You can modify configs
Do not overengineer
• You can do it later
Explore tooling
Questions?
Thank you
g p r a s a d h o l l a
Guruprasad Holla
#serverless #aws #gamification #edtech

Serverless Culture

  • 2.
  • 3.
    • Chose Framework •Define Principles • Develop • Deploy – CI/CD - ELB - Capacity Planning…
  • 5.
  • 6.
  • 7.
    Guruprasad Holla Founder, Quiznext Headof Engineering @Vidyanext Principle Architect @Harman, @ADITI 15+Years building solutions for ISVs, B2B and B2C
  • 8.
    QuizNext- 3x PracticeApp for CBSE&ICSE • Gamified learning app • Supports real time 1:1 challenges, Delivers Quizzes, Live completions for CBSE/ICSE 6-10 • Backed completely by serverless • ~100K users • 10M+ Server calls
  • 9.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena
  • 10.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena • Amplify client for GraphQL • Two API end points • Content Access • Quiz Service - user data, performance, points, challenges etc • Subscriptions for live challenges and leader board updates • In app notifications • GraphQL - Offline access to data AWS AppSync
  • 11.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena • User authentication • Phone number validation • OTP Verification(SNS) Amazon Cognito
  • 12.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena • User data, Challenges data, recommendations and some content meta data • Most of direct CRUD operations are driven by Appsync – dynamo db templates • Some data access is routed through lambda functions Amazon DynamoDB
  • 13.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena • Question Content storage • Question Templates, Live quiz questions • Dynamo DB archived elements • App Images AWS S3
  • 14.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena • Triggered from appsync • Event driven cleanup jobs • ranking jobs • test creation jobs etc • Recommendation generations • SQS based auto respond jobs • In memory cache AWS Lambda
  • 15.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena
  • 16.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena
  • 17.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena
  • 18.
    QuizNext Architecture (AWS) AWS Cloud AWS Lambda AmazonCloudWatch Cloud Watch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint Amazon Simple Notification Service Amazon Simple Queue Service Amazon Athena
  • 19.
    QuizNext Architecture AWS Cloud AWS Lambda CloudWatch Events Amazon Cognito AWS S3 GraphQL AWS AppSync Amazon DynamoDB Amazon Pinpoint SNS SQS Amazon Athena Amazon EC2
  • 20.
    How did weland here?
  • 21.
    Webhooks for CRM •HA Service for sales reversal • Not too simple, not too complex • Unpredictable load • Internal CRM Users • Stateless Amazon API Gateway AWS Lambda
  • 22.
    Payment Receiver Webhook •HA Service • Used only during end of the month • High traceability and logging • Independent DB • CRM Integration Amazon API Gateway AWS Lambda Amazon DynamoDB
  • 23.
    Today at QuizNext <100$/Month to support 20K active users AppSync 10M server calls a month for 20$ 0 downtime Incremental deployments No peak time panics No log cleaning, disc overrun etc 3 environments automated by cloud formation All configurations are backed on Git
  • 24.
  • 26.
    “Change the waywe look at services”
  • 27.
    FaaS Function 1 Function 2 Function3 Function 4 Function 5 + BaaS
  • 28.
    Think about scaleon day 1 • Is your implementation scalable? • Can code run multi instance? • Will your code timeout? • DynamoDB Scan vs Query • Indexes, Composite keys • Host affinity?
  • 29.
    Think about atomicity •Triggers are not evil • Resources as packages • Explore SQS, S3, Cloudwatch etc Update Score Calculate Rank Update Score Trigger Ranker Calculate Rank
  • 30.
    Think of microjobs • Explore triggers • Can we delay this? • Can we clean it up later? • Aggregation, rollups etc • Look for timeouts Update Score Calculate Rank
  • 31.
    MVP at architecturelevel • Know your extension options • Throwing hardware/resource is easy and cheaper • Cost of redesign is smaller Resolver Templates
  • 32.
    Think about cost •Understand how you are billed • Its complicated - so tag resources • Use cost explorer and breakdown costing data • Set min capacity for dev/test environment
  • 33.
    Think about UX •Are you writing critical data? • When do you need confirmations • What can be delay executed Update Score Calculate Rank Update Score Trigger Ranker Calculate Rank
  • 34.
    Be script ready Everythingis programmable • Migrations are easy • You can modify resources • You can modify configs Do not overengineer • You can do it later Explore tooling
  • 35.
  • 37.
    Thank you g pr a s a d h o l l a Guruprasad Holla #serverless #aws #gamification #edtech