building-microservices-designing-fine-grained-systems.pdf

(5930 KB) Pobierz
Building
Microservices
DESIGNING FINE-GRAINED SYSTEMS
Sam Newman
Building Microservices
Distributed systems have become more fine-grained in the past 10 years,
shifting from code-heavy monolithic applications to smaller, self-contained
microservices. But developing these systems brings its own set of headaches.
With lots of examples and practical advice, this book takes a holistic view of the
topics that system architects and administrators must consider when building,
managing, and evolving microservice architectures.
Microservice technologies are moving quickly. Author Sam Newman provides
you with a firm grounding in the concepts while diving into current solutions
for modeling, integrating, testing, deploying, and monitoring your own
autonomous services. You’ll follow a fictional company throughout the book
to learn how building a microservice architecture affects a single domain.
The Microservices
architecture has many
appealing qualities, but
the road towards it has
painful traps for the
unwary. This book will
help you figure out if this
path is for you, and how
to avoid those traps on
your journey.
Discover how microservices allow you to align your system
design with your organization’s goals
Learn options for integrating a service with the rest of your
system
Take an incremental approach when splitting monolithic
codebases
Deploy individual microservices through continuous
integration
Examine the complexities of testing and monitoring distributed
services
Manage security with user-to-service and service-to-service
models
Understand the challenges of scaling microservice
architectures
Chief Scientist, ThoughtWorks
—Martin Fowler
Sam Newman
is a technologist at ThoughtWorks, where he splits his time
between helping clients globally and working as an architect for ThoughtWorks’
internal systems. He has worked with a variety of companies around the world on
both development and IT operations.
PROGR AMMING
Twitter: @oreillymedia
facebook.com/oreilly
CAN $57.99
US $49.99
ISBN: 978-1-491-95035-7
Building Microservices
Sam Newman
Building Microservices
by Sam Newman
Copyright © 2015 Sam Newman. 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://safaribooksonline.com). For more information, contact our corporate/
institutional sales department: 800-998-9938 or
corporate@oreilly.com.
Editors:
Mike Loukides and Brian MacDonald
Production Editor:
Kristen Brown
Copyeditor:
Rachel Monaghan
Proofreader:
Jasmine Kwityn
February 2015:
First Edition
Indexer:
Judith McConville
Interior Designer:
David Futato
Cover Designer:
Ellie Volckhausen
Illustrator:
Rebecca Demarest
Revision History for the First Edition
2014-01-30:
First Release
See
http://oreilly.com/catalog/errata.csp?isbn=9781491950357
for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc.
Building Microservices,
the cover image
of honey bees, and related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the author have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and the author 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-95035-7
[LSI]
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
1. Microservices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What Are Microservices?
Small, and Focused on Doing One Thing Well
Autonomous
Key Benefits
Technology Heterogeneity
Resilience
Scaling
Ease of Deployment
Organizational Alignment
Composability
Optimizing for Replaceability
What About Service-Oriented Architecture?
Other Decompositional Techniques
Shared Libraries
Modules
No Silver Bullet
Summary
Inaccurate Comparisons
An Evolutionary Vision for the Architect
Zoning
A Principled Approach
Strategic Goals
Principles
2
2
3
4
4
5
5
6
7
7
7
8
9
9
10
11
11
13
15
16
17
18
18
iii
2. The Evolutionary Architect. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Zgłoś jeśli naruszono regulamin