PREFACExvi
demand of the users. Ten years ago, smartphones were just being introduced to the
market and cloud computing was in the earliest stage of infancy. Also, the standards
and technology for distributed application development were too complicated for the
average developer to understand and easily use in practice. Nothing speaks truth in
the software development industry like written code. When the standards get in the
way of this, the standards quickly get discarded.
When I first heard of the microservices approach to building applications I was
more than a little skeptical. “Great, another silver-bullet approach to building distrib-
uted applications,” I thought. However, as I started diving into the concepts, I realized
the simplicity of microservices could be a game changer. A microservice architecture
focuses on building small services that use simple protocols (
HTTP and JSON) to com-
municate. That’s it. You can write a microservice with nearly any programming lan-
guage. There’s beauty in this simplicity.
However, while building an individual microservice is easy, operationalizing and
scaling it is difficult. Getting hundreds of small distributed components to work
together and then building a resilient application from them can be incredibly diffi-
cult to do. In distributed computing, failure is a fact of life and how your application
deals with it is incredibly difficult to get right. To paraphrase my colleagues Chris
Miller and Shawn Hagwood: “If it’s not breaking once in a while, you’re not building.”
It’s these failures that inspired me to write this book. I hate to build things from
scratch when I don’t have to. The reality is that Java is the lingua franca for most appli-
cation development efforts, especially in the enterprise. The Spring framework has for
many organizations become the de facto framework for most application develop-
ment. I’d already been doing application development in Java for almost 20 years (I
remember the Dancing Duke applet) and Spring for almost 10 years. As I began my
microservices journey, I was delighted and excited to watch the emergence of Spring
Cloud.
The Spring Cloud framework provides out-of-the-box solutions for many of the
common development and operational problems you’ll run into as a microservice
developer. Spring Cloud lets you use only the pieces you need and minimizes the
amount of work you need to do to build and deploy production-ready Java micro-
services. It does this by using other battle-hardened technologies from companies and
groups such as Netflix, HashiCorp, and the Apache foundation.
I’ve always considered myself an average developer who, at the end of the day, has
deadlines to meet. That’s why I undertook the project of writing this book. I wanted a
book that I could use in my day-to-day work. I wanted something with direct (and
hopefully) straightforward code examples. I always want to make sure that the mate-
rial in this book can be consumed as individual chapters or in its entirety. I hope you
find this book useful and I hope you enjoy reading it as much as I enjoyed writing it.
Licensed to zhailiang UNKNOWN <zhailiang@pinzhi365.com>