SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

NServiceBus introduction
NServiceBus introductionNServiceBus introduction
NServiceBus introduction
Boris Tveritnev
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Monica Sydney
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 

Kürzlich hochgeladen (20)

一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
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
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 

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