|
|
|
Is this microservice?
(docs.google.com)
|
|
18 points
by mrkschan
4173 days ago
|
|
A web frontend to receive requests. Some requests are stored in a pub/sub message broker like Kafka / RabbitMQ. Some daemons would subscribe to the broker and do some work. Any processes would have HTTP REST API call / Thrift RPC to some other functional services. Each of those functional services and daemons are load balanced. Is this microservice? |
|
IMO, a micro-service does only 1 thing, does not access common data repositories and stores its own data isolated (could be same physical db server but separate db/table/catalog etc.). Additionally, at least as I see it a micro-service does its job and then pushes a new message on the queue with the results, it never talks via the network layer to anyone else for coordination or status. But of course it may send out data or make calls via the network, e.g. HTTP, SMTP etc.
You probably already know this but from reading and my experience a micro-service should only act upon data it receives in the message. Sometimes this is where people have a hard time because it means passing an entire data set with the message to make sure the micro-service has enough information to do its job. But doing so is the only way to decouple the services and get the benefits of a distributed system. If you use the database as a communication layer it will cause you all kinds of headaches and it couples the services to data structure changes which means you still are not isolated. You should be able to update any micro-service without the need to update any other service at the same time.