John Wilson wrote:I see in the About the Book section a mention of deploying microservices, but do not see any mention of microservices in the table of contents. Does the book contain much discussion of microservices and the role and usage of docker when developing microservices? Or setting up containers to be used in a microservice architecture?
Hi John
(below I reference the TOC at
https://manning.com/books/docker-in-practice - you may need to use the arrows at the end of chapter headings to see the contents of the chapters)
First I'll mention some concrete points in the book relevant to microservices.
We first talk about microservice containers in chapter 3, "3.1.3. TECHNIQUE n Splitting a system into microservice containers". The chapter is mostly about the value Docker can provide when used as a monolith, but this particular part gives some pointers on splitting up the Dockerfile of a web+app+db stack as a hint towards microservices. The technique concludes with a reference to the first technique of chapter 8, "8.1.1. TECHNIQUE n Simple Docker Compose Cluster". This and the subsequent technique introduce you to Docker compose, a tool for starting up a number of interacting containers. This is extremely useful for prototyping microservices on a single machine! You can easily play around with your containers and make sure it all works before trying to deploy them for real.
A crucial component of microservices is orchestration and service discovery (I suspect these are what you're referring to when you say "setting up containers to be used in a microservice architecture"). Chapter 9 is completely dedicated to covering this and tries to do a survey of the possibilities available in the Docker ecosystem to give you the information you need to be able to make a decision about what to use. There's very little better than being able to try out a tool for yourself!
Chapter 5 deserves a mention as well as it contains a fair amount of information on ways to build small images. This has particular relevance for microservices - if your images are >1GB each, it may take quite a while to deploy 30 of them!
Hopefully this answers the practicalities of your second question, both from the point of view of building your images and for using these images as running containers.
To touch on your first question - because so much of Docker is designed to be able to be used in a microservices context, microservices-related information tends to be woven throughout the book (for example, chapter 7 has "7.3.1. TECHNIQUE n Informing your containers with etcd", which can be very useful). It's presented in this way to try and give you the tools you need to be able to solve specific problems you face yourself. If your use-case is covered by the simple web+app+db example in chapter 3 then moving to a microservices architecture will be straightforward. However, more complex arrangements can require careful thought and a strong knowledge of the current system - general guidelines for developing complex microservices do exist (
http://12factor.net/ being a well known example) but bear in mind they're not unbreakable rules! My personal feeling as that by understanding the problem and knowing what options are available to you, you're more likely to make good decisions for your particular situation.
Let me know if anything is unclear or you'd like more detail.