Table Of ContentWOW! eBook
www.wowebook.org
WOW! eBook
www.wowebook.org
Applied Akka Patterns
A Hands-On Guide to Designing Distributed Applications
Michael Nash and Wade Waldron
WOW! eBook
www.wowebook.org
Applied Akka Patterns
by Michael Nash and Wade Waldron
Copyright © 2017 Michael Nash, Wade Waldron. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online
editions are also available for most titles (http://oreilly.com/safari). For more information,
contact our corporate/institutional sales department: 800-998-9938 or [email protected].
Editors: Nan Barber and Brian Foster
Production Editor: Kristen Brown
Copyeditor: Octal Publishing, Inc.
Proofreader: Jasmine Kwityn
Indexer: Angela Howard
Interior Designer: David Futato
Cover Designer: Karen Montgomery
Illustrator: Rebecca Demarest
December 2016: First Edition
WOW! eBook
www.wowebook.org
Revision History for the First Edition
2016-12-09: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781491934883 for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Applied Akka Patterns,
the cover image, and related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the authors have used good faith efforts to ensure that the information
and instructions contained in this work are accurate, the publisher and the authors disclaim all
responsibility for errors or omissions, including without limitation responsibility for
damages resulting from the use of or reliance on this work. Use of the information and
instructions contained in this work is at your own risk. If any code samples or other
technology this work contains or describes is subject to open source licenses or the
intellectual property rights of others, it is your responsibility to ensure that your use thereof
complies with such licenses and/or rights.
978-1-491-93488-3
[LSI]
WOW! eBook
www.wowebook.org
Preface
Reactive Application Development is the new frontier of software development. As the
prevalence of connected devices has increased, so has the amount of data available. Older
techniques for processing that data in a single-threaded batch simply can’t hold up under the
demands presented by this new world. Big data is on the rise and we need new tools and new
techniques to deal with it.
Often, the solution to modern problems doesn’t come from the present, but rather from the
past. Many of today’s new tools for processing big data are in fact based on the older concept
of actors. Actors are the key concept from which Akka was built, but it has its roots in the past.
It isn’t a new concept; rather, it’s an old one brought to light in the modern world.
As we set forth to explore Akka, actors, streams, and all the other things associated with them,
we will be approaching them from the perspective of a real-world concern: the problem of
how to schedule a group of people across a variety of projects while optimizing both for the
time they have available, as well as their skill sets. This is a complex problem, not one easily
solved in an afternoon. But it is an interesting issue that provides a lot of room for depth. It is
also a problem that most software developers will be involved with at some point during their
career. We will refer back to this problem throughout our exploration of Akka.
But before we get to solving the problems of our domain, we have to first understand the
tools that we have available. We also need to understand why those tools exist, and what kinds
of problems they were intended to solve. We need to know the origin of Akka, with its roots
in the Actor Model. We need a guiding set of principles to help us stitch together our
application, found in our exploration of domain-driven design (DDD). From there, we can
begin to build out our domain, using all of the tools Akka provides. We can explore the use of
simple actors and how they relate to streams. We can take our system and distribute across
multiple nodes, providing better fault tolerance, availability, and of course, scalability.
But first, we need to know where it all came from.
WOW! eBook
www.wowebook.org
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements
such as variable or function names, databases, data types, environment variables,
statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values determined by
context.
TIP
This element signifies a tip or suggestion.
NOTE
This element signifies a general note.
WARNING
This element indicates a warning or caution.
WOW! eBook
www.wowebook.org
O’Reilly Safari
NOTE
Safari (formerly Safari Books Online) is membership-based training and reference platform
for enterprise, government, educators, and individuals.
Members have access to thousands of books, training videos, Learning Paths, interactive
tutorials, and curated playlists from over 250 publishers, including O’Reilly Media, Harvard
Business Review, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press,
Sams, Que, Peachpit Press, Adobe, Focal Press, Cisco Press, John Wiley & Sons, Syngress,
Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New
Riders, McGraw-Hill, Jones & Bartlett, and Course Technology, among others.
For more information, please visit http://oreilly.com/safari.
WOW! eBook
www.wowebook.org
How to Contact Us
Please address comments and questions concerning this book to the publisher:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)
We have a web page for this book, where we list errata, examples, and any additional
information. You can access this page at http://bit.ly/applied_akka_patterns.
To comment or ask technical questions about this book, send email to
[email protected].
For more information about our books, courses, conferences, and news, see our website at
http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
WOW! eBook
www.wowebook.org
Acknowledgments
We would like to thank the many people who helped make this book possible, including the
Akka team, both within Lightbend and in the greater community, as well as our editor, Nan
Barber, and our reviewers, Konrad Malawski, Sean Glover, and Petro Verkhogliad. We
especially want to thank our families for their patience and support.
WOW! eBook
www.wowebook.org