Book description
MVC and CRUD make software easier to write, but harder to change. Microservice-based architectures can help even the smallest of projects remain agile in the long term, but most tutorials meander in theory or completely miss the point of what it means to be microservice-based. Roll up your sleeves with real projects and learn the most important concepts of evented architectures. You'll have your own deployable, testable project and a direction for where to go next.
Much ink has been spilled on the topic of microservices, but all of this writing fails to accurately identity what makes a system a monolith, define what microservices are, or give complete, practical examples, so you're probably left thinking they have nothing to offer you. You don't have to be at Google or Facebook scale to benefit from a microservice-based architecture. Microservices will keep even small and medium teams productive by keeping the pieces of your system focused and decoupled.
Discover the basics of message-based architectures, render the same state in different shapes to fit the task at hand, and learn what it is that makes something a monolith (it has nothing to do with how many machines you deploy to). Conserve resources by performing background jobs with microservices. Deploy specialized microservices for registration, authentication, payment processing, e-mail, and more. Tune your services by defining appropriate service boundaries. Deploy your services effectively for continuous integration. Master debugging techniques that work across different services. You'll finish with a deployable system and skills you can apply to your current project.
Add the responsiveness and flexibility of microservices to your project, no matter what the size or complexity.
What You Need:
While the principles of this book transcend programming language, the code examples are in Node.js because JavaScript, for better or worse, is widely read. You'll use PostgreSQL for data storage, so familiarity with it is a plus. The books does provide Docker images to make working with PostgreSQL a bit easier, but extensive Docker knowledge is not required.
Publisher resources
Table of contents
- Acknowledgments
- Introduction
-
Part I. Fundamentals
-
1. You Have a New Project
- Kicking Off Video Tutorials
- Building the Bones
- Mounting Middleware
- Injecting Dependencies
- Taking the Server for a Spin and Starting the Database
- Serving the Home Page
- Connecting the Home Page Application
- Mounting the Home Application into Express
- Building the Record Views Application
- Recording State Changes
- Charting a New Course
- What You’ve Done So Far
-
2. Writing Messages
- Unmasking the Monolith
- Trying to Compress Water
- Extracting “Microservices”
- Defining Services
- Getting Components to Do Things
- Representing Messages in Code
- Naming Messages
- Storing State as Events
- Storing Messages in Streams
- Defining Component Boundaries
- Recording Video Views
- Writing Your First Message
- (Re)configuring the Record-Viewings Application
- Hanging a Lantern
- What You’ve Done So Far
- 3. Putting Data in a Message Store
-
4. Projecting Data into Useful Shapes
- Handling Events
- (Re)Introducing the RDBMS
- Writing Your First Aggregator
- Handling Asynchronous Messages
- Getting Idempotent with It
- Connecting to the Live Message Flow
- Configuring the Aggregator
- Having the Home Page Application Use the New View Data
- Coming to Terms with Data Duplication
- What You’ve Done So Far
-
5. Subscribing to the Message Store
- Sketching the Subscription Process
- Managing the Current Read Position
- Fetching and Processing Batches of Messages
- Orchestrating the Subscription
- Reading the Last Message in a Stream
- Reading a Stream’s Messages
- Adding the Read Functions to the Message Store’s Interface
- Starting the Server
- What You’ve Done So Far
-
1. You Have a New Project
-
Part II. Fleshing Out the System
-
6. Registering Users
- Discovering Domain Messages
- Starting with the Business Process
- Translating the Business Processes into Events and Commands
- Fleshing Out the Identity Messages
- Examples from Other Domains
- Adding Registration to Our System
- Turning Registration Requests into Commands
- Superficially Validating User Input
- Ensuring Uniqueness of Email Addresses
- Finishing the Application
- Validating Eventually Consistent Data
- Coping with Trade-Offs
- What You’ve Done So Far
- 7. Implementing Your First Component
- 8. Authenticating Users
-
9. Adding an Email Component
- Discovering the Email Component Messages
- Addressing Idempotence
- Adding the Component
- Sending the Email
- Running the Component
- Adding Email to the Registration Process
- Recording Registration Emails
- Making the Message Store Aware of Origin Streams
- Revisiting Idempotence
- Orchestrating Components vs. Choreographing Components
- What You’ve Done So Far
- 10. Performing Background Jobs with Microservices
- 11. Building Async-Aware User Interfaces
-
6. Registering Users
-
Part III. Tools of the Trade
- 12. Deploying Components
-
13. Debugging Components
- Priming the Database with Example Data
- Introducing the Admin Portal
- Creating Users
- Wiring the Users View into the Admin Portal
- Hooking the Admin Portal into the Rest of the System
- Inspecting the Results So Far
- Thinking Through the Expected Flow
- Correlators Gonna…Correlate?
- Imagining Our Way to Good System Monitoring
- Starting from the Beginning
- Viewing Messages by Stream
- Augmenting the Message Store for $any and $all
- What You’ve Done So Far
- 14. Testing in a Microservices Architecture
- 15. Continuing the Journey
- A1. ES6 Syntax
Product information
- Title: Practical Microservices
- Author(s):
- Release date: April 2020
- Publisher(s): Pragmatic Bookshelf
- ISBN: 9781680506457
You might also like
book
Production-Ready Microservices
One of the biggest challenges for organizations that have adopted microservice architecture is the lack of …
book
Microservices in Action
Microservices in Action is a practical book about building and deploying microservice-based applications. Written for developers …
book
Microservices: Up and Running
Microservices architectures offer faster change speeds, better scalability, and cleaner, evolvable system designs. But implementing your …
video
Event-Driven Microservices
Software developers and architects increasingly turn to microservices as a framework for improving the agility and …