SlideShare uma empresa Scribd logo
1 de 19
From legacy to serverless
history of a transformation
The ladder
Monolith architecture
User interface
Business layer (MVC)
Data interface
Data layerBrowser Web Server
Monolith
The good
● Fewer Cross-cutting
Concerns: logging, security
features such as audit trails, xss
and DOS protection, rate limiting
are shared across the code
base.
● Less Operational Overhead:
Less deployment complexity,
monitoring, testing and logging.
● Development ease: building a
monolithic application is far less
complex and need less
developer resources (also less
specialization)
● Performance: no multiple API
call means less overhead time
that could lead to a better overall
performance
The uglyThe bad Lesson
learned
● Harder to understand: can
have lots of dependencies, side-
effects, and magic which are not
straight forward for the new
comer
● Harder to change: a large
codebase harder to understand
is also harder to change.
● CI/CD: implementing a CI / CD
pipeline leads to a continuous
complete redeployment.
● Scalability: If you need to scale
fast you are in for big bucks,
costs will likely grow
exponentially.
● Poor reliability: a single bug
could take the whole system
down.
● Slowness: as the code base
grows, overall system
performance decreases
● Monolith are the starting point of
any small business and as it
scales up a choice must be
taken, microservices with
monolith core or full
microservices architecture?
The spiral staircase
Microservice architecture with a monolithic core
User interface
Business layer (MVC)x
Data layer
Browser Proxy
Microservice architecture with a monolithic core
Orchestration
Service A
Service B
Service C
Service Z
...
Monolithic
The good
● Scalability: scalability is good,
microservices can be deployed
as a singularity.
● CI/CD: CI / CD can be
implemented with overall
benefits.
● Maintenance: Easier to
understand and maintain
The uglyThe bad Lesson
learned
● More Operational Overhead:
More deployment complexity,
monitoring, testing and logging.
● Monolith database: the
database is still the one from the
monolith architecture
● Shared core: The core is shared
among all microservices
(dependency) this also means
project codebase
● Legacy code: it’s still among us
but this is not the architecture’s
fault.
● REST API can tend to be
developed in an unRESTful way
based on developer “sensitivity”.
Not much control over code
quality due to the stringent scale
up deadlines.
● Lots of bugs at first release.
● It works well, scales well and
with CI/CD in place the quality of
new releases has grown.
Stairway to heaven
Serverless Architecture
We had some issues...
All microservices in our
backend app were
highly dependent on
one another. When a
MS requires a resource
from another MS, the
first must know what
data is needed by the
other one
Tight coupling
All communications
between microservice
were done by a sync
API call. This caused
some issue when
performing heavy
operations on DB (like
importing users).
Blocking sync
execution
There was no standard
procedure to manage
errors occurred while
an event is triggered
and captured by
another service,
Error handling
When an event is
triggered and a
microservice service
fails, the event is lost
and not recoverable,
causing discrepancy in
DB and manual work to
recover missing data.
Rigidity
How to solve them, then?
MESSAGE QUEUES!
Wow, but i don’t
want to pay for
idle… maybe a
“serverless”
service?
But there are so
many services
out there...
Let’s try with an
AWS managed
service
Simple Queue Service
AKA - The Bread and Butter of AWS services Messaging
Ease of use
Read Throughput
No consumers coordination, no scaling out
management, no special libraries needed
It dynamically increase read throughput by
scaling number of tasks reading from a
queue
Single consumer
Message replayability
Once a message is processed by a
consumer, it is removed from the queue
SQS does not support replaying messages
that have already been published
Main use cases
Application integration
Decoupling microservices
Allocate tasks to multiple worker nodes
Decouple live user requests from intensive
background work
Batch messages for future processing
and so on...
Bonus: SQS CAN TRIGGER LAMBDA FUNCTIONS!
The benefits of serverless
No servers to
provision or manage
Never pay for idle
Scales with usage
Availability and fault
tolerance built in
Serverless doesn’t mean that servers are no longer involved. Serverless means:
Introducing the Event Bus
Main SQS stream
queue in which
already validated
events are put.
Docebo microservices
put events here via a
shared library.
Global Queue
Lambda functions that
saves a map between
event types and
service queues. The
subscriptions are
stored in Elasticache
(Redis).
Subscriber
The orchestrator that
pushes the events
from the main stream
into the subscribed
service queues. It
reads subscriptions
map from Redis
Dispatcher
Services queues that can
implement different
strategies/services (SQS,
DynamoDB, streams,
etc…). Each lambda reads
the “stream” and call the
subscribed webhooks for
each event.
Service Queues
The real subscribers of
all events that are
processed by Event Bus.
Consumers must be
both Docebo
microservices or internal
webhooks.
Consumers
Event Bus modules
Each module has its own responsibility
The good
● Scalability: scalability at its best,
functions and services can be
deployed as a singularity
● CI/CD: CI / CD can be
implemented with overall
benefits.
● Maintenance: ~ ZERO effort in
maintain a serverless
architecture
● Developers only do their job:
write code
The uglyThe (almost)
bad
Lesson
learned
● Cold starts (latency triggering
a function): if there is no idle
container available waiting to run
the code..
● Not 100% predictable costs: be
careful to keep running time low
and find the right amount of
memory allocated for the
function
● Nothing (for now) ● Eventual consistency is not safe,
and that’s OK!
● No bugs at first release
● Developers can focus on writing
high quality code
● Automatic tests are essential
From idea to production
The “Legacy” way
Choose Language
+ framework
Master Language
+ framework
How to realize
microservices?
Capacity Planning
Figure out
deployment
Configure CI/CD Configure AMI
Configure ELB
Configure
autoscaling
Over provision for
launch
idea production
From idea to production
The “ ” way
Choose Language
+ framework
Master Language
+ framework
How to realize
microservices?
Capacity Planning
Figure out
deployment
Configure CI/CD Configure AMI
Configure ELB
Configure
autoscaling
Over provision for
launch
idea production
Serverless is not our goal
But it’s the “stairway” to reach our goals:
Build a product
that customers
love to use
Test ideas
against the
market quickly
Iterate on good
ideas
Deliver
frequently,
deliver quickly
Focus on
creating
Business Values
Thank You!
Fabio Pirovano, Alberto Galimberti

Mais conteúdo relacionado

Mais procurados

NServiceBus introduction
NServiceBus introductionNServiceBus introduction
NServiceBus introduction
Boris Tveritnev
 

Mais procurados (20)

Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
 
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
 
Microservice Architecture 101
Microservice Architecture 101Microservice Architecture 101
Microservice Architecture 101
 
WSO2Con ASIA 2016: DevOps & Cloud: Lessons & Stories
WSO2Con ASIA 2016: DevOps & Cloud: Lessons & StoriesWSO2Con ASIA 2016: DevOps & Cloud: Lessons & Stories
WSO2Con ASIA 2016: DevOps & Cloud: Lessons & Stories
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Orchestration Patterns for Microservices with Messaging by RabbitMQ
Orchestration Patterns for Microservices with Messaging by RabbitMQOrchestration Patterns for Microservices with Messaging by RabbitMQ
Orchestration Patterns for Microservices with Messaging by RabbitMQ
 
Service mesh in Microservice World to Manage end to end service communications
Service mesh in Microservice World to Manage end to end service communicationsService mesh in Microservice World to Manage end to end service communications
Service mesh in Microservice World to Manage end to end service communications
 
Modern Cloud Fundamentals: Misconceptions and Industry Trends
Modern Cloud Fundamentals: Misconceptions and Industry TrendsModern Cloud Fundamentals: Misconceptions and Industry Trends
Modern Cloud Fundamentals: Misconceptions and Industry Trends
 
Accelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and KubernetesAccelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and Kubernetes
 
9 patterns of microservices
9 patterns of microservices9 patterns of microservices
9 patterns of microservices
 
[SC London] "Testing Microservices: from Development to Production
[SC London] "Testing Microservices: from Development to Production[SC London] "Testing Microservices: from Development to Production
[SC London] "Testing Microservices: from Development to Production
 
Continuous delivery by sergey seletsky
Continuous delivery by sergey seletskyContinuous delivery by sergey seletsky
Continuous delivery by sergey seletsky
 
#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture
 
Microservices with Node and Docker
Microservices with Node and DockerMicroservices with Node and Docker
Microservices with Node and Docker
 
NServiceBus introduction
NServiceBus introductionNServiceBus introduction
NServiceBus introduction
 
Leveraging Microservices and Apache Kafka to Scale Developer Productivity
Leveraging Microservices and Apache Kafka to Scale Developer ProductivityLeveraging Microservices and Apache Kafka to Scale Developer Productivity
Leveraging Microservices and Apache Kafka to Scale Developer Productivity
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Hosting rails apps
Hosting rails appsHosting rails apps
Hosting rails apps
 
[WSO2Con EU 2017] Container-native Architecture
[WSO2Con EU 2017] Container-native Architecture[WSO2Con EU 2017] Container-native Architecture
[WSO2Con EU 2017] Container-native Architecture
 

Semelhante a Docebo: history of a journey from legacy to serverless

Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
codebits
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
rajivmordani
 
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1
MSc CST
 

Semelhante a Docebo: history of a journey from legacy to serverless (20)

Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
 
Application Modernisation through Event-Driven Microservices
Application Modernisation through Event-Driven Microservices Application Modernisation through Event-Driven Microservices
Application Modernisation through Event-Driven Microservices
 
When to use serverless computing.pdf
When to use serverless computing.pdfWhen to use serverless computing.pdf
When to use serverless computing.pdf
 
Going Serverless on AWS
Going Serverless on AWSGoing Serverless on AWS
Going Serverless on AWS
 
Jeffrey Richter
Jeffrey RichterJeffrey Richter
Jeffrey Richter
 
Get the Message Across: Seamlessly Transport Data to Apps, Anywhere
Get the Message Across: Seamlessly Transport Data to Apps, AnywhereGet the Message Across: Seamlessly Transport Data to Apps, Anywhere
Get the Message Across: Seamlessly Transport Data to Apps, Anywhere
 
Full lifecycle of a microservice
Full lifecycle of a microserviceFull lifecycle of a microservice
Full lifecycle of a microservice
 
'How to build efficient backend based on microservice architecture' by Anton ...
'How to build efficient backend based on microservice architecture' by Anton ...'How to build efficient backend based on microservice architecture' by Anton ...
'How to build efficient backend based on microservice architecture' by Anton ...
 
When to use serverless computing.pdf
When to use serverless computing.pdfWhen to use serverless computing.pdf
When to use serverless computing.pdf
 
Service-Mesh-Presentation.pdf
Service-Mesh-Presentation.pdfService-Mesh-Presentation.pdf
Service-Mesh-Presentation.pdf
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
 
Arsitektur Aplikasi Modern - Faisal Henry Susanto
Arsitektur Aplikasi Modern - Faisal Henry SusantoArsitektur Aplikasi Modern - Faisal Henry Susanto
Arsitektur Aplikasi Modern - Faisal Henry Susanto
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cache
 
Nginx Conference 2016 - Learnings and State of the Industry
Nginx Conference 2016 - Learnings and State of the IndustryNginx Conference 2016 - Learnings and State of the Industry
Nginx Conference 2016 - Learnings and State of the Industry
 
Exposing Lambda Functions as Managed APIs
Exposing Lambda Functions as Managed APIsExposing Lambda Functions as Managed APIs
Exposing Lambda Functions as Managed APIs
 
Build A Scalable Mobile App
Build A Scalable Mobile App Build A Scalable Mobile App
Build A Scalable Mobile App
 
Deconstructing Monoliths with Domain Driven Design
Deconstructing Monoliths with Domain Driven DesignDeconstructing Monoliths with Domain Driven Design
Deconstructing Monoliths with Domain Driven Design
 
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS SummitDiscover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
 
Internet applications unit1
Internet applications unit1Internet applications unit1
Internet applications unit1
 

Último

VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 

Último (20)

VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 

Docebo: history of a journey from legacy to serverless

  • 1. From legacy to serverless history of a transformation
  • 3. User interface Business layer (MVC) Data interface Data layerBrowser Web Server Monolith
  • 4. The good ● Fewer Cross-cutting Concerns: logging, security features such as audit trails, xss and DOS protection, rate limiting are shared across the code base. ● Less Operational Overhead: Less deployment complexity, monitoring, testing and logging. ● Development ease: building a monolithic application is far less complex and need less developer resources (also less specialization) ● Performance: no multiple API call means less overhead time that could lead to a better overall performance The uglyThe bad Lesson learned ● Harder to understand: can have lots of dependencies, side- effects, and magic which are not straight forward for the new comer ● Harder to change: a large codebase harder to understand is also harder to change. ● CI/CD: implementing a CI / CD pipeline leads to a continuous complete redeployment. ● Scalability: If you need to scale fast you are in for big bucks, costs will likely grow exponentially. ● Poor reliability: a single bug could take the whole system down. ● Slowness: as the code base grows, overall system performance decreases ● Monolith are the starting point of any small business and as it scales up a choice must be taken, microservices with monolith core or full microservices architecture?
  • 5. The spiral staircase Microservice architecture with a monolithic core
  • 6. User interface Business layer (MVC)x Data layer Browser Proxy Microservice architecture with a monolithic core Orchestration Service A Service B Service C Service Z ... Monolithic
  • 7. The good ● Scalability: scalability is good, microservices can be deployed as a singularity. ● CI/CD: CI / CD can be implemented with overall benefits. ● Maintenance: Easier to understand and maintain The uglyThe bad Lesson learned ● More Operational Overhead: More deployment complexity, monitoring, testing and logging. ● Monolith database: the database is still the one from the monolith architecture ● Shared core: The core is shared among all microservices (dependency) this also means project codebase ● Legacy code: it’s still among us but this is not the architecture’s fault. ● REST API can tend to be developed in an unRESTful way based on developer “sensitivity”. Not much control over code quality due to the stringent scale up deadlines. ● Lots of bugs at first release. ● It works well, scales well and with CI/CD in place the quality of new releases has grown.
  • 9. We had some issues... All microservices in our backend app were highly dependent on one another. When a MS requires a resource from another MS, the first must know what data is needed by the other one Tight coupling All communications between microservice were done by a sync API call. This caused some issue when performing heavy operations on DB (like importing users). Blocking sync execution There was no standard procedure to manage errors occurred while an event is triggered and captured by another service, Error handling When an event is triggered and a microservice service fails, the event is lost and not recoverable, causing discrepancy in DB and manual work to recover missing data. Rigidity
  • 10. How to solve them, then? MESSAGE QUEUES! Wow, but i don’t want to pay for idle… maybe a “serverless” service? But there are so many services out there... Let’s try with an AWS managed service
  • 11. Simple Queue Service AKA - The Bread and Butter of AWS services Messaging Ease of use Read Throughput No consumers coordination, no scaling out management, no special libraries needed It dynamically increase read throughput by scaling number of tasks reading from a queue Single consumer Message replayability Once a message is processed by a consumer, it is removed from the queue SQS does not support replaying messages that have already been published Main use cases Application integration Decoupling microservices Allocate tasks to multiple worker nodes Decouple live user requests from intensive background work Batch messages for future processing and so on... Bonus: SQS CAN TRIGGER LAMBDA FUNCTIONS!
  • 12. The benefits of serverless No servers to provision or manage Never pay for idle Scales with usage Availability and fault tolerance built in Serverless doesn’t mean that servers are no longer involved. Serverless means:
  • 14. Main SQS stream queue in which already validated events are put. Docebo microservices put events here via a shared library. Global Queue Lambda functions that saves a map between event types and service queues. The subscriptions are stored in Elasticache (Redis). Subscriber The orchestrator that pushes the events from the main stream into the subscribed service queues. It reads subscriptions map from Redis Dispatcher Services queues that can implement different strategies/services (SQS, DynamoDB, streams, etc…). Each lambda reads the “stream” and call the subscribed webhooks for each event. Service Queues The real subscribers of all events that are processed by Event Bus. Consumers must be both Docebo microservices or internal webhooks. Consumers Event Bus modules Each module has its own responsibility
  • 15. The good ● Scalability: scalability at its best, functions and services can be deployed as a singularity ● CI/CD: CI / CD can be implemented with overall benefits. ● Maintenance: ~ ZERO effort in maintain a serverless architecture ● Developers only do their job: write code The uglyThe (almost) bad Lesson learned ● Cold starts (latency triggering a function): if there is no idle container available waiting to run the code.. ● Not 100% predictable costs: be careful to keep running time low and find the right amount of memory allocated for the function ● Nothing (for now) ● Eventual consistency is not safe, and that’s OK! ● No bugs at first release ● Developers can focus on writing high quality code ● Automatic tests are essential
  • 16. From idea to production The “Legacy” way Choose Language + framework Master Language + framework How to realize microservices? Capacity Planning Figure out deployment Configure CI/CD Configure AMI Configure ELB Configure autoscaling Over provision for launch idea production
  • 17. From idea to production The “ ” way Choose Language + framework Master Language + framework How to realize microservices? Capacity Planning Figure out deployment Configure CI/CD Configure AMI Configure ELB Configure autoscaling Over provision for launch idea production
  • 18. Serverless is not our goal But it’s the “stairway” to reach our goals: Build a product that customers love to use Test ideas against the market quickly Iterate on good ideas Deliver frequently, deliver quickly Focus on creating Business Values
  • 19. Thank You! Fabio Pirovano, Alberto Galimberti