Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Hands-On Microservices with JavaScript
Hands-On Microservices with JavaScript

Hands-On Microservices with JavaScript: Build scalable web applications with JavaScript, Node.js, and Docker

Arrow left icon
Profile Icon Tural Suleymani
Arrow right icon
Mex$179.99 Mex$656.99
eBook Dec 2024 406 pages 1st Edition
eBook
Mex$179.99 Mex$656.99
Paperback
Mex$820.99
Subscription
Free Trial
Arrow left icon
Profile Icon Tural Suleymani
Arrow right icon
Mex$179.99 Mex$656.99
eBook Dec 2024 406 pages 1st Edition
eBook
Mex$179.99 Mex$656.99
Paperback
Mex$820.99
Subscription
Free Trial
eBook
Mex$179.99 Mex$656.99
Paperback
Mex$820.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Hands-On Microservices with JavaScript

Introduction to Microservices

As human beings, we all go through various stages of development. With each stage we reach, even if it seems like the best at the time, we later realize we still have a long way to go. Each period has its problems, and depending on their size and nature, they require different solutions.

We humans tend to simplify things. That is why we build our lives around problems and their corresponding solutions. Finding solutions to problems has been our main goal throughout history, perhaps due to our instinct to survive.

If we consider each piece of software as an individual, they also have problems to solve. Depending on the size and shape of the problems, software has a different structure, which we call architecture. The size and nature of the problems directly affect the architecture of the software. One of these architectural approaches we use is called microservices.

Microservices are important when it comes to building scalable distributed applications...

Introducing microservices

A microservice architecture decomposes an application into loosely coupled, independently deployable services that own their data and communicate through lightweight protocols. It breaks down large applications into smaller, self-contained business capabilities, enabling faster development, easier scaling, and better fault tolerance. Microservices enable continuous delivery and agile development by allowing teams to independently build, test, and deploy features. You can imagine an application as an orchestra, where each microservice is a musician playing their part, but in perfect harmony with the others, to create a beautiful symphony.

What we’ve just mentioned sounds like a silver bullet but as you know, nothing is free and there is no one-size-fits-all solution to the problems we face. The same applies to microservices.

We, as software developers, love to learn new trends and try to apply them to our practice. But after delving into the details...

Exploring the monolith approach

Say we have an e-commerce site with a single code base that was developed years ago. Over time, features and functionalities were added randomly, leading to messy code that contains duplication, is hard to maintain, and is difficult to troubleshoot. Here is the first suggested transition so that you can make your application responsive or alive again:

  • Analyze the current state of your application: You need to identify key pain points affecting developer productivity and user experience. Try to divide the problem into smaller pieces. Trying to cover everything at once will lead you to more difficulties. Focus on specific modules or functionalities within the larger code base for initial refactoring. You need to understand dependencies, duplication, and complexity in your application.
  • Communication and collaborative planning: The next steps are identifying the areas for improvement and agreeing on common architectural principles. Emphasize...

What is service-oriented architecture?

A monolithic architecture unifies all of the components/elements – including the user interface and data access – into a single code base, promoting simplicity and quick development. Although it’s not impossible, combining different technologies into one system can be difficult to maintain and unfeasible at times. In the absence of contemporary methodologies such as feature flags and blue-green deployment, it becomes necessary to deploy the entire application every time you want to update a monolithic application. There are difficulties with organizing and delivering the application smoothly, which could mess up its launch.

On the other hand, SOA (see Figure 1.4) focuses on modularity and reuse, breaking down functionalities into independent services that communicate with each other through application programming interfaces (APIs).

SOA can be defined as multiple, smaller, and often coarser-grained services, each with...

The differences between SOA and microservices

Microservices architecture simplifies building distributed, flexible, and scalable software. Instead of one monolithic system, it divides an application into small, standalone services, each of them focused on a specific task. These services communicate through simple interfaces, allowing for independent deployment and easy integration. When developing properly designed microservices, we get loosely coupled, reusable, extensible, and easily maintainable applications.

When comparing microservices to SOA, they may seem similar in concept. SOA and microservices architecture are both architectural styles that are used for building distributed systems, but they have some key differences. Let’s compare them:

  • Scope and granularity: Services in SOA are like big boxes containing multiple functionalities that are meant to be reused across different applications. Microservices are like tiny, specialized tools, each focusing on one...

Advantages of microservices

In this section, we’ll look at the many reasons that make microservices an important part of software development:

  • Scalability: You can scale each microservice independently based on demand, ensuring resources are allocated where needed for optimal performance and cost-effectiveness.
  • Flexibility and agility: Teams can work on different services simultaneously, speeding up development and making updates easier. Being agile is essential to adapting to the ever-shifting demands and markets of businesses.
  • Fault isolation: If one microservice fails, it doesn’t necessarily affect others, thanks to their independence. This isolation improves system reliability by minimizing downtime.
  • Technology diversity: Multiple programming languages and technologies can be used in a single application thanks to microservices. Teams are encouraged to explore and be creative by selecting the finest tools for each service.
  • Easy maintenance...

Disadvantages of microservices

Throughout this chapter, we learned that the main reason for having various architectures in software development is a sign that there is no single truth and that depending on the requirements, architecture may vary. Every approach in design has its disadvantages and before applying any architecture, you should carefully analyze and understand them.

Here are some important disadvantages of microservices:

  • Increased complexity in development: Breaking down a system into smaller services can lead to increased complexity in development, deployment, and testing.
  • Interservice communication: Managing communication between microservices can become complex, requiring careful design and implementation of APIs and protocols.
  • Infrastructure complexity: Managing and deploying a large number of microservices can introduce operational overhead, including the need for sophisticated orchestration and monitoring tools.
  • Infrastructure cost: The overhead...

Summary

This chapter introduced you to microservices. We talked about coding without proper design and analysis, which brings us to a big ball of mud. Having no clear architecture is similar to having no map in the middle of the ocean.

Our first step was starting with monoliths. We talked about the advantages and disadvantages of the monolith approach and tried to understand the differences between approach and architecture.

Nowadays, requirements for applications are broader and more complex, and always trying to deal with them using a monolith approach may not be a good solution. To add important attributes, such as “distributed,” to the architecture, we considered SOA while discussing its pros and cons.

The final destination for us was microservices. We provided a clear definition for it and tried to understand the advantages and disadvantages of using them.

Microservices bring a lot of interesting challenges to our lives and one of them is communication...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn microservices architecture for scalable, cloud-ready applications
  • Build hands-on projects with Node.js, Express.js, NestJS, and Kafka
  • Master CI/CD pipelines, security, and monitoring for robust microservices
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

Keep up with the ever-evolving web development landscape by mastering JavaScript microservices with expert guidance from Tural Suleymani—a full-stack software engineer, architect, software development teacher, Microsoft MVP, and three-time C# Corner MVP. He distills over a decade of experience crafting high-performance, scalable solutions into this guide. He’ll walk you through the fundamentals of microservices, providing a solid foundation in architecture, design principles, and the necessary tools and technologies. From beginners to seasoned developers, this book offers a clear pathway to mastering microservices with JavaScript. With the help of hands-on tasks that simulate real-world scenarios, you’ll learn how to build reliable and scalable microservices. You’ll explore synchronous and asynchronous communication, real-time data streaming, and how to secure and monitor your services. The book’s emphasis on a design-first approach ensures that your microservices are maintainable and future-proof. Detailed case studies from industry experts will enhance your learning experience and provide practical insights into building microservices in production environments. By the end of this book, you'll be ready to create cloud-ready, high-performing microservices using cutting-edge JavaScript frameworks and tools and tackle real-world challenges, ensuring your applications are secure and efficient.

Who is this book for?

This book is for backend developers, full-stack developers, software architects, and frontend developers who want to venture into the world of microservices. A fundamental understanding of the JavaScript ecosystem will be helpful but not necessary, as this book will cover the essentials of microservices architecture, JavaScript programming, and modern frameworks and tools for building scalable, maintainable applications.

What you will learn

  • Understand synchronous and asynchronous communication between microservices
  • Discover how to decouple microservices using Message Broker
  • Build real-time data streaming microservices with JS frameworks
  • Understand logging and monitoring in microservices
  • Explore common architectural patterns for microservices
  • Cover microservices with unit, and integration tests
  • Apply CI/CD for microservices and learn to Dockerize and deploy them

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 20, 2024
Length: 406 pages
Edition : 1st
Language : English
ISBN-13 : 9781788625265
Languages :
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 20, 2024
Length: 406 pages
Edition : 1st
Language : English
ISBN-13 : 9781788625265
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Mex$85 each
Feature tick icon Exclusive print discounts
Banner background image

Table of Contents

18 Chapters
Part 1:Fundamentals of Microservices Architecture Chevron down icon Chevron up icon
Chapter 1: Introduction to Microservices Chevron down icon Chevron up icon
Chapter 2: Diving into Microservices Internals Chevron down icon Chevron up icon
Chapter 3: What Do You Need Before Getting Started? Chevron down icon Chevron up icon
Chapter 4: Stack Development Technologies Chevron down icon Chevron up icon
Part 2:Building and Managing Microservices Chevron down icon Chevron up icon
Chapter 5: Basic CRUD Microservices Chevron down icon Chevron up icon
Chapter 6: Synchronous Microservices Chevron down icon Chevron up icon
Chapter 7: Asynchronous Microservices Chevron down icon Chevron up icon
Chapter 8: Real-Time Data Streaming Using Microservices Chevron down icon Chevron up icon
Part 3:Securing, Testing, and Deploying Microservices Chevron down icon Chevron up icon
Chapter 9: Securing Microservices Chevron down icon Chevron up icon
Chapter 10: Monitoring Microservices Chevron down icon Chevron up icon
Chapter 11: Microservices Architecture Chevron down icon Chevron up icon
Chapter 12: Testing Microservices Chevron down icon Chevron up icon
Chapter 13: A CI/CD Pipeline for Your Microservices Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.