Developing Microservices with Node.js

 
 
Packt Publishing Limited
  • 1. Auflage
  • |
  • erschienen am 26. April 2016
  • |
  • 286 Seiten
 
E-Book | ePUB mit Adobe DRM | Systemvoraussetzungen
978-1-78588-319-4 (ISBN)
 
Learn to develop efficient and scalable microservices for server-side programming in Node.js using this hands-on guideAbout This BookReal world example explained chapter after chapter with code examples.Useful concepts for other languages like Java or PHPEasy to follow by people with little to none experience in Node.jsNode.js Version 0.12.2 and the latest compatible versions of Seneca and PM2Who This Book Is ForNode.js developer with basic server-side development knowledge - but no knowledge of implementing microservices in Node.js applications. Also useful for developers in other languages like Java or C#.What You Will LearnIdentify where the microservice oriented architectures can tackle the most common problems in the software used by the big organisations.Re-architecture an existing monolithic system into a microservices oriented software.Build robust and scalable microservices using Seneca and Node.js.Testing of the microservices in insolation in order to create a solid system.Deploy and manage microservices using PM2Monitoring the health of a microservice (CPU, memory, I/O...) and how the degradation of the performance in one microservice could degrade the performance of full system.In DetailMicroservices architecture is a style of software architecture. As the name suggests, microservicess refers to small services. For a large implementation, this means breaking the system into really small, independent services. Alternative to monolithic architecture (where the entire system is considered as a single big, interwoven segment), microservices approach is getting more and more popular with large, complex applications that have a very long lifecycle, which require changes at regular intervals. Microservices approach allows this type of changes with ease as only a part of the system undergoes changes and change control is easy.An example of such large system can be an online store-includes user interface, managing product catalog, processing orders, managing customer's account. In a microservices architecture each of these tasks will be divided and into smaller services. Also, these services will be further broken down into independent services-for user interface, there will be separate services for input, output, search bar management, and so on. Similarly, all other tasks can be divided in very small and simple services.Style and approachThis book is a comprehensive guide to developing production-ready implementation of the microservices architecture with Node.js. Each chapter builds up on the earlier one creating a strong foundation on which you create your own microservice in a distributed environment.
  • Englisch
  • Birmingham
978-1-78588-319-4 (9781785883194)
1785883194 (1785883194)
weitere Ausgaben werden ermittelt
  • Cover
  • Copyright
  • Credits
  • About the Author
  • About the Reviewer
  • www.PacktPub.com
  • Table of Contents
  • Preface
  • Chapter 1: Microservices Architecture
  • Need for microservices
  • Monolithic software
  • Microservices in the real world
  • Microservice-oriented architectures
  • How is it better?
  • Shortcomings
  • Key design principles
  • Business units, no components
  • Smart services, dumb communication pipes
  • Decentralization
  • Technology alignment
  • How small is too small?
  • Key benefits
  • Resilience
  • Scalability
  • Technology heterogeneity
  • Replaceability
  • Independence
  • Why is replaceability important?
  • Easy to deploy
  • SOA versus microservices
  • Why Node.js?
  • API aggregation
  • The future of Node.js
  • Summary
  • Chapter 2: Microservices in Node.js - Seneca and PM2 Alternatives
  • Need for Node.js
  • Installing Node.js, npm, Seneca, and PM2
  • Learning npm
  • Our first program - Hello World
  • Node.js threading model
  • Modular organization best practices
  • Javascript
  • SOLID design principles
  • Seneca - a microservices framework
  • Inversion of control done right
  • Pattern matching in Seneca
  • Patrun - a pattern-matching library
  • Reusing patterns
  • Writing plugins
  • Web server integration
  • PM2 - a task runner for Node.js
  • Single-threaded applications and exceptions
  • Using PM2 - the industry-standard task runner
  • Summary
  • Chapter 3: From the Monolith to Microservices
  • First, there was the monolith
  • How to tackle organic growth?
  • How abstract is too abstract?
  • Then the microservices appeared
  • Disadvantages
  • Splitting the monolith
  • Problems splitting the monolith - it is all about the data
  • Organizational alignment
  • Summary
  • Chapter 4: Writing Your First Microservice in Node.js
  • Micromerce - the big picture
  • Product Manager - the two-faced core
  • Fetching products
  • Fetching by category
  • Fetching by ID
  • Adding a product
  • Removing a product
  • Editing a product
  • Wiring everything up
  • Integrating with Express - how to create a REST API
  • The e-mailer - a common problem
  • How to send e-mails
  • Defining the interface
  • Setting up Mandrill
  • Hands on - integrating Mandrill in your microservice
  • The fallback strategy
  • The order manager
  • Defining the microservice - how to gather non-local data
  • The order manager - the code
  • Calling remote services
  • Resilience over perfection
  • The UI - API aggregation
  • Need for frontend microservice
  • The code
  • Service degradation - when the failure is not a disaster
  • Circuit breakers
  • Seneca - a simple puzzle that makes our lives easier
  • Seneca and promises
  • Debugging
  • Summary
  • Chapter 5: Security and Traceability
  • Infrastructure logical security
  • SSH - encrypting the communications
  • Application security
  • Common threats - how to be up to date
  • Injection
  • Cross-site scripting
  • Cross-site request forgery
  • Open redirects
  • Effective code reviews
  • Traceability
  • Logging
  • Tracing requests
  • Auditing
  • HTTP codes
  • 1xx - informational
  • 2xx - success codes
  • 3xx - redirection
  • 4xx - client errors
  • 5xx - server errors
  • Why HTTP codes matter in microservices
  • Summary
  • Chapter 6: Testing and Documenting Node.js Microservices
  • Functional testing
  • The pyramid of automated testing
  • Unit tests
  • Integration tests
  • End-to-end tests
  • How much testing is too much?
  • Testing microservices in Node.js
  • Chai
  • Mocha
  • Sinon.JS - a mocking framework
  • Testing a real microservice
  • Manual testing - the necessary evil
  • Documenting microservices
  • Documenting APIs with Swagger
  • Generating a project from the Swagger definition
  • Summary
  • Chapter 7: Monitoring Microservices
  • Monitoring services
  • Monitoring using PM2 and Keymetrics
  • Diagnosing problems
  • Monitoring application exceptions
  • Custom metrics
  • Simian Army - the active monitoring from Spotify
  • Throughput and performance degradation
  • Summary
  • Chapter 8: Deploying Microservices
  • Concepts in software deployment
  • Continuous integration
  • Continuous delivery
  • Deployments with PM2
  • PM2 - ecosystems
  • Deploying microservices with PM2
  • Configuring the server
  • Docker - a container for software delivery
  • Setting up the container
  • Installing Docker
  • Choosing the image
  • Running the container
  • Installing the required software
  • Saving the changes
  • Deploying Node.js applications
  • Automating Docker container creation
  • Node.js event loop - easy to learn and hard to master
  • Clustering Node.js applications
  • Load balancing our application
  • Health check on NGINX
  • Passive health check
  • Active health check
  • Summary
  • Index

Dateiformat: EPUB
Kopierschutz: Adobe-DRM (Digital Rights Management)

Systemvoraussetzungen:

Computer (Windows; MacOS X; Linux): Installieren Sie bereits vor dem Download die kostenlose Software Adobe Digital Editions (siehe E-Book Hilfe).

Tablet/Smartphone (Android; iOS): Installieren Sie bereits vor dem Download die kostenlose App Adobe Digital Editions (siehe E-Book Hilfe).

E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nicht Kindle)

Das Dateiformat EPUB ist sehr gut für Romane und Sachbücher geeignet - also für "fließenden" Text ohne komplexes Layout. Bei E-Readern oder Smartphones passt sich der Zeilen- und Seitenumbruch automatisch den kleinen Displays an. Mit Adobe-DRM wird hier ein "harter" Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.

Weitere Informationen finden Sie in unserer E-Book Hilfe.


Download (sofort verfügbar)

32,73 €
inkl. 19% MwSt.
Download / Einzel-Lizenz
ePUB mit Adobe DRM
siehe Systemvoraussetzungen
E-Book bestellen

Unsere Web-Seiten verwenden Cookies. Mit der Nutzung des WebShops erklären Sie sich damit einverstanden. Mehr Informationen finden Sie in unserem Datenschutzhinweis. Ok