Microservices:
the nitty gritty
I did a project with
microservices
"Just
use
microservices"
and it went well
for the first
and it went okay
for the second
it started to get hard
on the third
what did we find?
communication
is
hard
HTTP + REST
large conversations
myapp.com/customers
GET
{
"customers" :
[
{
"name" : "igloocoder",
"address" : "123 Main St.",
"active" : true,
"premium" : true
},
{
"name" : "Apple",
"address" : "1 Infinite Loop",
"active" : false,
"premium" : false
}
]
}
only need name and
premium?
basic APIs won't cut it
myapp.com/customers?fields=name,premium
GET
{
"customers" :
[
{
"name" : "igloocoder",
"premium" : true
},
{
"name" : "Apple",
"premium" : false
}
]
}
filtering
/customers/active
/customers/premium
can't expect
client side action
give succinct answers
to large conversations
service-to-service
communications
update/delete/create
reading data is harder
reading data is harder
latency
REST favourable
going to want
filtering and partial response
denormalize
embrace data duplication
keep data close
sync via events
embrace
eventual consistency
every microservice
is a separate app...
every microservice is a
separate deployment
how do you deploy
so many apps?
automation
what environments?
1 monolith
==
10/20/50/100? microservices
upgrades?
avoid
lock step deployments
challenges
some client
Our API v1
Our API v2
service location
&
config mgmt
where is that damn thing?
<add key="myService"
value="http://...."
Zookeeper/Consul
securing things
token based auth
Think about things
from the beginning
Usability?
Versioning?
Deployments?
Develop these
capabilities first
build for the cloud
engage DevOps
from the start
Things we didn't talk about
Handling communication volatility
Logging & Monitoring
Distributed System Fallacies
Thank you
donald.belcham@particular.net
@dbelcham
www.igloocoder.com/tags/microservices
www.github.com/dbelcham/microservice-material

Microservices: The Nitty Gritty

Editor's Notes

  • #19 what if the client needs all active premium accounts? Or premium accounts with a name that starts with 'A'?
  • #23 These are easy. Send a command to your bus/backplane
  • #24 These are easy. Send a command to your bus/backplane
  • #26 send the request and wait for a response
  • #43 when can you kill v1? How long do you keep it for?