SlideShare a Scribd company logo
1 of 44
Download to read offline
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

What's hot

Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfAhmed Misbah
 
Microservices
MicroservicesMicroservices
MicroservicesSmartBear
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices ArchitectureIzzet Mustafaiev
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecturetyrantbrian
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architectureThe Software House
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Microservices architecture overview v2
Microservices architecture overview v2Microservices architecture overview v2
Microservices architecture overview v2Dmitry Skaredov
 
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInventPros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInventSudhir Tonse
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To MicroservicesLalit Kale
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Araf Karsh Hamid
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices Amazon Web Services
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureFaren faren
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to MicroservicesCisco DevNet
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanAraf Karsh Hamid
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 Chris Richardson
 
Microservices, DevOps & SRE
Microservices, DevOps & SREMicroservices, DevOps & SRE
Microservices, DevOps & SREAraf Karsh Hamid
 

What's hot (20)

Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdf
 
Microservices
MicroservicesMicroservices
Microservices
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Microservices architecture overview v2
Microservices architecture overview v2Microservices architecture overview v2
Microservices architecture overview v2
 
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInventPros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to Microservices
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021
 
Microservices, DevOps & SRE
Microservices, DevOps & SREMicroservices, DevOps & SRE
Microservices, DevOps & SRE
 

Viewers also liked

Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)Developing applications with a microservice architecture (svcc)
Developing applications with a microservice architecture (svcc)Chris Richardson
 
Microservices at Spotify
Microservices at SpotifyMicroservices at Spotify
Microservices at SpotifyKevin Goldsmith
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService ArchitectureFred George
 
Informal invitation
Informal invitationInformal invitation
Informal invitationmelanisha
 
Creativity Lego เอก
 Creativity Lego เอก Creativity Lego เอก
Creativity Lego เอกeakchait
 
Лабораторна робота LR4-5_4-5.1_kozachenko
Лабораторна робота LR4-5_4-5.1_kozachenkoЛабораторна робота LR4-5_4-5.1_kozachenko
Лабораторна робота LR4-5_4-5.1_kozachenkokozachenko2019
 
Autonomic Application Delivery with Tonomi
Autonomic Application Delivery with TonomiAutonomic Application Delivery with Tonomi
Autonomic Application Delivery with TonomiVictoria Livschitz
 
Using Capifony for Symfony apps deployment.
Using Capifony for Symfony apps deployment.Using Capifony for Symfony apps deployment.
Using Capifony for Symfony apps deployment.Žilvinas Kuusas
 
установка колонн летучек
установка колонн летучекустановка колонн летучек
установка колонн летучекgeoplast2007ru
 
Autonomic Management of Cloud Applications with Tonomi, Gluecon Keynote, 2015
Autonomic Management of Cloud Applications with Tonomi, Gluecon Keynote, 2015Autonomic Management of Cloud Applications with Tonomi, Gluecon Keynote, 2015
Autonomic Management of Cloud Applications with Tonomi, Gluecon Keynote, 2015Victoria Livschitz
 
Makalah biologi
Makalah biologiMakalah biologi
Makalah biologimelanisha
 
Revamping the math classroom
Revamping the math classroomRevamping the math classroom
Revamping the math classroomcamille541
 
High availability is not a luxury webcast
High availability is not a luxury webcastHigh availability is not a luxury webcast
High availability is not a luxury webcastGina Tragos
 
Autonomic Application Management with Qubell (and Docker)
Autonomic Application Management with Qubell (and Docker)Autonomic Application Management with Qubell (and Docker)
Autonomic Application Management with Qubell (and Docker)Victoria Livschitz
 
технология селективной изоляции водопритока
технология селективной изоляции водопритокатехнология селективной изоляции водопритока
технология селективной изоляции водопритокаgeoplast2007ru
 
Enterprise in your degree - Neil Coles
Enterprise in your degree - Neil ColesEnterprise in your degree - Neil Coles
Enterprise in your degree - Neil ColesHEA_AH
 
Aleksander Królikowski
Aleksander KrólikowskiAleksander Królikowski
Aleksander KrólikowskiDysk
 
Ha cluster -Public to Private
Ha cluster -Public to PrivateHa cluster -Public to Private
Ha cluster -Public to Privatetestslidesha12
 
Enhancing employability through enterprise education: BSc Business Enterprise...
Enhancing employability through enterprise education: BSc Business Enterprise...Enhancing employability through enterprise education: BSc Business Enterprise...
Enhancing employability through enterprise education: BSc Business Enterprise...HEA_AH
 
طريقنا الى القلوب!
طريقنا الى القلوب!طريقنا الى القلوب!
طريقنا الى القلوب!Eslam Ashraf
 

Viewers also liked (20)

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

Similar to Microservice architecture

Ledingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in actionLedingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in actionMukesh Singh
 
Ato Z of Microservices Architecture by Systango
Ato Z of Microservices Architecture by SystangoAto Z of Microservices Architecture by Systango
Ato Z of Microservices Architecture by SystangoSystango
 
Introduction to Microservices Architecture - SECCOMP 2020
Introduction to Microservices Architecture - SECCOMP 2020Introduction to Microservices Architecture - SECCOMP 2020
Introduction to Microservices Architecture - SECCOMP 2020Rodrigo Antonialli
 
micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)smancke
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservicesRon Barabash
 
The FN Project by Maximilian Jerg
The FN Project by Maximilian JergThe FN Project by Maximilian Jerg
The FN Project by Maximilian JergHarald Schmaldienst
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureYshay Yaacobi
 
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)Binary Studio
 
AppDev with Microservices
AppDev with MicroservicesAppDev with Microservices
AppDev with MicroservicesRishabh Dugar
 
Service-Mesh-Presentation.pdf
Service-Mesh-Presentation.pdfService-Mesh-Presentation.pdf
Service-Mesh-Presentation.pdfchanhluc2112
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMiki Lombardi
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?NGINX, Inc.
 
Evolution of Application Development
Evolution of Application DevelopmentEvolution of Application Development
Evolution of Application DevelopmentWSO2
 
Evolution of Application Development
Evolution of Application DevelopmentEvolution of Application Development
Evolution of Application Developmentkshanth2101
 
NATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATSNATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATSRaül Pérez
 
Nats in action a real time microservices architecture handled by nats
Nats in action   a real time microservices architecture handled by natsNats in action   a real time microservices architecture handled by nats
Nats in action a real time microservices architecture handled by natsRaul Perez
 

Similar to Microservice architecture (20)

Microservices
MicroservicesMicroservices
Microservices
 
Ledingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in actionLedingkart Meetup #1: Monolithic to microservices in action
Ledingkart Meetup #1: Monolithic to microservices in action
 
Ato Z of Microservices Architecture by Systango
Ato Z of Microservices Architecture by SystangoAto Z of Microservices Architecture by Systango
Ato Z of Microservices Architecture by Systango
 
Introduction to Microservices Architecture - SECCOMP 2020
Introduction to Microservices Architecture - SECCOMP 2020Introduction to Microservices Architecture - SECCOMP 2020
Introduction to Microservices Architecture - SECCOMP 2020
 
Surviving microservices
Surviving microservicesSurviving microservices
Surviving microservices
 
micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)micro services architecture (FrosCon2014)
micro services architecture (FrosCon2014)
 
Yotpo microservices
Yotpo microservicesYotpo microservices
Yotpo microservices
 
linkerd.pdf
linkerd.pdflinkerd.pdf
linkerd.pdf
 
The FN Project by Maximilian Jerg
The FN Project by Maximilian JergThe FN Project by Maximilian Jerg
The FN Project by Maximilian Jerg
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
 
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)
 
AppDev with Microservices
AppDev with MicroservicesAppDev with Microservices
AppDev with Microservices
 
Service-Mesh-Presentation.pdf
Service-Mesh-Presentation.pdfService-Mesh-Presentation.pdf
Service-Mesh-Presentation.pdf
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
 
Microservices: an introduction
Microservices: an introductionMicroservices: an introduction
Microservices: an introduction
 
Evolution of Application Development
Evolution of Application DevelopmentEvolution of Application Development
Evolution of Application Development
 
Evolution of Application Development
Evolution of Application DevelopmentEvolution of Application Development
Evolution of Application Development
 
NATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATSNATS in action - A Real time Microservices Architecture handled by NATS
NATS in action - A Real time Microservices Architecture handled by NATS
 
Nats in action a real time microservices architecture handled by nats
Nats in action   a real time microservices architecture handled by natsNats in action   a real time microservices architecture handled by nats
Nats in action a real time microservices architecture handled by nats
 

More from Žilvinas Kuusas

Use Symfony Messenger Component and CQRS!
Use Symfony Messenger Component and CQRS!Use Symfony Messenger Component and CQRS!
Use Symfony Messenger Component and CQRS!Žilvinas Kuusas
 
Ansible: infrastructure automation for everyone
Ansible: infrastructure automation for everyoneAnsible: infrastructure automation for everyone
Ansible: infrastructure automation for everyoneŽilvinas Kuusas
 
Automated cryptocurrency trading
Automated cryptocurrency tradingAutomated cryptocurrency trading
Automated cryptocurrency tradingŽilvinas Kuusas
 
Continuously delivering value
Continuously delivering valueContinuously delivering value
Continuously delivering valueŽilvinas Kuusas
 
Baby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignBaby steps to Domain-Driven Design
Baby steps to Domain-Driven DesignŽilvinas Kuusas
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Žilvinas Kuusas
 

More from Žilvinas Kuusas (9)

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

Recently uploaded

Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 

Recently uploaded (20)

Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.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/