SlideShare a Scribd company logo
1 of 69
Download to read offline
Nome Speaker
@twitter
 Si fa presto a dire Serverless
Daniel Depaoli
@dedaniel_xp
Alessio Coser
@AlessioCoser
Si fa presto a dire Serverless
What we are going to talk about?
1. Introduction to Serverless
2. Our Dev Experience
3. Our Ops Experience
Si fa presto a dire Serverless
What is Serverless?
Si fa presto a dire Serverless
What is Serverless?
Si fa presto a dire Serverless
Function as a Service
Si fa presto a dire Serverless
What is a Function?
Custom code that’s run in an ephemeral context.
Si fa presto a dire Serverless
What is a Function?
Custom code that’s run in an ephemeral context.
● The code/application that we want to execute
● The Service we provide to our users
● Responds to events
Si fa presto a dire Serverless
What is a Function?
● Created only to run your code and then destroyed
● Has no state or persistence
● It’s still a server!
Custom code that’s run in an ephemeral context.
Si fa presto a dire Serverless
What is a Function?
Si fa presto a dire Serverless
Functions
Application
Runtime
Operating
System
Virtualization
Hardware
IaaS
Customer Managed
Unit of scale
Customer Managed
Abstract by vendor
Si fa presto a dire Serverless
Functions
Application
Runtime
Operating
System
Virtualization
Hardware
Functions
Application
Runtime
Operating
System
Virtualization
Hardware
IaaS PaaS
Customer Managed
Unit of scale
Customer Managed
Abstract by vendor
Si fa presto a dire Serverless
Functions
Application
Runtime
Operating
System
Virtualization
Hardware
Functions
Application
Runtime
Operating
System
Virtualization
Hardware
Functions
Application
Runtime
Operating
System
Virtualization
Hardware
IaaS PaaS FaaS
Customer Managed
Unit of scale
Customer Managed
Abstract by vendor
● No infrastructure maintenance
● Built-in automatic scaling
● Only pay for the execution time
● No persistence, no state
● Limited execution time
● Fully integrated with cloud provider’s services
Si fa presto a dire Serverless
Main features
Si fa presto a dire Serverless
Cloud-Computing Providers
● Amazon AWS Lambda
● Google Cloud Functions
● Azure Functions
Si fa presto a dire Serverless
Runtimes
● NODE.JS
● JAVA
● PYTHON
● More
Nome Speaker
@twitter
 Our Dev experience
Si fa presto a dire Serverless
Our Dev experiences
aws.amazon.com/solutions/case-studies/photovogue
Our Dev experiences PhotoVogue
An online photography platform
● Allows upcoming photographers to showcase
their work.
● Each picture that’s submitted is carefully
reviewed by Vogue Italia’s editorial staff.
Our Dev experiences PhotoVogue
● ~ 400,000 photos
● ~ 130,000 photographers
● ~ 3,000 uploaded images each day
An online photography platform
Our Dev experiences PhotoVogue
Our Dev experiences PhotoVogue
● Application that scales
● No state or sessions
● No long running scripts
● Upload and resize of photos in parallel
How FaaS applies to the domain
Upload and resize feature
Our Dev experiences PhotoVogue
FaaS
EVENT
S3
UPLOAD
RESIZED IMAGES
AWS
Benefits
Our Dev experiences PhotoVogue
Zero downtime deployment
Our Dev experiences PhotoVogue
> 1 deploy per day
Our Dev experiences PhotoVogue
Autoscaling
Our Dev experiences PhotoVogue
Average of
~ 650 invocation/minute
Our Dev experiences PhotoVogue
Maximum peaks
> 1500 invocation/minute
Our Dev experiences PhotoVogue
(as long as an entire AWS region does not crash)
[image]
Our Dev experiences PhotoVogue
No downtime
Challenges
Our Dev experiences PhotoVogue
Vendor lock-in
Our Dev experiences PhotoVogue
Decouple business logic from the cloud platform
Our Dev experiences PhotoVogue
Use a Framework like Serverless
Our Dev experiences PhotoVogue
Dependencies
Our Dev experiences PhotoVogue
Very common problem:
You have two distinct functionalities, and
they share some of their code
Our Dev experiences PhotoVogue
1st solution:
Create a single function which responds
to two different events
Our Dev experiences PhotoVogue
Easy to update
No dependencies to manage
Big function
Violates Single Responsibility Principle
Our Dev experiences PhotoVogue
2nd solution:
Create two different functions with the
same code
Our Dev experiences PhotoVogue
Common parts are easier to share
No dependencies to manage
Deploy takes longer
Unnecessary dependencies are also shared
Must deploy each function to update common code
Our Dev experiences PhotoVogue
3rd solution:
Create two different functions with an
external shared dependency (es: git, npm)
Our Dev experiences PhotoVogue
No duplicated code
Can use different versions of dependency
Startup time increases
You have to manage an external library
Our Dev experiences PhotoVogue
4th solution:
Create two different functions that will
invoke a third one (containing the shared
behaviour)
Our Dev experiences PhotoVogue
No duplicated code
Can use different versions of common function
Execution time increases
Additional point of failure
Our Dev experiences PhotoVogue
There isn’t a perfect solution
Our Dev experiences PhotoVogue
Nome Speaker
@twitter
 Our Ops experiences
Si fa presto a dire Serverless
Our Ops experiences
 Disaster Recovery and Testing
A Disaster Recovery implementation
Our Ops experiences Disaster Recovery and Testing
Our Ops experiences Disaster Recovery and Testing
AWS does not provide a DR solution
1. Backup
a. Every night create VMs snapshot
b. Move snapshots to another AWS region
Our Ops experiences Disaster Recovery and Testing
Our implementation with FaaS
2. Recovery
a. Activate the new environment in alternative region with
lastest snapshots
3. Test
a. Check services and send notification
Our Ops experiences Disaster Recovery and Testing
Our implementation with FaaS
Our Ops experiences
 Interaction with infrastructure
Sometimes we need to schedule a task
Our Ops experiences Interaction with infrastructure
Our Ops experiences Interaction with infrastructure
Load
Balancer
Instance InstanceInstance task
Master
● Lambda direct SSH connection to instance
● Triggering or doing particular tasks
● Check Backup S3
● Dump DB
● Clean EFS
● Etc.
Our Ops experiences Interaction with infrastructure
Some example:
Our Ops experiences
 Operations and monitoring
Simulating user browsing session
Our Ops experiences Monitoring
Our Ops experiences Monitoring
Integration with versioning system hosting service
Our Ops experiences CI/CD
Benefits
Our Ops experiences Monitoring
No third party tools
Our Ops experiences
No instances for just one task
Our Ops experiences
Our Ops experiences
Trigger one shot action
Fully integrated with other AWS services
Our Ops experiences
Conclusions
FaaS - when?
Conclusions
● You need to simplify operational tasks
● Your app needs to scale
● Your domain logic is event based
● You need to process a large quantity of
data
● You want some form of control over the
infrastructure
● You have to maintain some state into the app
● Your functions take a long time to run
FaaS - when not?
Conclusions
Nome Speaker
@twitter
 Thanks!
PS: We are hiring -> www.xpeppers.com/carriere
Nome Speaker
@twitter
 Questions?
PS: We are hiring -> www.xpeppers.com/carriere
www.xpeppers.com
/xpepperssrl@xpeppers

More Related Content

Viewers also liked

Viewers also liked (11)

Kamailio on Docker
Kamailio on DockerKamailio on Docker
Kamailio on Docker
 
Life in XPeppers
Life in XPeppersLife in XPeppers
Life in XPeppers
 
FreeSWITCH on Docker
FreeSWITCH on DockerFreeSWITCH on Docker
FreeSWITCH on Docker
 
La tecnica del pomodoro - Come viene adottata in XPeppers
La tecnica del pomodoro - Come viene adottata in XPeppersLa tecnica del pomodoro - Come viene adottata in XPeppers
La tecnica del pomodoro - Come viene adottata in XPeppers
 
SOA, DDD e microservices
SOA, DDD e microservicesSOA, DDD e microservices
SOA, DDD e microservices
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
 
The WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpecThe WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpec
 
Open Closed Principle kata
Open Closed Principle kataOpen Closed Principle kata
Open Closed Principle kata
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Back to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLBack to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQL
 
3Com 3C39036
3Com 3C390363Com 3C39036
3Com 3C39036
 

More from XPeppers

More from XPeppers (14)

Yagni, You aren't gonna need it
Yagni, You aren't gonna need itYagni, You aren't gonna need it
Yagni, You aren't gonna need it
 
Jenkins Shared Libraries
Jenkins Shared LibrariesJenkins Shared Libraries
Jenkins Shared Libraries
 
The Continuous Delivery process
The Continuous Delivery processThe Continuous Delivery process
The Continuous Delivery process
 
A quick and fast intro to Kotlin
A quick and fast intro to Kotlin A quick and fast intro to Kotlin
A quick and fast intro to Kotlin
 
How Agile Dev Teams work
How Agile Dev Teams workHow Agile Dev Teams work
How Agile Dev Teams work
 
The Phoenix Project: un romanzo sull'IT
The Phoenix Project: un romanzo sull'ITThe Phoenix Project: un romanzo sull'IT
The Phoenix Project: un romanzo sull'IT
 
What is Agile?
What is Agile?What is Agile?
What is Agile?
 
Test driven infrastructure
Test driven infrastructureTest driven infrastructure
Test driven infrastructure
 
Banche agili un ossimoro?
Banche agili un ossimoro?Banche agili un ossimoro?
Banche agili un ossimoro?
 
Hiring Great People: how we improved our recruiting process to build and grow...
Hiring Great People: how we improved our recruiting process to build and grow...Hiring Great People: how we improved our recruiting process to build and grow...
Hiring Great People: how we improved our recruiting process to build and grow...
 
Continuous Delivery in Java
Continuous Delivery in JavaContinuous Delivery in Java
Continuous Delivery in Java
 
Cloud e innovazione
Cloud e innovazioneCloud e innovazione
Cloud e innovazione
 
Agileday2013 Bravi si diventa
Agileday2013 Bravi si diventaAgileday2013 Bravi si diventa
Agileday2013 Bravi si diventa
 
Agileday2013 pratiche agili applicate all'infrastruttura
Agileday2013 pratiche agili applicate all'infrastrutturaAgileday2013 pratiche agili applicate all'infrastruttura
Agileday2013 pratiche agili applicate all'infrastruttura
 

Recently uploaded

If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
Sheetaleventcompany
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
raffaeleoman
 

Recently uploaded (20)

Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptx
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 

Si fa presto a dire serverless

  • 1. Nome Speaker @twitter Si fa presto a dire Serverless Daniel Depaoli @dedaniel_xp Alessio Coser @AlessioCoser
  • 2. Si fa presto a dire Serverless What we are going to talk about? 1. Introduction to Serverless 2. Our Dev Experience 3. Our Ops Experience
  • 3. Si fa presto a dire Serverless What is Serverless?
  • 4. Si fa presto a dire Serverless What is Serverless?
  • 5. Si fa presto a dire Serverless Function as a Service
  • 6. Si fa presto a dire Serverless What is a Function? Custom code that’s run in an ephemeral context.
  • 7. Si fa presto a dire Serverless What is a Function? Custom code that’s run in an ephemeral context. ● The code/application that we want to execute ● The Service we provide to our users ● Responds to events
  • 8. Si fa presto a dire Serverless What is a Function? ● Created only to run your code and then destroyed ● Has no state or persistence ● It’s still a server! Custom code that’s run in an ephemeral context.
  • 9. Si fa presto a dire Serverless What is a Function?
  • 10. Si fa presto a dire Serverless Functions Application Runtime Operating System Virtualization Hardware IaaS Customer Managed Unit of scale Customer Managed Abstract by vendor
  • 11. Si fa presto a dire Serverless Functions Application Runtime Operating System Virtualization Hardware Functions Application Runtime Operating System Virtualization Hardware IaaS PaaS Customer Managed Unit of scale Customer Managed Abstract by vendor
  • 12. Si fa presto a dire Serverless Functions Application Runtime Operating System Virtualization Hardware Functions Application Runtime Operating System Virtualization Hardware Functions Application Runtime Operating System Virtualization Hardware IaaS PaaS FaaS Customer Managed Unit of scale Customer Managed Abstract by vendor
  • 13. ● No infrastructure maintenance ● Built-in automatic scaling ● Only pay for the execution time ● No persistence, no state ● Limited execution time ● Fully integrated with cloud provider’s services Si fa presto a dire Serverless Main features
  • 14. Si fa presto a dire Serverless Cloud-Computing Providers ● Amazon AWS Lambda ● Google Cloud Functions ● Azure Functions
  • 15. Si fa presto a dire Serverless Runtimes ● NODE.JS ● JAVA ● PYTHON ● More
  • 16. Nome Speaker @twitter Our Dev experience Si fa presto a dire Serverless
  • 18. Our Dev experiences PhotoVogue
  • 19. An online photography platform ● Allows upcoming photographers to showcase their work. ● Each picture that’s submitted is carefully reviewed by Vogue Italia’s editorial staff. Our Dev experiences PhotoVogue
  • 20. ● ~ 400,000 photos ● ~ 130,000 photographers ● ~ 3,000 uploaded images each day An online photography platform Our Dev experiences PhotoVogue
  • 21. Our Dev experiences PhotoVogue ● Application that scales ● No state or sessions ● No long running scripts ● Upload and resize of photos in parallel How FaaS applies to the domain
  • 22. Upload and resize feature Our Dev experiences PhotoVogue FaaS EVENT S3 UPLOAD RESIZED IMAGES AWS
  • 24. Zero downtime deployment Our Dev experiences PhotoVogue
  • 25. > 1 deploy per day Our Dev experiences PhotoVogue
  • 27. Average of ~ 650 invocation/minute Our Dev experiences PhotoVogue
  • 28. Maximum peaks > 1500 invocation/minute Our Dev experiences PhotoVogue
  • 29. (as long as an entire AWS region does not crash) [image] Our Dev experiences PhotoVogue No downtime
  • 31. Vendor lock-in Our Dev experiences PhotoVogue
  • 32. Decouple business logic from the cloud platform Our Dev experiences PhotoVogue
  • 33. Use a Framework like Serverless Our Dev experiences PhotoVogue
  • 35. Very common problem: You have two distinct functionalities, and they share some of their code Our Dev experiences PhotoVogue
  • 36. 1st solution: Create a single function which responds to two different events Our Dev experiences PhotoVogue
  • 37. Easy to update No dependencies to manage Big function Violates Single Responsibility Principle Our Dev experiences PhotoVogue
  • 38. 2nd solution: Create two different functions with the same code Our Dev experiences PhotoVogue
  • 39. Common parts are easier to share No dependencies to manage Deploy takes longer Unnecessary dependencies are also shared Must deploy each function to update common code Our Dev experiences PhotoVogue
  • 40. 3rd solution: Create two different functions with an external shared dependency (es: git, npm) Our Dev experiences PhotoVogue
  • 41. No duplicated code Can use different versions of dependency Startup time increases You have to manage an external library Our Dev experiences PhotoVogue
  • 42. 4th solution: Create two different functions that will invoke a third one (containing the shared behaviour) Our Dev experiences PhotoVogue
  • 43. No duplicated code Can use different versions of common function Execution time increases Additional point of failure Our Dev experiences PhotoVogue
  • 44. There isn’t a perfect solution Our Dev experiences PhotoVogue
  • 45. Nome Speaker @twitter Our Ops experiences Si fa presto a dire Serverless
  • 46. Our Ops experiences Disaster Recovery and Testing
  • 47. A Disaster Recovery implementation Our Ops experiences Disaster Recovery and Testing
  • 48. Our Ops experiences Disaster Recovery and Testing AWS does not provide a DR solution
  • 49. 1. Backup a. Every night create VMs snapshot b. Move snapshots to another AWS region Our Ops experiences Disaster Recovery and Testing Our implementation with FaaS
  • 50. 2. Recovery a. Activate the new environment in alternative region with lastest snapshots 3. Test a. Check services and send notification Our Ops experiences Disaster Recovery and Testing Our implementation with FaaS
  • 51. Our Ops experiences Interaction with infrastructure
  • 52. Sometimes we need to schedule a task Our Ops experiences Interaction with infrastructure
  • 53. Our Ops experiences Interaction with infrastructure Load Balancer Instance InstanceInstance task Master ● Lambda direct SSH connection to instance ● Triggering or doing particular tasks
  • 54. ● Check Backup S3 ● Dump DB ● Clean EFS ● Etc. Our Ops experiences Interaction with infrastructure Some example:
  • 55. Our Ops experiences Operations and monitoring
  • 56. Simulating user browsing session Our Ops experiences Monitoring
  • 57. Our Ops experiences Monitoring
  • 58. Integration with versioning system hosting service Our Ops experiences CI/CD
  • 60. No third party tools Our Ops experiences
  • 61. No instances for just one task Our Ops experiences
  • 62. Our Ops experiences Trigger one shot action
  • 63. Fully integrated with other AWS services Our Ops experiences
  • 65. FaaS - when? Conclusions ● You need to simplify operational tasks ● Your app needs to scale ● Your domain logic is event based ● You need to process a large quantity of data
  • 66. ● You want some form of control over the infrastructure ● You have to maintain some state into the app ● Your functions take a long time to run FaaS - when not? Conclusions
  • 67. Nome Speaker @twitter Thanks! PS: We are hiring -> www.xpeppers.com/carriere
  • 68. Nome Speaker @twitter Questions? PS: We are hiring -> www.xpeppers.com/carriere