SlideShare a Scribd company logo
1 of 54
Download to read offline
Production Ready
Microservices
at scale
Rajeev N B

@rBharshetty 

GO-JEK
Transport, Logistics, Hyperlocal
delivery and Payments
• 18 Products
• 1m+ Drivers
• 500+ Microservices
• 15k+ Cores
• 2 Cloud Providers
• 6 Data centers
• 100+ million bookings per month
Agenda
• What are Production Ready Microservices ?

• Why do we need them ?

• How do we build them ?
What is Production Ready ?
• Stable

• Reliable

• Scalable

• Performant

• Fault Tolerant

• Monitored

• Prepared for Catastrophe

• Secure
Why ?
• Goal is Availability

• Trust services you put in Production

• Organisational Sprawl

• Increased Development Velocity

• Technical Sprawl
How ?
Production
Readiness Checklist
#1. Code Quality
Linting/
Formatting
• Statically analyse linting and
formatting errors

• Follow Ruby Style Guide

• Helps maintain Code sanity

• Use tools like Rubocop
• `rubocop -a` to autofix certain
errors
Code Smells
• Statically analyse code for code
smells like Long Parameter list,
Cyclomatic Complexity,
Uncommunicative name etc
• Easy to change codebases

• Use tools like Reek
Secure coding
• Statically analyse code for Security
vulnerabilities
• Identify security issues like XSS,
CSRF, SQL Injection etc

• Use tools like Brakeman
• Identify issues with various
confidence levels
#1. Code Quality
• Make it part of your development
process

• Also deployment pipeline

• Helps avoid bugs creeping in the
code

• Helps achieve Stability and
Reliablity of microservice

• Also helps achieve security
#2. Testing
Unit/Integration Testing
• Unit tests test a unit/function (Individual component)

• Integration tests help in testing components working together

• Contract testing helps test interactions of your micro service with its
dependencies
Contract Testing
Load Testing
• Expose to higher traffic loads to see behaviour

• Makes sure that microservice is ready to accept increased traffic in
future

• Helps identify scalability challenges and bottlenecks

• Helps in determining SLA of a service

• Load testing at GO-JEK using Gatling
Chaos Testing
• Helps determine Unknown Unknowns
• Type of Resiliency testing

• Break systems to understand behaviour

• At GO-JEK ? Manual

• Automated ? Simian Army
#2. Testing
• Can be automated

• Make it part of your development
process

• Also deployment pipeline

• Builds confidence in code

• Helps with Fault tolerance,
Scalability, Performance, Stability
and Reliability
#3. Resilience Patterns
Timeouts/Retries
• Stop waiting for an answer after certain time - Timeout
• Timeout - Fail Fast

• Retry the request after failure

• Retry - Succeed eventually
Examples - ‘net/http’
http = Net::HTTP.new(host, port)
http.open_timeout = 1
http.read_timeout = 1
Circuit Breaker
• Circumvent calls to dependency when calls fail

• Fallback to a fallback response
• Hystrix is a well known implementation

• jruby-hystrix used internally at GO-JEK (Yet to be open sourced)
Circuit Breaker
module CustomerClient
module Hystrix
class HttpCommand < ::Hystrix::HystrixBaseCommand
SERVER_DOWN_HTTP_STATUS_CODES = [500, 501, 502, 503, 504]
def run
http_response = nil
begin
http_response = request_uri.send(request_method, request_params, request_headers) do|
callback|
callback.on(400..511) do |response|
Wrest.logger.warn("<- #{request_method} #{request_uri}")
Wrest.logger.warn("code: #{response.code}: body: #{response.deserialised_body}")
end
end
if SERVER_DOWN_HTTP_STATUS_CODES.include?(http_response.code.to_i)
raise "Server Error with response code #{http_response.code.to_i}"
end
build_response(http_response)
rescue => e
raise HttpCommandException.new(request_uri, request_headers, request_params,
http_response), e.message
end
end
end
end
end
jruby-hystrix
#3. Resiliency
Patterns
• Protect systems from failures of its
dependencies

• Protect dependency when it has
started to fail

• Fail Fast and Succeed Eventually

• Helps with Fault tolerance,
Scalability, Stability and Reliability
#4. Observability
Logging
• Describes state of the micro service

• Helps debugging root cause of an issue

• Structured logging

• Logging needs to be scalable, available and easily accessible (Log
centralisation)

• Logging in Ruby
Instrumentation in Code
• Microservice Key metrics (Latencies, errors, api responses etc) -
newrelic_rpm

• StatsD metrics (statsd-instrument) - Custom metrics
• Exception and error tracking metrics (sentry-raven)
StatsD
Initialisation:
`StatsD.backend = case Rails.env
when 'production', 'staging'
StatsD::Instrument::Backends::UDPBackend.new(“local:8125”, :datadog)
when 'test'
StatsD::Instrument::Backends::NullBackend.new
else
StatsD::Instrument::Backends::LoggerBackend.new(StatsD.logger)
end`
Counter:
StatsD.increment(‘customer.login.device.ratelimit.count’)`
Gauge:
StatsD.gauge(‘booking.queued', 12, sample_rate: 1.0)
Dashboards
• Capture Key metrics

• USE (Utilisation, Saturation, Errors)

• RED (Request Rate, Error Rate, Duration)

• CPU, RAM, database connections, latencies etc

• Should represent Health of a service

• Grafana/NewRelic dashboards at GO-JEK
NewRelic - Service level
Grafana - System level
Uptime Dashboard
Alerting
• Alert when failures are detected or changes in key metrics

• Alerts should be actionable
• Answered by people on call/support
• Helps protect availability of systems before they go down

• Alerting at GO-JEK
#4. Observability
• Provides insights into how a service
is behaving and its overall health
• Includes 3 main categories:
Logging, Monitoring and
Distributed Tracing
• Helps in quick incidence response
during outages

• Helps maintain Stability of the
service
#5. CI/CD Pipelines
CI/CD
• Increased Deployment Velocity - 30+ deploys a day

• Bad Deployments major cause of downtimes

• Rollout - Staging -> Production
• Rolling Deploys - Incremental
• Think of Rollbacks at every deployment
Stable Deployment Pipeline
Canary
• Deploy the new change to single node or subset of total nodes

• Monitor key metrics for certain duration

• Promote Canary to Production if all good or else Rollback
• Helps minimise impact of bad deployments in Production
Canary
#5. CI/CD
• Lint/Test/Build/Package/Deploy
steps

• Canaries help have minimal
impacts on Bad deployments

• Rollbacks to minimise impact
• Helps Provide Stability and
Reliability
In Conclusion …
Standardisation is
the Goal
Always being
available is the Goal
More …
• Documentation

• Security

• Capacity Planning

• Outages and Incidence Response (Runbooks)
Future work
• Implementing Production Readiness checklist on the ground

• Review process for micro services

• Production Readiness score

• Automating the checklist
References
• Production Ready Microservices - Susan Fowler

• Google SRE Book

• Microservices Standardisation

• SLA
Thanks for listening
Questions ?
@rBharshetty
@gojektech

More Related Content

What's hot

Thick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptxThick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptxAnurag Srivastava
 
Stinson post si and verification
Stinson post si and verificationStinson post si and verification
Stinson post si and verificationObsidian Software
 
Kafka at Peak Performance
Kafka at Peak PerformanceKafka at Peak Performance
Kafka at Peak PerformanceTodd Palino
 
5º MeetUP ARQconf 2016 - IoT: What is it really and how does it work?
5º MeetUP ARQconf 2016 - IoT: What is it really and how does it work?5º MeetUP ARQconf 2016 - IoT: What is it really and how does it work?
5º MeetUP ARQconf 2016 - IoT: What is it really and how does it work?GlobalLogic Latinoamérica
 
You name it, we analyze it
You name it, we analyze itYou name it, we analyze it
You name it, we analyze itJim Gilsinn
 
Low-Cost ICS Network Performance Testing
Low-Cost ICS Network Performance TestingLow-Cost ICS Network Performance Testing
Low-Cost ICS Network Performance TestingJim Gilsinn
 
Application Performance Management
Application Performance ManagementApplication Performance Management
Application Performance ManagementNoriaki Tatsumi
 
Halo Installfest Slides
Halo Installfest SlidesHalo Installfest Slides
Halo Installfest SlidesCloudPassage
 
Piyush Kumar Gupta
Piyush Kumar GuptaPiyush Kumar Gupta
Piyush Kumar GuptaPiyush Gupta
 
Operating a High Velocity Large Organization with Spring Cloud Microservices
Operating a High Velocity Large Organization with Spring Cloud MicroservicesOperating a High Velocity Large Organization with Spring Cloud Microservices
Operating a High Velocity Large Organization with Spring Cloud MicroservicesNoriaki Tatsumi
 
Free training on Network Configuration Manager - Season 2 - Part 2
Free training on Network Configuration Manager - Season 2 - Part 2Free training on Network Configuration Manager - Season 2 - Part 2
Free training on Network Configuration Manager - Season 2 - Part 2ManageEngine, Zoho Corporation
 
SDNs: hot topics, evolution & research opportunities
SDNs: hot topics, evolution & research opportunitiesSDNs: hot topics, evolution & research opportunities
SDNs: hot topics, evolution & research opportunitiesDiego Kreutz
 
Testing the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the CloudTesting the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the CloudNagarro
 
Mainframe VUG Presentation April 2016
Mainframe VUG Presentation April 2016Mainframe VUG Presentation April 2016
Mainframe VUG Presentation April 2016Serena Software
 
VMworld 2013: Building a Validation Factory for VMware Partners
VMworld 2013: Building a Validation Factory for VMware Partners VMworld 2013: Building a Validation Factory for VMware Partners
VMworld 2013: Building a Validation Factory for VMware Partners VMworld
 
Server and application monitoring webinars [Applications Manager] - Part 3
Server and application monitoring webinars [Applications Manager] - Part 3Server and application monitoring webinars [Applications Manager] - Part 3
Server and application monitoring webinars [Applications Manager] - Part 3ManageEngine, Zoho Corporation
 
Agile infrastructure
Agile infrastructureAgile infrastructure
Agile infrastructureTarun Rajput
 

What's hot (20)

Thick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptxThick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptx
 
Stinson post si and verification
Stinson post si and verificationStinson post si and verification
Stinson post si and verification
 
Kafka at Peak Performance
Kafka at Peak PerformanceKafka at Peak Performance
Kafka at Peak Performance
 
Fluent validation
Fluent validationFluent validation
Fluent validation
 
5º MeetUP ARQconf 2016 - IoT: What is it really and how does it work?
5º MeetUP ARQconf 2016 - IoT: What is it really and how does it work?5º MeetUP ARQconf 2016 - IoT: What is it really and how does it work?
5º MeetUP ARQconf 2016 - IoT: What is it really and how does it work?
 
You name it, we analyze it
You name it, we analyze itYou name it, we analyze it
You name it, we analyze it
 
Low-Cost ICS Network Performance Testing
Low-Cost ICS Network Performance TestingLow-Cost ICS Network Performance Testing
Low-Cost ICS Network Performance Testing
 
Application Performance Management
Application Performance ManagementApplication Performance Management
Application Performance Management
 
Halo Installfest Slides
Halo Installfest SlidesHalo Installfest Slides
Halo Installfest Slides
 
Piyush Kumar Gupta
Piyush Kumar GuptaPiyush Kumar Gupta
Piyush Kumar Gupta
 
Operating a High Velocity Large Organization with Spring Cloud Microservices
Operating a High Velocity Large Organization with Spring Cloud MicroservicesOperating a High Velocity Large Organization with Spring Cloud Microservices
Operating a High Velocity Large Organization with Spring Cloud Microservices
 
Free training on Network Configuration Manager - Season 2 - Part 2
Free training on Network Configuration Manager - Season 2 - Part 2Free training on Network Configuration Manager - Season 2 - Part 2
Free training on Network Configuration Manager - Season 2 - Part 2
 
Performance testing
Performance testingPerformance testing
Performance testing
 
SDNs: hot topics, evolution & research opportunities
SDNs: hot topics, evolution & research opportunitiesSDNs: hot topics, evolution & research opportunities
SDNs: hot topics, evolution & research opportunities
 
Testing the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the CloudTesting the Migration of Monolithic Applications to Microservices on the Cloud
Testing the Migration of Monolithic Applications to Microservices on the Cloud
 
Mainframe VUG Presentation April 2016
Mainframe VUG Presentation April 2016Mainframe VUG Presentation April 2016
Mainframe VUG Presentation April 2016
 
Play With Streams
Play With StreamsPlay With Streams
Play With Streams
 
VMworld 2013: Building a Validation Factory for VMware Partners
VMworld 2013: Building a Validation Factory for VMware Partners VMworld 2013: Building a Validation Factory for VMware Partners
VMworld 2013: Building a Validation Factory for VMware Partners
 
Server and application monitoring webinars [Applications Manager] - Part 3
Server and application monitoring webinars [Applications Manager] - Part 3Server and application monitoring webinars [Applications Manager] - Part 3
Server and application monitoring webinars [Applications Manager] - Part 3
 
Agile infrastructure
Agile infrastructureAgile infrastructure
Agile infrastructure
 

Similar to Production Ready Microservices at Scale

The QA/Testing Process
The QA/Testing ProcessThe QA/Testing Process
The QA/Testing ProcessSynerzip
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)CIVEL Benoit
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1CIVEL Benoit
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Securitysedukull
 
Integration strategies best practices- Mulesoft meetup April 2018
Integration strategies   best practices- Mulesoft meetup April 2018Integration strategies   best practices- Mulesoft meetup April 2018
Integration strategies best practices- Mulesoft meetup April 2018Rohan Rasane
 
12 Factor App Methodology
12 Factor App Methodology12 Factor App Methodology
12 Factor App Methodologylaeshin park
 
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...Lohika_Odessa_TechTalks
 
Tech talk microservices debugging
Tech talk microservices debuggingTech talk microservices debugging
Tech talk microservices debuggingAndrey Kolodnitsky
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applicationsAmit Kejriwal
 
AppSec in an Agile World
AppSec in an Agile WorldAppSec in an Agile World
AppSec in an Agile WorldDavid Lindner
 
Sql azure cluster dashboard public.ppt
Sql azure cluster dashboard public.pptSql azure cluster dashboard public.ppt
Sql azure cluster dashboard public.pptQingsong Yao
 
Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?Katherine Golovinova
 
.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service FabricDavide Benvegnù
 
ANIn Chennai April 2024 |Beyond Big Bang: Technical Agility in Vintage Produc...
ANIn Chennai April 2024 |Beyond Big Bang: Technical Agility in Vintage Produc...ANIn Chennai April 2024 |Beyond Big Bang: Technical Agility in Vintage Produc...
ANIn Chennai April 2024 |Beyond Big Bang: Technical Agility in Vintage Produc...AgileNetwork
 
Performance tuning Grails Applications GR8Conf US 2014
Performance tuning Grails Applications GR8Conf US 2014Performance tuning Grails Applications GR8Conf US 2014
Performance tuning Grails Applications GR8Conf US 2014Lari Hotari
 
Resilience planning and how the empire strikes back
Resilience planning and how the empire strikes backResilience planning and how the empire strikes back
Resilience planning and how the empire strikes backBhakti Mehta
 
Project Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerProject Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerRightScale
 
Wasserman Keynote at ICSSP 2013
Wasserman Keynote at ICSSP 2013Wasserman Keynote at ICSSP 2013
Wasserman Keynote at ICSSP 2013twasserman
 

Similar to Production Ready Microservices at Scale (20)

Journey to the center of DevOps - v6
Journey to the center of DevOps - v6Journey to the center of DevOps - v6
Journey to the center of DevOps - v6
 
The QA/Testing Process
The QA/Testing ProcessThe QA/Testing Process
The QA/Testing Process
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
 
Cerberus_Presentation1
Cerberus_Presentation1Cerberus_Presentation1
Cerberus_Presentation1
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
Integration strategies best practices- Mulesoft meetup April 2018
Integration strategies   best practices- Mulesoft meetup April 2018Integration strategies   best practices- Mulesoft meetup April 2018
Integration strategies best practices- Mulesoft meetup April 2018
 
12 Factor App Methodology
12 Factor App Methodology12 Factor App Methodology
12 Factor App Methodology
 
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...
 
Tech talk microservices debugging
Tech talk microservices debuggingTech talk microservices debugging
Tech talk microservices debugging
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applications
 
AppSec in an Agile World
AppSec in an Agile WorldAppSec in an Agile World
AppSec in an Agile World
 
Sql azure cluster dashboard public.ppt
Sql azure cluster dashboard public.pptSql azure cluster dashboard public.ppt
Sql azure cluster dashboard public.ppt
 
Devops as a service
Devops as a serviceDevops as a service
Devops as a service
 
Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?
 
.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric
 
ANIn Chennai April 2024 |Beyond Big Bang: Technical Agility in Vintage Produc...
ANIn Chennai April 2024 |Beyond Big Bang: Technical Agility in Vintage Produc...ANIn Chennai April 2024 |Beyond Big Bang: Technical Agility in Vintage Produc...
ANIn Chennai April 2024 |Beyond Big Bang: Technical Agility in Vintage Produc...
 
Performance tuning Grails Applications GR8Conf US 2014
Performance tuning Grails Applications GR8Conf US 2014Performance tuning Grails Applications GR8Conf US 2014
Performance tuning Grails Applications GR8Conf US 2014
 
Resilience planning and how the empire strikes back
Resilience planning and how the empire strikes backResilience planning and how the empire strikes back
Resilience planning and how the empire strikes back
 
Project Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerProject Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on Docker
 
Wasserman Keynote at ICSSP 2013
Wasserman Keynote at ICSSP 2013Wasserman Keynote at ICSSP 2013
Wasserman Keynote at ICSSP 2013
 

More from Rajeev Bharshetty

More from Rajeev Bharshetty (6)

Resiliency in Distributed Systems
Resiliency in Distributed SystemsResiliency in Distributed Systems
Resiliency in Distributed Systems
 
Redux - What is this fuss about ?
Redux - What is this fuss about ?Redux - What is this fuss about ?
Redux - What is this fuss about ?
 
Writing S.O.L.I.D Code
Writing S.O.L.I.D CodeWriting S.O.L.I.D Code
Writing S.O.L.I.D Code
 
FunctionalGeekery-RubyConf
FunctionalGeekery-RubyConfFunctionalGeekery-RubyConf
FunctionalGeekery-RubyConf
 
SPDY
SPDY SPDY
SPDY
 
Queue
QueueQueue
Queue
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

Production Ready Microservices at Scale

  • 2. Transport, Logistics, Hyperlocal delivery and Payments • 18 Products • 1m+ Drivers • 500+ Microservices • 15k+ Cores • 2 Cloud Providers • 6 Data centers • 100+ million bookings per month
  • 3. Agenda • What are Production Ready Microservices ? • Why do we need them ? • How do we build them ?
  • 4. What is Production Ready ? • Stable • Reliable • Scalable • Performant • Fault Tolerant • Monitored • Prepared for Catastrophe • Secure
  • 5. Why ? • Goal is Availability • Trust services you put in Production • Organisational Sprawl • Increased Development Velocity • Technical Sprawl
  • 9. Linting/ Formatting • Statically analyse linting and formatting errors • Follow Ruby Style Guide • Helps maintain Code sanity • Use tools like Rubocop • `rubocop -a` to autofix certain errors
  • 10.
  • 11. Code Smells • Statically analyse code for code smells like Long Parameter list, Cyclomatic Complexity, Uncommunicative name etc • Easy to change codebases • Use tools like Reek
  • 12.
  • 13. Secure coding • Statically analyse code for Security vulnerabilities • Identify security issues like XSS, CSRF, SQL Injection etc • Use tools like Brakeman • Identify issues with various confidence levels
  • 14.
  • 15. #1. Code Quality • Make it part of your development process • Also deployment pipeline • Helps avoid bugs creeping in the code • Helps achieve Stability and Reliablity of microservice • Also helps achieve security
  • 17. Unit/Integration Testing • Unit tests test a unit/function (Individual component) • Integration tests help in testing components working together • Contract testing helps test interactions of your micro service with its dependencies
  • 18.
  • 19.
  • 21. Load Testing • Expose to higher traffic loads to see behaviour • Makes sure that microservice is ready to accept increased traffic in future • Helps identify scalability challenges and bottlenecks • Helps in determining SLA of a service • Load testing at GO-JEK using Gatling
  • 22. Chaos Testing • Helps determine Unknown Unknowns • Type of Resiliency testing • Break systems to understand behaviour • At GO-JEK ? Manual • Automated ? Simian Army
  • 23. #2. Testing • Can be automated • Make it part of your development process • Also deployment pipeline • Builds confidence in code • Helps with Fault tolerance, Scalability, Performance, Stability and Reliability
  • 25. Timeouts/Retries • Stop waiting for an answer after certain time - Timeout • Timeout - Fail Fast • Retry the request after failure • Retry - Succeed eventually
  • 26. Examples - ‘net/http’ http = Net::HTTP.new(host, port) http.open_timeout = 1 http.read_timeout = 1
  • 27. Circuit Breaker • Circumvent calls to dependency when calls fail • Fallback to a fallback response • Hystrix is a well known implementation • jruby-hystrix used internally at GO-JEK (Yet to be open sourced)
  • 29. module CustomerClient module Hystrix class HttpCommand < ::Hystrix::HystrixBaseCommand SERVER_DOWN_HTTP_STATUS_CODES = [500, 501, 502, 503, 504] def run http_response = nil begin http_response = request_uri.send(request_method, request_params, request_headers) do| callback| callback.on(400..511) do |response| Wrest.logger.warn("<- #{request_method} #{request_uri}") Wrest.logger.warn("code: #{response.code}: body: #{response.deserialised_body}") end end if SERVER_DOWN_HTTP_STATUS_CODES.include?(http_response.code.to_i) raise "Server Error with response code #{http_response.code.to_i}" end build_response(http_response) rescue => e raise HttpCommandException.new(request_uri, request_headers, request_params, http_response), e.message end end end end end jruby-hystrix
  • 30. #3. Resiliency Patterns • Protect systems from failures of its dependencies • Protect dependency when it has started to fail • Fail Fast and Succeed Eventually • Helps with Fault tolerance, Scalability, Stability and Reliability
  • 32. Logging • Describes state of the micro service • Helps debugging root cause of an issue • Structured logging • Logging needs to be scalable, available and easily accessible (Log centralisation) • Logging in Ruby
  • 33.
  • 34. Instrumentation in Code • Microservice Key metrics (Latencies, errors, api responses etc) - newrelic_rpm • StatsD metrics (statsd-instrument) - Custom metrics • Exception and error tracking metrics (sentry-raven)
  • 35. StatsD Initialisation: `StatsD.backend = case Rails.env when 'production', 'staging' StatsD::Instrument::Backends::UDPBackend.new(“local:8125”, :datadog) when 'test' StatsD::Instrument::Backends::NullBackend.new else StatsD::Instrument::Backends::LoggerBackend.new(StatsD.logger) end` Counter: StatsD.increment(‘customer.login.device.ratelimit.count’)` Gauge: StatsD.gauge(‘booking.queued', 12, sample_rate: 1.0)
  • 36. Dashboards • Capture Key metrics • USE (Utilisation, Saturation, Errors) • RED (Request Rate, Error Rate, Duration) • CPU, RAM, database connections, latencies etc • Should represent Health of a service • Grafana/NewRelic dashboards at GO-JEK
  • 40. Alerting • Alert when failures are detected or changes in key metrics • Alerts should be actionable • Answered by people on call/support • Helps protect availability of systems before they go down • Alerting at GO-JEK
  • 41. #4. Observability • Provides insights into how a service is behaving and its overall health • Includes 3 main categories: Logging, Monitoring and Distributed Tracing • Helps in quick incidence response during outages • Helps maintain Stability of the service
  • 43. CI/CD • Increased Deployment Velocity - 30+ deploys a day • Bad Deployments major cause of downtimes • Rollout - Staging -> Production • Rolling Deploys - Incremental • Think of Rollbacks at every deployment
  • 45. Canary • Deploy the new change to single node or subset of total nodes • Monitor key metrics for certain duration • Promote Canary to Production if all good or else Rollback • Helps minimise impact of bad deployments in Production
  • 47. #5. CI/CD • Lint/Test/Build/Package/Deploy steps • Canaries help have minimal impacts on Bad deployments • Rollbacks to minimise impact • Helps Provide Stability and Reliability
  • 51. More … • Documentation • Security • Capacity Planning • Outages and Incidence Response (Runbooks)
  • 52. Future work • Implementing Production Readiness checklist on the ground • Review process for micro services • Production Readiness score • Automating the checklist
  • 53. References • Production Ready Microservices - Susan Fowler • Google SRE Book • Microservices Standardisation • SLA
  • 54. Thanks for listening Questions ? @rBharshetty @gojektech