Practical Microservices
Build Event-Driven Architectures with Event Sourcing and CQRS
by Ethan Garofolo
Version: P1.0 (April 2020)
Copyright 2020 The Pragmatic Programmers, LLC. This book is licensed to the individual who purchased it. We don't copy-protect it because that would limit your ability to use it for your own purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copy with other members of your team, with friends, or via file sharing services. Thanks.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
About the Pragmatic Bookshelf
The Pragmatic Bookshelf is an agile publishing company. Were here because we want to improve the lives of developers. We do this by creating timely, practical titles, written by programmers for programmers.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
Our ebooks do not contain any Digital Restrictions Management, and have always been DRM-free. We pioneered the beta book concept, where you can purchase and read a book while its still being written, and provide feedback to the author to help make a better book for everyone. Free resources for all purchasers include source code downloads (if applicable), errata and discussion forums, all available on the book's home page at pragprog.com. Were here to make your life easier.
New Book Announcements
Want to keep up on our latest titles and announcements, and occasional special offers? Just create an account on pragprog.com (an email address and a password is all it takes) and select the checkbox to receive newsletters. You can also follow us on twitter as @pragprog.
About Ebook Formats
If you buy directly from pragprog.com, you get ebooks in all available formats for one price. You can synch your ebooks amongst all your devices (including iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of the edition. And, of course, you can always come back and re-download your books when needed. Ebooks bought from the Amazon Kindle store are subject to Amazon's polices. Limitations in Amazon's file format may cause ebooks to display differently on different devices. For more information, please see our FAQ at pragprog.com/frequently-asked-questions/ebooks. To learn more about this book and access the free resources, go to https://pragprog.com/book/egmicro, the book's homepage.
Thanks for your continued support,
Andy Hunt
The Pragmatic Programmers
The team that produced this book includes: Andy Hunt (Publisher) Janet Furlow (VP of Operations) Dave Rankin (Executive Editor) Adaobi Obi Tulton (Development Editor) Jasmine Kwityn (Copy Editor) Potomac Indexing, LLC (Indexing) Gilson Graphics (Layout)
For customer support, please contact .
For international rights, please contact .
For Julie, Sofia, Eva, and Angelo
you are life and joy
Table of Contents
Copyright 2020, The Pragmatic Bookshelf.
Early praise for Practical Microservices
Practical Microservices is, indeed, practical. Its also the clearest and most complete example of how and why to build an event-driven architecture that presents a unified example that isnt overly simplistic or overly complex. This wouldve changed my approach to microservices if it had been available five years ago.
David Bryant Copeland |
Co-author of Agile Web Development with Rails 6 |
This book sets straight the microservices phenomenondecoupled evented microservices style is the only way to achieve antifragility and maintain simplicity at the same time.
Adrian Bilauca |
Director, R&D, TotalSoft S.A. |
Acknowledgments
I may have pushed a lot of buttons on keyboards to write this book, but I owe its fruition to the efforts of so many others. A whole lot of thank yous are in order.
To my Heavenly Father for life, my savior Jesus Christ for hope, and the Holy Ghost for peace. Thank You for rescuing a soul so rebellious and proud as mine, and may I live a life that extends to all others the love and grace Youve extended to me.
To Mom and Dad, thank you for all the lessons youve taught me. To my brother Denis, I couldnt imagine how a brother could have done a better job than you did.
To my friends and coworkers who have had to endure me talking about this for 2+ years. We can finally have a meeting where I dont bring up my book.
To Adrian Bilauca, Damien Del Russo, Dave Copeland, Ben Marx, and Adam Jasiura for being technical reviewers of this book. You gave of your time and expertise with no expectation of reward. When I compare the early drafts to what your feedback guided me to, well, thats why books go out to reviewers. You delivered, and I and all the readers are in your debt.
To Jesse Riggins, for being a technical reviewer, a friend, and a fellow learner of microservices-based architectures through the years. Its been wonderful bouncing ideas off you, and goodness, I hope we get to work together again!
To Scott Bellware and Nathan Ladd, I have met few people as knowledgeable and as generous as you both. Thank you for the work you do in the Eventide community and in our profession. Scott, it was pure serendipity that led me to a TDD talk of yours at the LoneStarRuby Conference, a talk that permanently altered how I approach software development. Nathan, Ive never had the pleasure of meeting you in person, and Im so glad you made it. I aspire to become as good at my craft as you both are.
To Todd Pickell, thank you for taking that phone call that one day and telling me to go speak at meetups. You probably had other things to do, and I truly appreciate that gift of your time.
To Brian MacDonald, thank you for coming to OpenWest in 2017, staying to talk to me after that session, and encouraging me to write a pitch. I had no idea what an amazing and life-changing ride this would become.
To my editor, Adaobi Obi Tulton, the highest thanks are in order. I dont have the hubris to claim that Ive been the most difficult author youve ever worked with, but Im certain youve had easier projects. You are excellent at what you do, and if this book provides value to its readers, I dont think it would have without your excellent guidance. Thank you for talking me down from the ledge of discouragement, and thank you for saving this text from my attempts to be clever. Readers, if any of you ends up writing your own book for PragProg, ask for Adaobi!
To my dear children, Sofia, Eva, and Angelo, this book has cost a lot of memories of playing together that we might have otherwise had. Thank you for bearing with me and even being excited about this project. Its finally done! You are three of the most wonderful human beings I have ever met. It is an honor to know you and a blessing beyond words to get to be your father. Your imaginations and sense of wonder remind me constantly of how great a gift each day is. I love you, and I couldnt be prouder of you. Now lets go play!