SlideShare a Scribd company logo
ITERATORSI T E R A T O R S @luksow
Microservices 101
opportunities, dilemmas and problems
Łukasz Sowa, 4Developers 2015
ITERATORSI T E R A T O R S @luksow
Hi, I'm Łukasz
●
Co-founder, engineer @ Iterators (http://iterato.rs)
●
Highly concurrent & distributed systems
●
Pizza, beer & football lover
●
http://luksow.com
●
contact@luksow.com
●
@luksow
ITERATORSI T E R A T O R S @luksow
What's in it for you?
●
Learn
– What are microservices?
– Why they might be useful?
– What questions do they bring up?
– What's hard about them?
●
Takeaways
– Feel enthusiastic but cautious about microservices
– Be able to design your next project using microservices
ITERATORSI T E R A T O R S @luksow
What are microservices?
●
Architectural style (MSA)
●
System is composed of multiple services
– Small*
– Independently deployed
– Communicate using (lightweight) protocols
– Organized around business capabilities
●
Bounded Context (DDD) or Single Responsibility
Principle (OO) implemented in architecture
ITERATORSI T E R A T O R S @luksow
Why? Why now?
●
Post-SOA (or SOA done right?)
●
DevOps revolution (provisioning, deployment)
●
Cheap hardware
●
Existing systems got too big and too boring?
●
Innovation market got immensely demanding
(Netflix, Gilt, Tumblr, Amazon, SoundCloud)
ITERATORSI T E R A T O R S @luksow
Let's design!
Design a system that allows users to login/register using FB, email-password or
codecard. Authenticated user can subscribe to different events from BTC
markets (ex. rate changed, volume over N, ask below M etc.) and get real-time alerts
about them. Make sure to gather relevant business metrics.
auth-fb auth-pass auth-codes
btc-users
btc-ws
identity
metrics
session
token
frontend
btc-market
load balancer
ITERATORSI T E R A T O R S @luksow
Opportunities
Why people love microservices?
ITERATORSI T E R A T O R S @luksow
Technical advantages
●
Horizontal scaling performance→
●
Designing for failure resilience→
auth-fb auth-pass auth-codes
btc-users
btc-ws
identity
metrics
session
token
frontend
btc-market
load balancer
btc-wsbtc-ws
Scaling
X
Resilience
ITERATORSI T E R A T O R S @luksow
Cultural advantages (1)
Any organization that designs a system (defined
more broadly here than just information systems)
will inevitably produce a design whose structure is
a copy of the organization's communication
structure.
Melvin Conway, How Do Committees Invent, 1968
ITERATORSI T E R A T O R S @luksow
Cultural advantages (2)
●
Siloed teams vs cross-functional teams
●
Less communication overhead
●
Business-oriented teams – microbusinesses
●
The True Way of (scrum) team scaling
●
Agility + autonomy → short time-to-market
MGR UX
FE
DEV
BE
DEV
DBA OPS QA vs
ITERATORSI T E R A T O R S @luksow
Cultural advantages (3)
●
Easy to understand
●
Dispose/rewrite vs refactor
●
Polyglot environment, better tools utilization
●
Mythical reusability?
●
Fun!
ITERATORSI T E R A T O R S @luksow
Dilemmas
Decisions, decisions, decisions...
ITERATORSI T E R A T O R S @luksow
Communication, protocols
●
Communication - most important MSA concern
●
Microservices ≠ REST
●
Plethora of possibilities
– Universal: REST+JSON/XML, MQs, binary TCP/UDP, ... simple, decoupled,→
polyglot but low-level, full of boilerplate, possible code duplication
– Platform-specifc: Akka, Finagle, … easier to code & maintain, code reuse→
but tightly coupled, platform-dependant, not polyglot
●
Prefer universal & lightweight (UNIX - smart endpoints, dumb pipes)
●
Microservices are mostly REST
●
Remember about Postel's law
ITERATORSI T E R A T O R S @luksow
Synchronous vs asynchronous
●
Request-response
●
ASAP response
●
“Asking”
●
Fail-fast
●
Easy to reason about
●
Timeouts?
●
Don't scale
Ex. REST, ...
●
Message passing
●
Deferred processing
●
“Telling”
●
Unnatural
●
Complicated, hard to debug
●
Recovering from failures
●
Scale
Ex. WebSockets, MQs, Akka,
UDP, ...
ITERATORSI T E R A T O R S @luksow
Protocols in action
auth-fb auth-pass auth-codes
btc-users
btc-ws
identity
metrics
session
token
btc-market
REST/JSON WebSockets
REST/JSON Akka
AkkaHTTP Keep-Alive
ITERATORSI T E R A T O R S @luksow
Guarantees
●
What guarantees do you need?
– What's the cost of a single message being lost?
– What happens if system is in inconsistent state?
– …
●
No ACID (atomicity, consistency, isolation, durability)
●
But CAP theorem (consistency, availability, partition tolerance)
●
Eventual consistency, 2PC, 3PC, Paxos & others are your friends
now
●
What do you need? What can/cannot you afford?
●
And no, you can't have everything
ITERATORSI T E R A T O R S @luksow
Shared vs private data stores
●
Source of truth
●
Strong
contract/protocol
●
Convenient
●
Coupling
●
Don't scale
●
Ownership issues
●
Service becomes an
abstraction over DS
●
Polyglot persistence
●
Decoupling
●
Scale
●
Truth is distributed
●
Façade issues
●
Recommended
ITERATORSI T E R A T O R S @luksow
Private data stores
auth-fb auth-pass auth-codes
btc-users
btc-ws
identity
metrics
session
token
btc-market
MongoDB
Redis PostgreSQL PostgreSQL
PostgreSQL
MongoDB
Event journal
ITERATORSI T E R A T O R S @luksow
Shared data stores
auth-fb auth-pass auth-codes
btc-users
btc-ws
metrics
session
btc-market
MongoDB
token
Redis PostgreSQL PostgreSQL
PostgreSQL
identity
MongoDB
Event journal
ITERATORSI T E R A T O R S @luksow
Size & structure
●
How big is microservice?
– ~100 lines rule is a lie
– Up to a couple of thousands LOC in most cases
– Rule: as short as possible but as big as necessary
●
Clean & structured vs short & hacky
Resources
Service
Domain
Repositories
Data mappers
Gateways
Applicationvs
●
Well-structured
●
Requires time to
analyse
●
Easy to maintain
●
Longer
●
Unstructured
●
Understandable
at a glance
●
Hard to maintain
●
Much shorter
ITERATORSI T E R A T O R S @luksow
Size & structure - example
Name Structured? LoC / eLoC
auth-fb Yes 215 / 189
auth-pass Yes 301 / 258
auth-codes Yes 337 / 299
identity No 77 / 66
session No 48 / 43
token Yes 182 / 167
metrics No 160 / 150
btc-ws No 155 / 140
btc-users Yes 153 / 141
btc-market No 51 / 40
TOTAL 5 Yes / 5 No 1679 / 1493
ITERATORSI T E R A T O R S @luksow
Code sharing
Sometimes the same code is required in two or
more services – how to share it?
●
Shared library coupling, not polyglot→
●
Nanoservice maintenance burden, performance→
●
Copy-paste duplication, more code to maintain→
No good answer here (3rd is the most popular)
ITERATORSI T E R A T O R S @luksow
Polyglot vs monoculture
●
Tower of Babel problem
●
Unmaintainable code rewrites costs→ →
●
Multiple platforms lots of ops costs→ →
●
But you want to use best tools and have fun
●
Make recommendations about defaults – and innovate from there
– “We use Scala for such tasks unless there's a better solution”
– “PostgreSQL is our default database because XYZ”
– “We prefer Redis with Rediscala library for caching”
ITERATORSI T E R A T O R S @luksow
Testing
●
Don't test
– “This big” correctness rule
– Run in production, rollback on problems
●
Test – good ol' style
– Unit tests, integration tests, component tests, contract tests, end-to-
end tests
– Favour black-box tests
●
Test – in a distributed system way
– No way to really do that
– Chaos monkey
ITERATORSI T E R A T O R S @luksow
Problems
Distributed systems are hard
ITERATORSI T E R A T O R S @luksow
Operations
●
Infrastructure, different machine utilization strategies
●
Provisioning
●
Deployment pipeline
●
Monitoring
●
Service discovery & confguration management
●
Code templates with boilerplate
●
Close collaboration of developers & operations DevOps→
●
Costs time & money
ITERATORSI T E R A T O R S @luksow
Complexity
●
Complexity never goes away
●
Code complexity communication complexity→
●
It's easy to make (worse) spaghetti there as well
●
MSA requires more code to be written (boilerplate)
●
More work at the initial stage (foundations)
●
Avoid nanoservices maintenance burden→
ITERATORSI T E R A T O R S @luksow
Distributed computing
●
Fallacies of distributed computing (Peter Deutsch, 1994)
– The network is reliable
– Latency is zero
– Bandwidth is infnite
– The network is secure
– Topology doesn't change
– There is one administrator
– Transport cost is zero
– The network is homogeneous
●
Ex. RPC (vs local call)
– It can fail
– It can timeout (and still execute successfully!)
– It is a couple of magnitudes slower
ITERATORSI T E R A T O R S @luksow
Contracts
●
What API should I have?
●
Who are my collaborators?
●
How can I contact them?
●
Make product owners defne API & protocols
●
Service discovery & confguration management (ex.
ZooKeeper, Consul.io)
●
Think about help from providers (libraries, stubs, ex.
Swagger, pact)
ITERATORSI T E R A T O R S @luksow
Versioning
●
How to handle changes?
●
How to handle external (ex. API) changes?
●
Keep multiple versions in production
●
Observe their behaviour
●
Let the load balancers do the heavy lifting
●
Embrace it to do A/B testing
ITERATORSI T E R A T O R S @luksow
Monitoring, metrics
●
Monitor/measure all the things!
●
(You should be doing it in monolith anyway)
●
System metrics, health monitoring
●
Business metrics
●
Keep yourself informed about anomalies
●
Observe analyse react→ →
ITERATORSI T E R A T O R S @luksow
Logging & debugging
●
How do you debug distributed system?
●
Next to impossible, completely different from
monolith
●
Centralized logging with correlation id and
efficient search (no, grep doesn't work anymore)
●
Tracing whenever possible
●
Again, monitor/measure everything (including
network traffic)
ITERATORSI T E R A T O R S @luksow
Security
●
Larger network larger attack surface→
●
Ex. internal API leakage
auth-fb auth-pass auth-codes
btc-users
btc-ws
identity
metrics
session
token
btc-market
Internal API
External API
ITERATORSI T E R A T O R S @luksow
Frontend
●
No microservices solution for frontend
●
Visual coherency coupling→
●
Monoliths (ex. SPA)
●
Fragments
ITERATORSI T E R A T O R S @luksow
Conclusions
tldr;
ITERATORSI T E R A T O R S @luksow
Is it worth it? When?
●
For problems that microservices likely solve
●
If you're working on a well-funded, innovative
products, in a big teams
●
If you have certain DevOps maturity
●
If you can write proper monoliths
●
If you're not expecting a free lunch
ITERATORSI T E R A T O R S @luksow
How to start?
●
Try gradually migrating from monolith, don't
start from scratch
●
Make sure you have DevOps capabilities
●
Reorganize teams around features
●
Think in microservices, not in monolith
●
Don't do “new architecture”, “new platform”,
“new languages” all at once
ITERATORSI T E R A T O R S @luksow
What to remember?
●
Microservices are hard
– Operations
– Complexity
– Distribution
●
But they can be very rewarding
– Team scaling & developer happiness
– Scaling
– Resilience
ITERATORSI T E R A T O R S @luksow
Thanks!
●
Łukasz Sowa
●
http://luksow.com
●
http://iterato.rs
●
contact@luksow.com
●
@luksow
Questions?

More Related Content

What's hot

OpenTelemetry For Operators
OpenTelemetry For OperatorsOpenTelemetry For Operators
OpenTelemetry For Operators
Kevin Brockhoff
 
Distributed tracing using open tracing & jaeger 2
Distributed tracing using open tracing & jaeger 2Distributed tracing using open tracing & jaeger 2
Distributed tracing using open tracing & jaeger 2
Chandresh Pancholi
 
Opentracing 101
Opentracing 101Opentracing 101
Opentracing 101
HungWei Chiu
 
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
Yiran Wang
 
High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017
Rick Hightower
 
Distributed tracing with OpenTracing and Jaeger @ getstream.io
Distributed tracing with OpenTracing and Jaeger @ getstream.ioDistributed tracing with OpenTracing and Jaeger @ getstream.io
Distributed tracing with OpenTracing and Jaeger @ getstream.io
Max Klyga
 
Encode Club workshop slides
Encode Club workshop slidesEncode Club workshop slides
Encode Club workshop slides
Vanessa Lošić
 
Tracing Micro Services with OpenTracing
Tracing Micro Services with OpenTracingTracing Micro Services with OpenTracing
Tracing Micro Services with OpenTracing
Hemant Kumar
 
Function Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
Function Mesh for Apache Pulsar, the Way for Simple Streaming SolutionsFunction Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
Function Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
StreamNative
 
Fluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellFluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshell
N Masahiro
 
FluentD for end to end monitoring
FluentD for end to end monitoringFluentD for end to end monitoring
FluentD for end to end monitoring
Phil Wilkins
 
Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021
Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021
Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021
StreamNative
 
Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speed
SATOSHI TAGOMORI
 
OpenDaylight OpenFlow clustering
OpenDaylight OpenFlow clusteringOpenDaylight OpenFlow clustering
OpenDaylight OpenFlow clustering
OpenDaylight
 
Ekon21 Microservices - Event Driven Design
Ekon21 Microservices - Event Driven DesignEkon21 Microservices - Event Driven Design
Ekon21 Microservices - Event Driven Design
Arnaud Bouchez
 
Fast SOA with Apache Synapse
Fast SOA with Apache SynapseFast SOA with Apache Synapse
Fast SOA with Apache Synapse
Paul Fremantle
 
Fluentd 101
Fluentd 101Fluentd 101
Fluentd 101
SATOSHI TAGOMORI
 
Using Apache Pulsar as a Modern, Scalable, High Performing JMS Platform - Pus...
Using Apache Pulsar as a Modern, Scalable, High Performing JMS Platform - Pus...Using Apache Pulsar as a Modern, Scalable, High Performing JMS Platform - Pus...
Using Apache Pulsar as a Modern, Scalable, High Performing JMS Platform - Pus...
StreamNative
 
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database clusterGrokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking VN
 
The Java Microservice Library
The Java Microservice LibraryThe Java Microservice Library
The Java Microservice Library
Rick Hightower
 

What's hot (20)

OpenTelemetry For Operators
OpenTelemetry For OperatorsOpenTelemetry For Operators
OpenTelemetry For Operators
 
Distributed tracing using open tracing & jaeger 2
Distributed tracing using open tracing & jaeger 2Distributed tracing using open tracing & jaeger 2
Distributed tracing using open tracing & jaeger 2
 
Opentracing 101
Opentracing 101Opentracing 101
Opentracing 101
 
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
 
High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017High-speed, Reactive Microservices 2017
High-speed, Reactive Microservices 2017
 
Distributed tracing with OpenTracing and Jaeger @ getstream.io
Distributed tracing with OpenTracing and Jaeger @ getstream.ioDistributed tracing with OpenTracing and Jaeger @ getstream.io
Distributed tracing with OpenTracing and Jaeger @ getstream.io
 
Encode Club workshop slides
Encode Club workshop slidesEncode Club workshop slides
Encode Club workshop slides
 
Tracing Micro Services with OpenTracing
Tracing Micro Services with OpenTracingTracing Micro Services with OpenTracing
Tracing Micro Services with OpenTracing
 
Function Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
Function Mesh for Apache Pulsar, the Way for Simple Streaming SolutionsFunction Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
Function Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
 
Fluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshellFluentd v1.0 in a nutshell
Fluentd v1.0 in a nutshell
 
FluentD for end to end monitoring
FluentD for end to end monitoringFluentD for end to end monitoring
FluentD for end to end monitoring
 
Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021
Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021
Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021
 
Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speed
 
OpenDaylight OpenFlow clustering
OpenDaylight OpenFlow clusteringOpenDaylight OpenFlow clustering
OpenDaylight OpenFlow clustering
 
Ekon21 Microservices - Event Driven Design
Ekon21 Microservices - Event Driven DesignEkon21 Microservices - Event Driven Design
Ekon21 Microservices - Event Driven Design
 
Fast SOA with Apache Synapse
Fast SOA with Apache SynapseFast SOA with Apache Synapse
Fast SOA with Apache Synapse
 
Fluentd 101
Fluentd 101Fluentd 101
Fluentd 101
 
Using Apache Pulsar as a Modern, Scalable, High Performing JMS Platform - Pus...
Using Apache Pulsar as a Modern, Scalable, High Performing JMS Platform - Pus...Using Apache Pulsar as a Modern, Scalable, High Performing JMS Platform - Pus...
Using Apache Pulsar as a Modern, Scalable, High Performing JMS Platform - Pus...
 
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database clusterGrokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
 
The Java Microservice Library
The Java Microservice LibraryThe Java Microservice Library
The Java Microservice Library
 

Viewers also liked

Microservices in Scala - theory & practice
Microservices in Scala - theory & practiceMicroservices in Scala - theory & practice
Microservices in Scala - theory & practice
Łukasz Sowa
 
Microservices 101 - The Big Why?
Microservices 101 - The Big Why?Microservices 101 - The Big Why?
Microservices 101 - The Big Why?
Yamen Sader
 
Practical Akka HTTP - introduction
Practical Akka HTTP - introductionPractical Akka HTTP - introduction
Practical Akka HTTP - introduction
Łukasz Sowa
 
Microservices in Scala: Play Framework
Microservices in Scala: Play FrameworkMicroservices in Scala: Play Framework
Microservices in Scala: Play Framework
Łukasz Sowa
 
Truly agile company
Truly agile companyTruly agile company
Truly agile company
Marek Kirejczyk
 
Auckland API & Microservices Meetup 1: API led design
Auckland API & Microservices Meetup 1: API led designAuckland API & Microservices Meetup 1: API led design
Auckland API & Microservices Meetup 1: API led design
Damian Harvey
 
Microservices 101: Exploiting Reality's Constraints with Technology
Microservices 101: Exploiting Reality's Constraints with TechnologyMicroservices 101: Exploiting Reality's Constraints with Technology
Microservices 101: Exploiting Reality's Constraints with Technology
Legacy Typesafe (now Lightbend)
 
Microservices 101: From DevOps to Docker and beyond
Microservices 101: From DevOps to Docker and beyondMicroservices 101: From DevOps to Docker and beyond
Microservices 101: From DevOps to Docker and beyond
Donnie Berkholz
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
Faren faren
 
Revitalizing Aging Architectures with Microservices
Revitalizing Aging Architectures with MicroservicesRevitalizing Aging Architectures with Microservices
Revitalizing Aging Architectures with Microservices
Legacy Typesafe (now Lightbend)
 
Securing Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPSecuring Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTP
Rafal Gancarz
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
Łukasz Sowa
 
eServices-Chp5: Microservices et API Management
eServices-Chp5: Microservices et API ManagementeServices-Chp5: Microservices et API Management
eServices-Chp5: Microservices et API Management
Lilia Sfaxi
 
Microservices = Death of the Enterprise Service Bus (ESB)?
Microservices = Death of the Enterprise Service Bus (ESB)?Microservices = Death of the Enterprise Service Bus (ESB)?
Microservices = Death of the Enterprise Service Bus (ESB)?
Kai Wähner
 
REST and Microservices
REST and MicroservicesREST and Microservices
REST and Microservices
Shaun Abram
 
Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...
Kim Clark
 
Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016
Adrian Cockcroft
 
Journey to Cloud-Native: Where to start in your app modernization process
Journey to Cloud-Native: Where to start in your app modernization processJourney to Cloud-Native: Where to start in your app modernization process
Journey to Cloud-Native: Where to start in your app modernization process
VMware Tanzu
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocity
Sam Newman
 

Viewers also liked (19)

Microservices in Scala - theory & practice
Microservices in Scala - theory & practiceMicroservices in Scala - theory & practice
Microservices in Scala - theory & practice
 
Microservices 101 - The Big Why?
Microservices 101 - The Big Why?Microservices 101 - The Big Why?
Microservices 101 - The Big Why?
 
Practical Akka HTTP - introduction
Practical Akka HTTP - introductionPractical Akka HTTP - introduction
Practical Akka HTTP - introduction
 
Microservices in Scala: Play Framework
Microservices in Scala: Play FrameworkMicroservices in Scala: Play Framework
Microservices in Scala: Play Framework
 
Truly agile company
Truly agile companyTruly agile company
Truly agile company
 
Auckland API & Microservices Meetup 1: API led design
Auckland API & Microservices Meetup 1: API led designAuckland API & Microservices Meetup 1: API led design
Auckland API & Microservices Meetup 1: API led design
 
Microservices 101: Exploiting Reality's Constraints with Technology
Microservices 101: Exploiting Reality's Constraints with TechnologyMicroservices 101: Exploiting Reality's Constraints with Technology
Microservices 101: Exploiting Reality's Constraints with Technology
 
Microservices 101: From DevOps to Docker and beyond
Microservices 101: From DevOps to Docker and beyondMicroservices 101: From DevOps to Docker and beyond
Microservices 101: From DevOps to Docker and beyond
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Revitalizing Aging Architectures with Microservices
Revitalizing Aging Architectures with MicroservicesRevitalizing Aging Architectures with Microservices
Revitalizing Aging Architectures with Microservices
 
Securing Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPSecuring Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTP
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
 
eServices-Chp5: Microservices et API Management
eServices-Chp5: Microservices et API ManagementeServices-Chp5: Microservices et API Management
eServices-Chp5: Microservices et API Management
 
Microservices = Death of the Enterprise Service Bus (ESB)?
Microservices = Death of the Enterprise Service Bus (ESB)?Microservices = Death of the Enterprise Service Bus (ESB)?
Microservices = Death of the Enterprise Service Bus (ESB)?
 
REST and Microservices
REST and MicroservicesREST and Microservices
REST and Microservices
 
Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...
 
Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016Microservices Workshop All Topics Deck 2016
Microservices Workshop All Topics Deck 2016
 
Journey to Cloud-Native: Where to start in your app modernization process
Journey to Cloud-Native: Where to start in your app modernization processJourney to Cloud-Native: Where to start in your app modernization process
Journey to Cloud-Native: Where to start in your app modernization process
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocity
 

Similar to Microservices 101: opportunities, dilemmas and problems

A field guide to the Financial Times, Rhys Evans, Financial Times
A field guide to the Financial Times, Rhys Evans, Financial TimesA field guide to the Financial Times, Rhys Evans, Financial Times
A field guide to the Financial Times, Rhys Evans, Financial Times
Neo4j
 
Leveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous SystemsLeveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous Systems
ICS
 
Software Engineering Primer
Software Engineering PrimerSoftware Engineering Primer
Software Engineering Primer
Georg Buske
 
2020 | Metadata Day | LinkedIn
2020 | Metadata Day | LinkedIn2020 | Metadata Day | LinkedIn
2020 | Metadata Day | LinkedIn
Deepak Chandramouli
 
How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...
How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...
How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...
Radovan Semancik
 
Everything We Learned About In-Memory Data Layout While Building VoltDB
Everything We Learned About In-Memory Data Layout While Building VoltDBEverything We Learned About In-Memory Data Layout While Building VoltDB
Everything We Learned About In-Memory Data Layout While Building VoltDB
jhugg
 
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
JohnMathewPhilip
 
AMW43 - Unba.se, Distributed database for human interaction
AMW43 - Unba.se, Distributed database for human interactionAMW43 - Unba.se, Distributed database for human interaction
AMW43 - Unba.se, Distributed database for human interaction
Daniel Norman
 
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
Yshay Yaacobi
 
From prototype to production - The journey of re-designing SmartUp.io
From prototype to production - The journey of re-designing SmartUp.ioFrom prototype to production - The journey of re-designing SmartUp.io
From prototype to production - The journey of re-designing SmartUp.io
Máté Lang
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...
Viktor Turskyi
 
The working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийThe working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор Турский
Sigma Software
 
Wie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmenWie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmen
Anatole Tresch
 
Path dependent-development (PyCon India)
Path dependent-development (PyCon India)Path dependent-development (PyCon India)
Path dependent-development (PyCon India)
ncoghlan_dev
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
Wes McKinney
 
The journey to container adoption in enterprise
The journey to container adoption in enterpriseThe journey to container adoption in enterprise
The journey to container adoption in enterprise
Igor Moochnick
 
Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)
ncoghlan_dev
 
From the South: building together a high-tech ecosystem
From the South: building together a high-tech ecosystemFrom the South: building together a high-tech ecosystem
From the South: building together a high-tech ecosystemNicolás Erdödy
 
What drives Innovation? Innovations And Technological Solutions for the Distr...
What drives Innovation? Innovations And Technological Solutions for the Distr...What drives Innovation? Innovations And Technological Solutions for the Distr...
What drives Innovation? Innovations And Technological Solutions for the Distr...Stefano Fago
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Brian Brazil
 

Similar to Microservices 101: opportunities, dilemmas and problems (20)

A field guide to the Financial Times, Rhys Evans, Financial Times
A field guide to the Financial Times, Rhys Evans, Financial TimesA field guide to the Financial Times, Rhys Evans, Financial Times
A field guide to the Financial Times, Rhys Evans, Financial Times
 
Leveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous SystemsLeveraging Open Standards to Build Highly Extensible Autonomous Systems
Leveraging Open Standards to Build Highly Extensible Autonomous Systems
 
Software Engineering Primer
Software Engineering PrimerSoftware Engineering Primer
Software Engineering Primer
 
2020 | Metadata Day | LinkedIn
2020 | Metadata Day | LinkedIn2020 | Metadata Day | LinkedIn
2020 | Metadata Day | LinkedIn
 
How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...
How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...
How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...
 
Everything We Learned About In-Memory Data Layout While Building VoltDB
Everything We Learned About In-Memory Data Layout While Building VoltDBEverything We Learned About In-Memory Data Layout While Building VoltDB
Everything We Learned About In-Memory Data Layout While Building VoltDB
 
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
 
AMW43 - Unba.se, Distributed database for human interaction
AMW43 - Unba.se, Distributed database for human interactionAMW43 - Unba.se, Distributed database for human interaction
AMW43 - Unba.se, Distributed database for human interaction
 
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
 
From prototype to production - The journey of re-designing SmartUp.io
From prototype to production - The journey of re-designing SmartUp.ioFrom prototype to production - The journey of re-designing SmartUp.io
From prototype to production - The journey of re-designing SmartUp.io
 
The working architecture of node js applications open tech week javascript ...
The working architecture of node js applications   open tech week javascript ...The working architecture of node js applications   open tech week javascript ...
The working architecture of node js applications open tech week javascript ...
 
The working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор ТурскийThe working architecture of NodeJS applications, Виктор Турский
The working architecture of NodeJS applications, Виктор Турский
 
Wie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmenWie Monolithen für die Zukuft trimmen
Wie Monolithen für die Zukuft trimmen
 
Path dependent-development (PyCon India)
Path dependent-development (PyCon India)Path dependent-development (PyCon India)
Path dependent-development (PyCon India)
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
The journey to container adoption in enterprise
The journey to container adoption in enterpriseThe journey to container adoption in enterprise
The journey to container adoption in enterprise
 
Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)
 
From the South: building together a high-tech ecosystem
From the South: building together a high-tech ecosystemFrom the South: building together a high-tech ecosystem
From the South: building together a high-tech ecosystem
 
What drives Innovation? Innovations And Technological Solutions for the Distr...
What drives Innovation? Innovations And Technological Solutions for the Distr...What drives Innovation? Innovations And Technological Solutions for the Distr...
What drives Innovation? Innovations And Technological Solutions for the Distr...
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
 

Recently uploaded

Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
abdulrafaychaudhry
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 

Recently uploaded (20)

Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 

Microservices 101: opportunities, dilemmas and problems

  • 1. ITERATORSI T E R A T O R S @luksow Microservices 101 opportunities, dilemmas and problems Łukasz Sowa, 4Developers 2015
  • 2. ITERATORSI T E R A T O R S @luksow Hi, I'm Łukasz ● Co-founder, engineer @ Iterators (http://iterato.rs) ● Highly concurrent & distributed systems ● Pizza, beer & football lover ● http://luksow.com ● contact@luksow.com ● @luksow
  • 3. ITERATORSI T E R A T O R S @luksow What's in it for you? ● Learn – What are microservices? – Why they might be useful? – What questions do they bring up? – What's hard about them? ● Takeaways – Feel enthusiastic but cautious about microservices – Be able to design your next project using microservices
  • 4. ITERATORSI T E R A T O R S @luksow What are microservices? ● Architectural style (MSA) ● System is composed of multiple services – Small* – Independently deployed – Communicate using (lightweight) protocols – Organized around business capabilities ● Bounded Context (DDD) or Single Responsibility Principle (OO) implemented in architecture
  • 5. ITERATORSI T E R A T O R S @luksow Why? Why now? ● Post-SOA (or SOA done right?) ● DevOps revolution (provisioning, deployment) ● Cheap hardware ● Existing systems got too big and too boring? ● Innovation market got immensely demanding (Netflix, Gilt, Tumblr, Amazon, SoundCloud)
  • 6. ITERATORSI T E R A T O R S @luksow Let's design! Design a system that allows users to login/register using FB, email-password or codecard. Authenticated user can subscribe to different events from BTC markets (ex. rate changed, volume over N, ask below M etc.) and get real-time alerts about them. Make sure to gather relevant business metrics. auth-fb auth-pass auth-codes btc-users btc-ws identity metrics session token frontend btc-market load balancer
  • 7. ITERATORSI T E R A T O R S @luksow Opportunities Why people love microservices?
  • 8. ITERATORSI T E R A T O R S @luksow Technical advantages ● Horizontal scaling performance→ ● Designing for failure resilience→ auth-fb auth-pass auth-codes btc-users btc-ws identity metrics session token frontend btc-market load balancer btc-wsbtc-ws Scaling X Resilience
  • 9. ITERATORSI T E R A T O R S @luksow Cultural advantages (1) Any organization that designs a system (defined more broadly here than just information systems) will inevitably produce a design whose structure is a copy of the organization's communication structure. Melvin Conway, How Do Committees Invent, 1968
  • 10. ITERATORSI T E R A T O R S @luksow Cultural advantages (2) ● Siloed teams vs cross-functional teams ● Less communication overhead ● Business-oriented teams – microbusinesses ● The True Way of (scrum) team scaling ● Agility + autonomy → short time-to-market MGR UX FE DEV BE DEV DBA OPS QA vs
  • 11. ITERATORSI T E R A T O R S @luksow Cultural advantages (3) ● Easy to understand ● Dispose/rewrite vs refactor ● Polyglot environment, better tools utilization ● Mythical reusability? ● Fun!
  • 12. ITERATORSI T E R A T O R S @luksow Dilemmas Decisions, decisions, decisions...
  • 13. ITERATORSI T E R A T O R S @luksow Communication, protocols ● Communication - most important MSA concern ● Microservices ≠ REST ● Plethora of possibilities – Universal: REST+JSON/XML, MQs, binary TCP/UDP, ... simple, decoupled,→ polyglot but low-level, full of boilerplate, possible code duplication – Platform-specifc: Akka, Finagle, … easier to code & maintain, code reuse→ but tightly coupled, platform-dependant, not polyglot ● Prefer universal & lightweight (UNIX - smart endpoints, dumb pipes) ● Microservices are mostly REST ● Remember about Postel's law
  • 14. ITERATORSI T E R A T O R S @luksow Synchronous vs asynchronous ● Request-response ● ASAP response ● “Asking” ● Fail-fast ● Easy to reason about ● Timeouts? ● Don't scale Ex. REST, ... ● Message passing ● Deferred processing ● “Telling” ● Unnatural ● Complicated, hard to debug ● Recovering from failures ● Scale Ex. WebSockets, MQs, Akka, UDP, ...
  • 15. ITERATORSI T E R A T O R S @luksow Protocols in action auth-fb auth-pass auth-codes btc-users btc-ws identity metrics session token btc-market REST/JSON WebSockets REST/JSON Akka AkkaHTTP Keep-Alive
  • 16. ITERATORSI T E R A T O R S @luksow Guarantees ● What guarantees do you need? – What's the cost of a single message being lost? – What happens if system is in inconsistent state? – … ● No ACID (atomicity, consistency, isolation, durability) ● But CAP theorem (consistency, availability, partition tolerance) ● Eventual consistency, 2PC, 3PC, Paxos & others are your friends now ● What do you need? What can/cannot you afford? ● And no, you can't have everything
  • 17. ITERATORSI T E R A T O R S @luksow Shared vs private data stores ● Source of truth ● Strong contract/protocol ● Convenient ● Coupling ● Don't scale ● Ownership issues ● Service becomes an abstraction over DS ● Polyglot persistence ● Decoupling ● Scale ● Truth is distributed ● Façade issues ● Recommended
  • 18. ITERATORSI T E R A T O R S @luksow Private data stores auth-fb auth-pass auth-codes btc-users btc-ws identity metrics session token btc-market MongoDB Redis PostgreSQL PostgreSQL PostgreSQL MongoDB Event journal
  • 19. ITERATORSI T E R A T O R S @luksow Shared data stores auth-fb auth-pass auth-codes btc-users btc-ws metrics session btc-market MongoDB token Redis PostgreSQL PostgreSQL PostgreSQL identity MongoDB Event journal
  • 20. ITERATORSI T E R A T O R S @luksow Size & structure ● How big is microservice? – ~100 lines rule is a lie – Up to a couple of thousands LOC in most cases – Rule: as short as possible but as big as necessary ● Clean & structured vs short & hacky Resources Service Domain Repositories Data mappers Gateways Applicationvs ● Well-structured ● Requires time to analyse ● Easy to maintain ● Longer ● Unstructured ● Understandable at a glance ● Hard to maintain ● Much shorter
  • 21. ITERATORSI T E R A T O R S @luksow Size & structure - example Name Structured? LoC / eLoC auth-fb Yes 215 / 189 auth-pass Yes 301 / 258 auth-codes Yes 337 / 299 identity No 77 / 66 session No 48 / 43 token Yes 182 / 167 metrics No 160 / 150 btc-ws No 155 / 140 btc-users Yes 153 / 141 btc-market No 51 / 40 TOTAL 5 Yes / 5 No 1679 / 1493
  • 22. ITERATORSI T E R A T O R S @luksow Code sharing Sometimes the same code is required in two or more services – how to share it? ● Shared library coupling, not polyglot→ ● Nanoservice maintenance burden, performance→ ● Copy-paste duplication, more code to maintain→ No good answer here (3rd is the most popular)
  • 23. ITERATORSI T E R A T O R S @luksow Polyglot vs monoculture ● Tower of Babel problem ● Unmaintainable code rewrites costs→ → ● Multiple platforms lots of ops costs→ → ● But you want to use best tools and have fun ● Make recommendations about defaults – and innovate from there – “We use Scala for such tasks unless there's a better solution” – “PostgreSQL is our default database because XYZ” – “We prefer Redis with Rediscala library for caching”
  • 24. ITERATORSI T E R A T O R S @luksow Testing ● Don't test – “This big” correctness rule – Run in production, rollback on problems ● Test – good ol' style – Unit tests, integration tests, component tests, contract tests, end-to- end tests – Favour black-box tests ● Test – in a distributed system way – No way to really do that – Chaos monkey
  • 25. ITERATORSI T E R A T O R S @luksow Problems Distributed systems are hard
  • 26. ITERATORSI T E R A T O R S @luksow Operations ● Infrastructure, different machine utilization strategies ● Provisioning ● Deployment pipeline ● Monitoring ● Service discovery & confguration management ● Code templates with boilerplate ● Close collaboration of developers & operations DevOps→ ● Costs time & money
  • 27. ITERATORSI T E R A T O R S @luksow Complexity ● Complexity never goes away ● Code complexity communication complexity→ ● It's easy to make (worse) spaghetti there as well ● MSA requires more code to be written (boilerplate) ● More work at the initial stage (foundations) ● Avoid nanoservices maintenance burden→
  • 28. ITERATORSI T E R A T O R S @luksow Distributed computing ● Fallacies of distributed computing (Peter Deutsch, 1994) – The network is reliable – Latency is zero – Bandwidth is infnite – The network is secure – Topology doesn't change – There is one administrator – Transport cost is zero – The network is homogeneous ● Ex. RPC (vs local call) – It can fail – It can timeout (and still execute successfully!) – It is a couple of magnitudes slower
  • 29. ITERATORSI T E R A T O R S @luksow Contracts ● What API should I have? ● Who are my collaborators? ● How can I contact them? ● Make product owners defne API & protocols ● Service discovery & confguration management (ex. ZooKeeper, Consul.io) ● Think about help from providers (libraries, stubs, ex. Swagger, pact)
  • 30. ITERATORSI T E R A T O R S @luksow Versioning ● How to handle changes? ● How to handle external (ex. API) changes? ● Keep multiple versions in production ● Observe their behaviour ● Let the load balancers do the heavy lifting ● Embrace it to do A/B testing
  • 31. ITERATORSI T E R A T O R S @luksow Monitoring, metrics ● Monitor/measure all the things! ● (You should be doing it in monolith anyway) ● System metrics, health monitoring ● Business metrics ● Keep yourself informed about anomalies ● Observe analyse react→ →
  • 32. ITERATORSI T E R A T O R S @luksow Logging & debugging ● How do you debug distributed system? ● Next to impossible, completely different from monolith ● Centralized logging with correlation id and efficient search (no, grep doesn't work anymore) ● Tracing whenever possible ● Again, monitor/measure everything (including network traffic)
  • 33. ITERATORSI T E R A T O R S @luksow Security ● Larger network larger attack surface→ ● Ex. internal API leakage auth-fb auth-pass auth-codes btc-users btc-ws identity metrics session token btc-market Internal API External API
  • 34. ITERATORSI T E R A T O R S @luksow Frontend ● No microservices solution for frontend ● Visual coherency coupling→ ● Monoliths (ex. SPA) ● Fragments
  • 35. ITERATORSI T E R A T O R S @luksow Conclusions tldr;
  • 36. ITERATORSI T E R A T O R S @luksow Is it worth it? When? ● For problems that microservices likely solve ● If you're working on a well-funded, innovative products, in a big teams ● If you have certain DevOps maturity ● If you can write proper monoliths ● If you're not expecting a free lunch
  • 37. ITERATORSI T E R A T O R S @luksow How to start? ● Try gradually migrating from monolith, don't start from scratch ● Make sure you have DevOps capabilities ● Reorganize teams around features ● Think in microservices, not in monolith ● Don't do “new architecture”, “new platform”, “new languages” all at once
  • 38. ITERATORSI T E R A T O R S @luksow What to remember? ● Microservices are hard – Operations – Complexity – Distribution ● But they can be very rewarding – Team scaling & developer happiness – Scaling – Resilience
  • 39. ITERATORSI T E R A T O R S @luksow Thanks! ● Łukasz Sowa ● http://luksow.com ● http://iterato.rs ● contact@luksow.com ● @luksow Questions?