SlideShare a Scribd company logo
Microservice 
architecture 
Žilvinas Kuusas 
VilniusPHP 0x19, 2014
Who am I? 
Žilvinas Kuusas 
lead developer @ Estina / iSign.io 
t: @kuusas 
e: zilvinas@kuusas.lt
What is a microservice? 
The microservice architectural style is an approach to developing a single 
application as a suite of small services, each running in its own process and 
communicating with lightweight mechanisms, often an HTTP resource API. 
These services are built around business capabilities and independently 
deployable by fully automated deployment machinery. There is a bare minimum 
of centralized management of these services, which may be written in different 
programming languages and use different data storage technologies. 
Martin Fowler 
http://martinfowler.com/articles/microservices.html
Microservice 
● No long-term relationships with technology 
stack 
● Easy to adopt emerging technologies 
● Loose coupling 
● Single responsibility 
● Fault isolation 
● Scalability
UNIX philosophy 
rename 's/Airplane/Flight/' `find -name "*Airplane*.php”`
UNIX philosophy 
ls . | sort | tail -n 2 | sort -r | tail -n 1 | cut -c8-21
Microservice architecture 
Microservice architecture
Monolithic application 
Reality - monolithic application
Service Oriented Architecture (SOA)
Benefits of monolith 
● Quick development 
● Simple deployments 
● Easy to scale 
● Everything in one place
Drawbacks of monolith 
● Lots of LOC 
● Slow builds 
● Development is hard to scale 
● Continuous deployments becomes difficult 
● Scaling application can be difficult 
● Requires a long-term commitment to a 
technology stack
Microservices 
Think about microservice as small, single-purpose 
application. Simple?
Small application 
● Runs as individual process 
● Smaller means easier for developers to 
maintain 
● Changes does not affect whole system 
● Faster to build and deploy 
● ...or throw away and rewrite
Small application 
● Each service has it’s own database 
● Code duplication vs. code coupling 
● Shared code - libraries
Small application 
“If service is bigger than your 
head then it’s too big” 
Internet
Deploy independently 
● Each microservice runs in it’s own process, 
so deployment of one service won’t affect 
the whole application 
● Easier to scale development 
● Faster feature releases 
● Less downtime 
● Develop, build and deploy!
Flexible solutions 
● Modular 
● Polyglot data persistence 
● Multi-framework
Right tool for the job
Application: two layers 
● System layer 
○ gateway: defines interfaces, communication 
mechanisms 
○ rarely changes 
● Service layer 
○ services with different internal architectures 
○ different technology stacks 
○ evolves rapidly
Application: two layers 
Application: two layers
When to use it? 
● In the beginning it will slow down the 
development 
● Later - refactoring might be painful 
● It’s easier to merge services than split 
monolith into services 
● ...unless monolith already has loosely-coupled 
modules
Be realistic 
“Focus on building services that make 
development and deployment easier - not just 
tiny services”
Nanoservice antipattern 
A nanoservice is a service whose overhead 
(communications, maintenance, and so on) 
outweighs its utility.
How services communicate? 
● HTTP/REST 
● AMQP for asynchronous requests 
● Event Sourcing 
● Streams
Databases 
● DB instance per service 
● Relational databases, NoSQL, others
How to start? 
● ESI (Edge Side Includes) 
● RabbitMQ 
● Gearman 
● PHP multithreading
Shared data problem 
● ServiceA needs to read data which is 
managed by ServiceB
Solution A 
ServiceA calls ServiceB for data 
● Benefits 
○ quick implementation 
○ data is always fresh 
● Drawbacks 
○ slows down ServiceA 
○ ServiceB might be down at the moment
Solution B 
Data replication 
● Benefits 
○ availability 
○ speed 
● Drawbacks 
○ data replication overhead
Performance 
● Latency is your foe 
● Everything done asynchronously - no 
problem 
● Keep communication between services as 
effective as possible. No chit-chats.
Drawbacks 
● High level of distributed complexity
Automation 
● Automate everything 
○ CI 
○ deployments 
○ configuration 
○ error logging 
○ monitoring
PHP world 
PHP world
Symfony2 app as service 
● Symfony2 isn’t heavy… 
● ...if you know how to circumcise it 
● Avoid standard edition 
● Create your own minimal application 
http://www.whitewashing.de/2014/04/24/symfony_hello_world.html
Symfony2 benefits 
● HttpKernel component is one of the 
greatest things happened in PHP world in 
years 
● SF2 DIC: flexible and extendable way to 
grow your project 
● Console component for CLI utilities 
● Standardised solutions
Symfony2 as gateway 
● Basic SF2 application with dumb controllers 
for routing services 
○ via messaging 
● Rendering main views for ESI
Challenges 
● Define service boundaries 
● Continuous Integration 
○ Continuous Deployment 
● Error logging 
● Monitoring 
● System tests 
○ Consumer tests
More challenges... 
● Security layer 
● Shared configuration 
● Shared assets 
● Graceful degradation
Who is using 
~120 services to generate 1 page 
http://highscalability.com/amazon-architecture 
Has 600+ services in total 
http://techblog.netflix.com/ 
http://www.ebaytechblog.com/
Why microservice? 
● Scale development 
● Scale your application 
● Application availability 
● Use right tools for the job 
● Whole system becomes faster if done right
Dig more 
● Martin Fowler http://martinfowler. 
com/articles/microservices.html 
● Fred George https://www.youtube.com/watch? 
v=2rKEveL55TY 
● http://blog.arkency.com/2014/07/microservices-72- 
resources/
What’s next? 
Reactive architecture? 
http://www.reactivemanifesto.org/
Questions?
Join us 
hello@estina.com

More Related Content

PDF
Why Microservice
PDF
Microservice Architecture
PDF
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
PPTX
Microservices Architecture & Testing Strategies
PPTX
Microservice vs. Monolithic Architecture
PPSX
Microservices Docker Kubernetes Istio Kanban DevOps SRE
PPTX
Microservice architecture design principles
PPTX
Introduction to Microservices
Why Microservice
Microservice Architecture
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservices Architecture & Testing Strategies
Microservice vs. Monolithic Architecture
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservice architecture design principles
Introduction to Microservices

What's hot (20)

PPTX
Introduction to Microservices
PPTX
Microservice intro
PPTX
Micro services Architecture
PDF
Design patterns for microservice architecture
PPTX
Introduction to microservices
PPTX
Microservice Architecture Software Architecture Microservice Design Pattern
PPTX
Introduction To Microservices
PPSX
Microservices, Containers, Kubernetes, Kafka, Kanban
PDF
Testing Microservices
PPTX
About DevOps in simple steps
PDF
A Pattern Language for Microservices
PDF
Microservice Architecture
PPT
Microservices
PDF
Designing loosely coupled services
PPTX
Microservices Architecture
PPTX
Introduction to microservices
PDF
Introduction to Istio Service Mesh
PDF
Microservices architecture
PDF
Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...
PDF
IaC on AWS Cloud
Introduction to Microservices
Microservice intro
Micro services Architecture
Design patterns for microservice architecture
Introduction to microservices
Microservice Architecture Software Architecture Microservice Design Pattern
Introduction To Microservices
Microservices, Containers, Kubernetes, Kafka, Kanban
Testing Microservices
About DevOps in simple steps
A Pattern Language for Microservices
Microservice Architecture
Microservices
Designing loosely coupled services
Microservices Architecture
Introduction to microservices
Introduction to Istio Service Mesh
Microservices architecture
Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...
IaC on AWS Cloud
Ad

Viewers also liked (20)

PDF
Microservices Architecture
PDF
Developing applications with a microservice architecture (svcc)
PDF
Microservices at Spotify
PDF
MicroService Architecture
PPTX
Informal invitation
PPTX
Creativity Lego เอก
PPTX
Лабораторна робота LR4-5_4-5.1_kozachenko
PDF
Autonomic Application Delivery with Tonomi
PDF
Using Capifony for Symfony apps deployment.
PPT
установка колонн летучек
PDF
Autonomic Management of Cloud Applications with Tonomi, Gluecon Keynote, 2015
PPTX
Makalah biologi
PPTX
Revamping the math classroom
PPTX
High availability is not a luxury webcast
PDF
Autonomic Application Management with Qubell (and Docker)
PPT
технология селективной изоляции водопритока
PDF
Enterprise in your degree - Neil Coles
PPTX
Aleksander Królikowski
PDF
Ha cluster -Public to Private
PDF
Enhancing employability through enterprise education: BSc Business Enterprise...
Microservices Architecture
Developing applications with a microservice architecture (svcc)
Microservices at Spotify
MicroService Architecture
Informal invitation
Creativity Lego เอก
Лабораторна робота LR4-5_4-5.1_kozachenko
Autonomic Application Delivery with Tonomi
Using Capifony for Symfony apps deployment.
установка колонн летучек
Autonomic Management of Cloud Applications with Tonomi, Gluecon Keynote, 2015
Makalah biologi
Revamping the math classroom
High availability is not a luxury webcast
Autonomic Application Management with Qubell (and Docker)
технология селективной изоляции водопритока
Enterprise in your degree - Neil Coles
Aleksander Królikowski
Ha cluster -Public to Private
Enhancing employability through enterprise education: BSc Business Enterprise...
Ad

Similar to Microservice architecture (20)

PDF
Microservice Architecture
PDF
Microservices for java architects it-symposium-2015-09-15
PPTX
Microservices architecture
PDF
Building Microservices Software practics
PPTX
Microservices, Docker deploy and Microservices source code in C#
PDF
20141210 - Microservice Container
PPTX
Microservices.pptx
PDF
Changing application demands: What developers need to know
PDF
#ATAGTR2020 Presentation - Microservices – Explored
PPTX
MicroserviceArchitecture in detail over Monolith.
ODP
micro services architecture (FrosCon2014)
PDF
Microservices - Hitchhiker's guide to cloud native applications
PDF
Cloudify your applications: microservices and beyond
PPTX
Service Mesh CTO Forum (Draft 3)
PDF
Microservices Architecture
PPTX
Micro Services Architecture
PDF
2016_04_04_CNI_Spring_Meeting_Microservices
PPTX
Microservices why?
PDF
Microservices on a budget meetup
PDF
Microservices: Where do they fit within a rapidly evolving integration archit...
Microservice Architecture
Microservices for java architects it-symposium-2015-09-15
Microservices architecture
Building Microservices Software practics
Microservices, Docker deploy and Microservices source code in C#
20141210 - Microservice Container
Microservices.pptx
Changing application demands: What developers need to know
#ATAGTR2020 Presentation - Microservices – Explored
MicroserviceArchitecture in detail over Monolith.
micro services architecture (FrosCon2014)
Microservices - Hitchhiker's guide to cloud native applications
Cloudify your applications: microservices and beyond
Service Mesh CTO Forum (Draft 3)
Microservices Architecture
Micro Services Architecture
2016_04_04_CNI_Spring_Meeting_Microservices
Microservices why?
Microservices on a budget meetup
Microservices: Where do they fit within a rapidly evolving integration archit...

More from Žilvinas Kuusas (9)

PDF
Use Symfony Messenger Component and CQRS!
PDF
Ansible: infrastructure automation for everyone
PDF
Automated cryptocurrency trading
PDF
Continuous delivery
PDF
Continuously delivering value
PDF
Code reviews
PDF
Baby steps to Domain-Driven Design
PDF
Community and open source
PDF
Using Capifony for Symfony apps deployment (updated)
Use Symfony Messenger Component and CQRS!
Ansible: infrastructure automation for everyone
Automated cryptocurrency trading
Continuous delivery
Continuously delivering value
Code reviews
Baby steps to Domain-Driven Design
Community and open source
Using Capifony for Symfony apps deployment (updated)

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Transform Your Business with a Software ERP System
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Complete React Javascript Course Syllabus.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Understanding Forklifts - TECH EHS Solution
DOCX
The Five Best AI Cover Tools in 2025.docx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
How Creative Agencies Leverage Project Management Software.pdf
L1 - Introduction to python Backend.pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Transform Your Business with a Software ERP System
Online Work Permit System for Fast Permit Processing
Complete React Javascript Course Syllabus.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Wondershare Filmora 15 Crack With Activation Key [2025
ManageIQ - Sprint 268 Review - Slide Deck
Adobe Illustrator 28.6 Crack My Vision of Vector Design
VVF-Customer-Presentation2025-Ver1.9.pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Design an Analysis of Algorithms I-SECS-1021-03
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Understanding Forklifts - TECH EHS Solution
The Five Best AI Cover Tools in 2025.docx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
How Creative Agencies Leverage Project Management Software.pdf

Microservice architecture

  • 1. Microservice architecture Žilvinas Kuusas VilniusPHP 0x19, 2014
  • 2. Who am I? Žilvinas Kuusas lead developer @ Estina / iSign.io t: @kuusas e: zilvinas@kuusas.lt
  • 3. What is a microservice? The microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. Martin Fowler http://martinfowler.com/articles/microservices.html
  • 4. Microservice ● No long-term relationships with technology stack ● Easy to adopt emerging technologies ● Loose coupling ● Single responsibility ● Fault isolation ● Scalability
  • 5. UNIX philosophy rename 's/Airplane/Flight/' `find -name "*Airplane*.php”`
  • 6. UNIX philosophy ls . | sort | tail -n 2 | sort -r | tail -n 1 | cut -c8-21
  • 8. Monolithic application Reality - monolithic application
  • 10. Benefits of monolith ● Quick development ● Simple deployments ● Easy to scale ● Everything in one place
  • 11. Drawbacks of monolith ● Lots of LOC ● Slow builds ● Development is hard to scale ● Continuous deployments becomes difficult ● Scaling application can be difficult ● Requires a long-term commitment to a technology stack
  • 12. Microservices Think about microservice as small, single-purpose application. Simple?
  • 13. Small application ● Runs as individual process ● Smaller means easier for developers to maintain ● Changes does not affect whole system ● Faster to build and deploy ● ...or throw away and rewrite
  • 14. Small application ● Each service has it’s own database ● Code duplication vs. code coupling ● Shared code - libraries
  • 15. Small application “If service is bigger than your head then it’s too big” Internet
  • 16. Deploy independently ● Each microservice runs in it’s own process, so deployment of one service won’t affect the whole application ● Easier to scale development ● Faster feature releases ● Less downtime ● Develop, build and deploy!
  • 17. Flexible solutions ● Modular ● Polyglot data persistence ● Multi-framework
  • 18. Right tool for the job
  • 19. Application: two layers ● System layer ○ gateway: defines interfaces, communication mechanisms ○ rarely changes ● Service layer ○ services with different internal architectures ○ different technology stacks ○ evolves rapidly
  • 20. Application: two layers Application: two layers
  • 21. When to use it? ● In the beginning it will slow down the development ● Later - refactoring might be painful ● It’s easier to merge services than split monolith into services ● ...unless monolith already has loosely-coupled modules
  • 22. Be realistic “Focus on building services that make development and deployment easier - not just tiny services”
  • 23. Nanoservice antipattern A nanoservice is a service whose overhead (communications, maintenance, and so on) outweighs its utility.
  • 24. How services communicate? ● HTTP/REST ● AMQP for asynchronous requests ● Event Sourcing ● Streams
  • 25. Databases ● DB instance per service ● Relational databases, NoSQL, others
  • 26. How to start? ● ESI (Edge Side Includes) ● RabbitMQ ● Gearman ● PHP multithreading
  • 27. Shared data problem ● ServiceA needs to read data which is managed by ServiceB
  • 28. Solution A ServiceA calls ServiceB for data ● Benefits ○ quick implementation ○ data is always fresh ● Drawbacks ○ slows down ServiceA ○ ServiceB might be down at the moment
  • 29. Solution B Data replication ● Benefits ○ availability ○ speed ● Drawbacks ○ data replication overhead
  • 30. Performance ● Latency is your foe ● Everything done asynchronously - no problem ● Keep communication between services as effective as possible. No chit-chats.
  • 31. Drawbacks ● High level of distributed complexity
  • 32. Automation ● Automate everything ○ CI ○ deployments ○ configuration ○ error logging ○ monitoring
  • 33. PHP world PHP world
  • 34. Symfony2 app as service ● Symfony2 isn’t heavy… ● ...if you know how to circumcise it ● Avoid standard edition ● Create your own minimal application http://www.whitewashing.de/2014/04/24/symfony_hello_world.html
  • 35. Symfony2 benefits ● HttpKernel component is one of the greatest things happened in PHP world in years ● SF2 DIC: flexible and extendable way to grow your project ● Console component for CLI utilities ● Standardised solutions
  • 36. Symfony2 as gateway ● Basic SF2 application with dumb controllers for routing services ○ via messaging ● Rendering main views for ESI
  • 37. Challenges ● Define service boundaries ● Continuous Integration ○ Continuous Deployment ● Error logging ● Monitoring ● System tests ○ Consumer tests
  • 38. More challenges... ● Security layer ● Shared configuration ● Shared assets ● Graceful degradation
  • 39. Who is using ~120 services to generate 1 page http://highscalability.com/amazon-architecture Has 600+ services in total http://techblog.netflix.com/ http://www.ebaytechblog.com/
  • 40. Why microservice? ● Scale development ● Scale your application ● Application availability ● Use right tools for the job ● Whole system becomes faster if done right
  • 41. Dig more ● Martin Fowler http://martinfowler. com/articles/microservices.html ● Fred George https://www.youtube.com/watch? v=2rKEveL55TY ● http://blog.arkency.com/2014/07/microservices-72- resources/
  • 42. What’s next? Reactive architecture? http://www.reactivemanifesto.org/