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
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Microservices with Go
Microservices with Go

Microservices with Go: The expert's guide to building secure, scalable, and reliable microservices with Go , Second Edition

Arrow left icon
Profile Icon Alexander Shuiskov
Arrow right icon
$26.99
eBook Jun 2025 428 pages 2nd Edition
eBook
$26.99
Paperback
$33.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Alexander Shuiskov
Arrow right icon
$26.99
eBook Jun 2025 428 pages 2nd Edition
eBook
$26.99
Paperback
$33.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$26.99
Paperback
$33.99
Subscription
Free Trial
Renews at $19.99p/m

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

Microservices with Go

Introduction to Microservices

In this chapter, you will be introduced to microservices and the motivation behind them. You will understand the key benefits and common issues of the microservice architecture model and learn when to use it, as well as learning about some microservice development best practices. This knowledge will help you establish a solid foundation for reading the next chapters and give you some ideas on what challenges you may face with microservices in the future.

In this chapter, we will cover the following topics:

  • What is a microservice?
  • Motivation to use microservices
  • Pros and cons of microservices
  • When to use microservice architecture
  • The role of Go in microservice development

What is a microservice?

Companies worldwide have used the microservice architecture model so widely that it has almost become a default way of software development. There are many companies having tens, hundreds, and even thousands of microservices at their disposal.

So, what exactly is the microservice model?

The microservice architecture model is organizing an application as a collection of services, called microservices, each of which is further responsible for a certain part of application logic, usually defined by a particular business capability.

As an example, consider an online marketplace application. The application may have multiple features, including search, a shopping cart, payments, order history, and much more. Each feature can be so different and complex on its own that it could be developed and maintained by a separate team – like search and payments in our example. In the microservice architecture model, each component would be an independent...

Motivation to use microservices

In order to understand the motivation behind using the microservice architecture, it is very important to see the opposite approach – when the application is built and executed as a single program. Such applications are called monolithic applications or monoliths.

Monolithic architecture is, in most ways, the simplest model to implement since it does not involve splitting the application into multiple parts that need to coordinate with each other. This can provide you with major advantages in many cases, such as the following:

  • Application logic is still loosely defined: It is very common that parts of the application or the entire system go through major structural or logical changes, especially at the very early stages of development. This might be caused by a sudden change of requirements, priorities, changes in the business model, or a different approach to development. In such cases, the ability to make quick changes to the...

Pros and cons of microservices

In order to understand how to get the best results from using microservices and which issues to be aware of, let’s review the pros and cons of the microservice model.

Benefits of microservices

As previously described, different application components may have fundamentally different requirements and, at certain points, diverge so much that it would be beneficial to separate them. In this case, microservice architecture provides a clear solution by decoupling the parts of the system.

Microservices provide the following benefits to developers:

  • Faster compilation and build time: Faster build and compilation time may play a key role in speeding up all development processes.
  • Faster deployments, smaller deployable size: When each part of the system is deployed separately, the deployable size can get so significantly smaller that individual deployments can take just a fraction of the time compared to monolithic applications...

When to use microservice architecture

We have covered the benefits and common issues of microservices, providing a good overview of the applicability of using the microservice architecture model in an application. Let’s summarize the key points of using the microservice model, which are the following:

  • Don’t introduce microservices too early: Don’t use the microservice architecture too early if the product is loosely defined or could go through significant changes. Even when developers know the exact purpose of the system, there are high chances of various changes in the early stages of the development process. Starting from a monolithic application – and splitting it over time once there are clearly defined business capabilities and boundaries – helps reduce the amount of work and establish the right interfaces between the components.
  • No size fits all: Each company is unique and the final decision should depend on many factors, including...

The role of Go in microservice development

Over the last decade, the Go programming language has become one of the most popular languages for application development. There have been many factors contributing to its success, including its simplicity, ease of writing network applications, and the ability to easily develop parallel and concurrent applications.

Additionally, the larger developer community has played a key role in raising its popularity across all types of developers. The Go community is welcoming to everybody, from people just starting their journeys into programming to seasoned experts with decades of experience building different types of applications.

The Go standard library provides a set of packages that can often be enough for building a complete web application or an entire service, sometimes without even requiring any external dependencies. Many developers have been fascinated by the ease of writing applications and tools performing network calls, data...

Summary

We have discussed the key aspects of the microservice development model, including the motivation to use it, the common benefits, and the possible challenges. You have learned that the microservice model brings many advantages, helping you achieve a higher degree of flexibility. It also comes with its own costs, which often include additional complexity and a lack of uniformness in the system. Microservice architecture requires you to think about these problems proactively in order to address them before they become big issues.

In the next chapter, we are going to start our journey into microservice development with the Go language. You will learn the important basics of the Go programming language and we will scaffold our microservices, which we are going to improve throughout the rest of the book.

Further reading

To learn more about the topics that were covered in this chapter, take a look at the following resources:

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Design and deploy scalable microservices using gRPC, Protocol Buffers and Kubernetes
  • Discover industry best practices and gain insights into Go microservice development tools, patterns, and solutions
  • Work with hands-on Golang microservice examples in each chapter
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

Microservices with Go, Second Edition explains the key benefits and common issues faced by developers when working with microservices, helping you understand the problems microservice architecture solves, the issues it introduces, and how to tackle them. The author distils his 18+ years of experience in building scalable and reliable infrastructure to help you grasp the importance of using the right principles and standards to achieve all that microservice architecture has to offer. You'll see why Go is a popular choice for microservice development, as well as navigate its foundational aspects, including service scaffolding, discovery, data serialization, communication, deployment, and testing. After covering development, you'll move to maintenance and reliability. This second edition is fully updated with newly added topics, including security and compliance, distributed system challenges, and performance monitoring. The final section focuses on advanced concepts, such as system reliability, observability, maintainability, and scalability. Through best practices and practical examples, you'll learn how to apply key ideas to existing applications using previously scaffolded services. By the end of this book, you'll have gained hands-on experience in developing scalable, reliable, and high-performance microservices with Go.

Who is this book for?

This book is for all types of developers, from individuals interested in learning how to write microservices in Go to seasoned professionals who want to master the art of writing scalable and reliable microservice-based systems. A basic understanding of Go will come in handy.

What you will learn

  • Leverage event-driven architecture and messaging patterns for efficient microservice communication
  • Automate testing, CI/CD pipelines, and deployment strategies for Go microservices
  • Establish secure communication between microservices
  • Optimize microservice performance by monitoring, profiling, and debugging techniques
  • Get hands-on experience in cloud-native observability and deployment tools
  • Explore solutions to advanced distributed system scenarios, such as leader election

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 13, 2025
Length: 428 pages
Edition : 2nd
Language : English
ISBN-13 : 9781836207320
Category :
Languages :
Tools :

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 : Jun 13, 2025
Length: 428 pages
Edition : 2nd
Language : English
ISBN-13 : 9781836207320
Category :
Languages :
Tools :

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 $5 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 $5 each
Feature tick icon Exclusive print discounts
Visually different images

Table of Contents

22 Chapters
Introduction Chevron down icon Chevron up icon
Introduction to Microservices Chevron down icon Chevron up icon
Foundation Chevron down icon Chevron up icon
Scaffolding a Go Microservice Chevron down icon Chevron up icon
Service Discovery Chevron down icon Chevron up icon
Serialization Chevron down icon Chevron up icon
Synchronous Communication Chevron down icon Chevron up icon
Asynchronous Communication Chevron down icon Chevron up icon
Storing Service Data Chevron down icon Chevron up icon
Setting Up Service Deployments Chevron down icon Chevron up icon
Unit and Integration Testing Chevron down icon Chevron up icon
Security and Compliance Chevron down icon Chevron up icon
Maintenance Chevron down icon Chevron up icon
Reliability Overview Chevron down icon Chevron up icon
Collecting Service Telemetry Data Chevron down icon Chevron up icon
Setting Up Service Alerting Chevron down icon Chevron up icon
Performance Monitoring Chevron down icon Chevron up icon
Advanced Topics Chevron down icon Chevron up icon
Implementing Distributed System Scenarios Chevron down icon Chevron up icon
Advanced Topics Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index 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.