From Microservices to Serverless. A new hype or a new hope?
1. From Microservices to Serverless. A
new hype or a new hope?
Davide Taibi
CloWEE – Cloud and Web Engineering
http://research.tuni.fi/clowee
28.08.2019
2nd Vienna Software Seminar (VSS) on DevOps and Microservice APIs
Vienna, Austria
2. Microservices and Serverless Trends
@davidetaibi From Microservices to Serverless. A new hype or a new hope?
serverless
microservice
Google Trends
8/28/19
3. Microservices and Serverless Trends
@davidetaibi From Microservices to Serverless. A new hype or a new hope?
Google Trends
8/28/19
10. Migration To Microservices - Motivations [1]
• Maintainability
• Scalability
• Cost
@davidetaibi From Microservices to Serverless. A new hype or a new hope?
[1] D. Taibi, Lenarduzzi, V. , and Pahl, C. , “Processes, Motivations and Issues for Migrating to Microservices
Architectures: An Empirical Investigation”, IEEE Cloud Computing Journal, vol. 4, no. 5, 2017.
8/28/19
11. Microservice Perceived Benefits [1][2]
• Distributed Work
• System Understandability
• Scalability (if well orchestrated)
[2] J. Soldani, D.A. Tamburri, W. Van Den Heuvel, The pains and gains of microservices: A Systematic grey literature review,
Journal of Systems and Software, Volume 146, pp 215-232. 2018
8/28/19
12. Technical Issues
• Architectural Patterns and anti-patterns are not clear
• Decoupling from the monolithic system
• How to decompose the monolithic system?
• Database migration and data splitting
Effort-Related issues
• Development Effort overhead
• at least 20% higher
• Effort required for the DevOps infrastructure
• Effort required for library conversion
Microservice Perceived Issues [1][2]
@davidetaibi 8/28/19
13. Microservice Architectural Patterns
8/28/19
• Patterns
• D. Taibi, Lenarduzzi, V. , and Pahl, C.
“Architectural Patterns for Microservices: A Systematic Mapping Study” CLOSER , 2018
• D. Taibi, Lenarduzzi, V. , and Pahl, C. , “Continuous Architecting with Microservices and DevOps:
A Systematic Mapping Study”, in Cloud Computing and Services Science, Springer International
Publishing, 2019
• Anti-pattern
• D.. Taibi and V. Lenarduzzi , “On the Definition of Microservice Bad Smells” IEEE Software , vol.
5, no. 3, 2018.
• D. Taibi, V. Lenarduzzi, C. Pahl. "Microservices Antipatterns: A Taxonomy" Microservices -
Science and Engineering, Springer, 2019
14. Microservice Architectural Patterns
8/28/19
• Patterns
• D. Taibi, Lenarduzzi, V. , and Pahl, C.
“Architectural Patterns for Microservices: A Systematic Mapping Study” CLOSER , 2018
• D. Taibi, Lenarduzzi, V. , and Pahl, C. , “Continuous Architecting with Microservices and DevOps:
A Systematic Mapping Study”, in Cloud Computing and Services Science, Springer International
Publishing, 2019
• Anti-pattern
• D.. Taibi and V. Lenarduzzi , “On the Definition of Microservice Bad Smells” IEEE Software , vol.
5, no. 3, 2018.
• D. Taibi, V. Lenarduzzi, C. Pahl. "Microservices Antipatterns: A Taxonomy" Microservices -
Science and Engineering, Springer, 2019
15. Microservice Architectural Patterns
8/28/19
• Patterns
• D. Taibi, Lenarduzzi, V. , and Pahl, C.
“Architectural Patterns for Microservices: A Systematic Mapping Study” CLOSER , 2018
• D. Taibi, Lenarduzzi, V. , and Pahl, C. , “Continuous Architecting with Microservices and DevOps:
A Systematic Mapping Study”, in Cloud Computing and Services Science, Springer International
Publishing, 2019
• Anti-pattern
• D.. Taibi and V. Lenarduzzi , “On the Definition of Microservice Bad Smells” IEEE Software , vol.
5, no. 3, 2018.
• D. Taibi, V. Lenarduzzi, C. Pahl. "Microservices Antipatterns: A Taxonomy" Microservices -
Science and Engineering, Springer, 2019
17. Microservice Decomposition
8/28/19
• How about process mining to identify business processes?
D. Taibi and Systa, K. , “From Monolithic Systems to Microservices: A
Decomposition Framework based on Process Mining”, in 9th International
Conference on Cloud Computing and Services Science, CLOSER , 2019, Heraklion
(Greece), 2019.
18. Microservice - METRICS
8/28/19
• How to measure coupling?
• CBM (coupling between microservices) [1]
• Working on a new set of validate measures
• Validation of metrics proposed by Bogner et al. [2]
[1] D. Taibi and Systa, K. , “From Monolithic Systems to Microservices: A Decomposition Framework based on Process Mining”, in 9th
International Conference on Cloud Computing and Services Science, CLOSER , 2019, Heraklion (Greece), 2019.
[2] Justus Bogner, Stefan Wagner, Alfred Zimmermann. Automatically measuring the maintainability of service- and microservice-based
systems: a literature review. IWSM-Mensura 2017
19. Microservice Maintenance
Technical Debt under control
@davidetaibi 8/28/19
0
2K
4K
6K
8K
10K
12K
14K
16K
Aug-14Oct-14Dec-14Feb-15Apr-15
Jun-15Aug-15Oct-15Dec-15Feb-16Apr-16
Jun-16Aug-16Oct-16Dec-16Feb-17Apr-17
Jun-17Aug-17Oct-17Dec-17Feb-18Apr-18
Jun-18Aug-18Oct-18
TDinminutes(thousands)
Monolithic System Microservice 1 Microservice 2 Microservice 3 Microservice 4
Microservice 5 Total TD_M linear (before) linear (after)
20. • Reverse engineering of microservice architecture
• https://github.com/clowee/MicroDepGraph
• https://github.com/clowee/MicroserviceDataset
• Other approaches?
Microservice – Patterns Analysus
@davidetaibi 8/28/19
22. O’Reilly SW Architecture Conference 2018
Stop using microservices!
Move to serverless functions as soon as possible!
22/05/2019 | 24@davidetaibi Serverless Meetup - Tampere
23. From Microservices to Serverless Functions
• Practitioners started migrate from microservices to FaaS
• Mixed Approach (microservices + Functions)
• New applications 100% serverless
• vast majority of Finnish companies (interviewed)
@davidetaibi 8/28/19
24. What is Serverless [3]
a cloud-native platform
for
short-running, stateless computation
and
event-driven applications
which
scales up and down instantly and automatically
and
charges for actual usage at a millisecond granularity
What is Serverless?
8/28/19
[3] Baldini I. et al. (2017) Serverless Computing: Current Trends and Open Problems. In: Chaudhary S., Somani G., Buyya
R. (eds) Research Advances in Cloud Computing. Springer, Singapore
25. 8/28/19
Runs code only on-demand on a
per-request basis
Serverless
deployment &
operations model No servers Just code
Server-less means no servers?
Or worry-less about servers?
How does it work
@davidetaibi
26. Runscode in response to events
Event-programming
model
What triggers code execution?
22/05/2019@davidetaibi Serverless Meetup - Tampere | 28
27. f(x)
What is Serverless good for?
Serverless is good for
short-running
stateless
event-driven
Microservices
Mobile Backends
Bots, ML Inferencing
IoT
Modest Stream Processing
Service integration
Serverless is not good for
long-running
stateful
number crunching
Databases
Deep Learning Training
Heavy-Duty Stream Analytics
Spark/Hadoop Analytics
Numerical Simulation
Video Streaming
22/05/2019@davidetaibi Serverless Meetup - Tampere 29
28. Current Platforms for Serverless
Azure Functions
AWS Lambda
Kubernetes
Google Functions
Red-Hat 22/05/2019@davidetaibi Serverless Meetup - Tampere | 30
31. Preliminary Results – Migration Motivations
Companies Already moved to Microservices
• OPS Effort for Microservices
• Get rid of Kubernetes
• No OPS
Companies Migrating from Monolithic systems
• New (hype) technology
• Promising technology
• No initial infrastructural costs (pay as you use)
• Automatic scaling
22/05/2019 | 33@davidetaibi Serverless Meetup - Tampere
32. Preliminary Results – Migration Issues
Developers are not used to the event-oriented programming
Very hard to test
Debug almost impossible
Unknown Patterns and antipatterns
Anomalies can generate unexpected costs!
22/05/2019 | 34@davidetaibi Serverless Meetup - Tampere
34. Serverless Anti-Patterns Summary
#1 Async Calls
#2 Functions calling other functions
#3 Shared Code
#4 Shared Libraries as Functions
#5 Too many libraries
#6 Too Many technologies
#7 Too many functions
EXTRA: The distributed Monolith
22/05/2019 | 37@davidetaibi Serverless Meetup - Tampere
35. Open Questions - Microservices
• How to refactor a monolithic system into microservices?
• Which anti-patterns are actually harmful and when?
• How to evaluate coupling and cohesion between Microservices?
• How to efficiently orchestrate a system?
• Is a microservices-based system more understandable, and more maintainable?
• How to measure them?
22/05/2019 | 38@davidetaibi Serverless Meetup - Tampere
36. Open Questions - Serverless
• When is better to use serverless and when microservices
• How to architect a system based on serverless functions?
• Or to combine functions to create a microservice?
• Architectural Patterns? Anti-Patterns?
• How to prevent anomalies?
22/05/2019 | 39@davidetaibi Serverless Meetup - Tampere
37. Spoiler… New IEEE Special Theme Issue
Serverless Applications Engineering
• Topics:
• Mindsets: Engineering strategies and priorities in a serverless context.
• Architectures: Single- and multi-cloud FaaS/BaaS bindings; portable functions.
• Patterns: Functions as glue code versus fully FaaS-based applications; function orchestration in
code versus composition languages.
• Testing approaches: Platform emulation; validation of function code and configuration; generic
benchmarks and corner case simulations.
• Frameworks/tools: Deployment, automated FaaSification, tracing and visualisation of function
dependencies, state/storage bindings.
8/28/19@davidetaibi From Microservices to Serverless. A new hype or a new hope?
38. Conclusion
• Serverless and Microservices are very powerful and useful technologies
• Still several open questions
• Developers should carefully consider the “old fashioned” software engineering practices
• Properly design a modular system
• Pay attention to coupling and cohesion
• Think about long-term maintenance
• Avoid the distributed monolith
22/05/2019 | 41@davidetaibi Serverless Meetup - Tampere