Skip to main content
CF

Working with Microservices in Go (Golang)

10h 51m 24s
English
Paid

Explore the future of web application architecture by diving into the world of microservices with Go (Golang). As monolithic applications pave the way for more flexible solutions, understanding microservices is essential for modern developers.

Understanding Microservices

Microservices, or the microservice architecture, represent a design approach where large applications are divided into smaller, independent components. This architectural style enhances the development and delivery of complex applications, offering numerous advantages:

  • Maintainable and testable;

  • Loosely coupled with other application components;

  • Independently deployable;

  • Centered around specific business capabilities;

  • Usually managed by small, dedicated teams.

Course Overview

In this course, you will build small, self-contained microservices that interact via a REST API, RPC, gRPC, and AMQP (Advanced Message Queuing Protocol), providing a hands-on approach to understanding these technologies. You will develop microservices with the following functionalities:

  • A Front End service, responsible for displaying web pages;

  • An Authentication service integrated with a Postgres database;

  • A Logging service utilizing a MongoDB database;

  • A Listener service that processes messages from RabbitMQ;

  • A Broker service, acting as an optional entry point into the microservice ecosystem;

  • A Mail service that converts JSON payloads into formatted emails for dispatch.

All microservices will be crafted using Go, often referred to as Golang, a language renowned for its efficiency in building distributed web applications.

Deployment and Scalability

Beyond development, you will master the deployment of your distributed applications using Docker Swarm and Kubernetes. The course will teach you how to scale services dynamically and update individual microservices with minimal downtime, ensuring seamless operations.

About the Author: Udemy

Udemy thumbnail

Udemy is the largest open marketplace for online courses on the internet. Founded in 2010 by Eren Bali, Oktay Caglar, and Gagan Biyani and headquartered in San Francisco, the company went public on the Nasdaq in 2021 under the ticker UDMY. The platform hosts well over two hundred thousand courses across software development, IT and cloud, data science, design, business, marketing, and creative skills, taught by tens of thousands of independent instructors. Roughly seventy million learners use it worldwide, and the corporate arm — Udemy Business — supplies a curated subset of that catalog to enterprise customers.

Because Udemy is a marketplace rather than a single editorial publisher, the catalog is uneven by design. The strongest material lives in the long-form, project-based courses authored by working engineers — full-stack JavaScript, React, Node.js, Python data science, AWS, Docker and Kubernetes, mobile development with Flutter and React Native, and cloud certification preparation. The CourseFlix listing under this source is the slice of that catalog that has been mirrored here for offline-friendly viewing, organized by topic and updated as new releases land. Pricing on Udemy itself swings dramatically with the site's near-permanent sales, which is why the platform is best treated as a deep reference catalog: pick instructors with strong reviews and a track record of updating their material rather than buying on the headline price alone.

Watch Online 123 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 123 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Introduction
All Course Lessons (123)
#Lesson TitleDurationAccess
1
Introduction Demo
09:24
2
About me
01:02
3
Installing Go
00:52
4
Installing Visual Studio Code
01:29
5
Installing Make
01:28
6
Installing Docker
00:52
7
Asking for help
01:15
8
Mistakes. We all make them.
01:07
9
What we'll cover in this section
00:42
10
Setting up the front end
01:37
11
Reviewing the front end code
03:37
12
Our first service: the Broker
14:57
13
Building a docker image for the Broker service
09:00
14
Adding a button and JavaScript to the front end
08:39
15
Creating some helper functions to deal with JSON and such
09:05
16
Simplifying things with a Makefile (Mac & Linux)
04:19
17
Simplifying things with a Makefile (Windows)
03:27
18
What we'll cover in this section
01:53
19
Setting up a stub Authentication service
11:14
20
Creating and connecting to Postgres from the Authentication service
08:56
21
Updating our docker-compose.yml for Postgres and the Authentication service
14:14
22
Populating the Postgres database
02:28
23
Adding a route and handler to accept JSON
08:41
24
Update the Broker for a standard JSON format, and conect to our Auth service
15:07
25
Updating the front end to authenticate thorough the Broker and trying things out
07:10
26
What we'll cover in this section
01:01
27
Getting started with the Logger service
10:08
28
Setting up the Logger data models
15:06
29
Finishing up the Logger data models
08:02
30
Setting up routes, handlers, helpers, and a web server in our logger-service
08:42
31
Adding MongoDB to our docker-compose.yml file
06:33
32
Add the logger-service to docker-compose.yml and the Makefile
04:24
33
Adding a route and handler on the Broker to communicate with the logger service
06:32
34
Update the front end to post to the logger, via the broker
04:13
35
Add basic logging to the Authentication service
04:25
36
Trying things out
04:24
37
What we'll cover in this section
01:11
38
Adding Mailhog to our docker-compose.yml
02:08
39
Setting up a stub Mail microservice
05:10
40
Building the logic to send email
23:19
41
Building the routes, handlers, and email templates
12:31
42
Challenge: Adding the Mail service to docker-compose.yml and the Makefile
00:46
43
Solution to challenge
03:48
44
Modifying the Broker service to handle mail
08:01
45
Updating the front end to send mail
09:50
46
A note about mail and security
01:19
47
What we'll cover in this section
02:30
48
Creating a stub Listener service
03:21
49
Adding RabbitMQ to our docker-compose.yml
04:22
50
Connecting to RabbitMQ
07:52
51
Writing functions to interact with RabbitMQ
21:16
52
Adding a logEvent function to our Listener microservice
02:41
53
Updating main.go to start the Listener function
02:45
54
Change the RabbitMQ server URL to the Docker address
00:41
55
Creating a Docker image and updating the Makefile
06:40
56
Updating the broker to interact with RabbitMQ
04:30
57
Writing logic to Emit events to RabbitMQ
05:59
58
Adding a new function in the Broker to log items via RabbitMQ
06:38
59
Trying things out
03:56
60
What we'll cover in this section
02:15
61
Setting up an RPC server in the Logger microservice
05:39
62
Listening for RPC calls in the Logger microservice
04:46
63
Calling the Logger from the Broker using RPC
05:42
64
Trying things out
02:47
65
What we'll cover in this section
02:29
66
Installing the necessary tools for gRPC
02:47
67
Defining a Protocol for gRPC: the .proto file
04:23
68
Generating the gRPC code from the command line
06:19
69
Getting started with the gRPC server
07:01
70
Listening for gRPC connections in the Logger microservice
04:08
71
Writing the client code
10:49
72
Updating the front end code
02:12
73
Trying things out
02:43
74
What we'll cover in this section
03:19
75
Building images for our microservices
03:53
76
Creating a Docker swarm deployment file
11:51
77
Initalizing and starting Docker Swarm
04:40
78
Starting the front end and hitting our swarm
02:13
79
Scaling services
03:20
80
Updating services
04:31
81
Stopping Docker swarm
01:51
82
Updating the Broker service, and creating a Dockerfile for the front end
05:55
83
Solution to the Challenge
02:27
84
Adding the Front end to our swarm.yml deployment file
01:26
85
Adding Caddy to the mix as a Proxy to our front end and the broker
10:16
86
Modifying our hosts file to add a "backend" entry and bringing up our swarm
06:32
87
Challenge: correcting the URL to the broker service in the front end
06:44
88
Solution to challenge
02:21
89
Updating Postgres to 14.2 - why monitoring is important!
01:54
90
Spinning up two new servers on Linode
04:39
91
Setting up a non-root account and putting a firewall in place.
05:33
92
Installing Docker on the servers
03:20
93
Setting the hostname for our server
03:33
94
Adding DNS entries for our servers
05:45
95
Adding a DNS entry for the Broker service
01:19
96
Initializing a manager, and adding a worker
02:27
97
Updating our swarm.yml and Caddy dockerfile for production
07:06
98
Trying things out, and correcting some mistakes
10:49
99
Populating the remote database using an SSH tunnel
02:34
100
Enabling SSL certificates on the Caddy microservice
11:13
101
What we'll cover in this section
01:59
102
Installing minikube
01:55
103
Installing kubectl
02:39
104
Initializing a cluster
03:07
105
Bringing up the k8s dashboard
02:47
106
Creating a deployment file for Mongo
14:08
107
Creating a deployment file for RabbitMQ
04:53
108
Creating a deployment file for the Broker service
03:22
109
When things go wrong...
07:54
110
Creating a deployment file for MailHog
02:21
111
Creating a deployment file for the Mail microservice
04:19
112
Creating a deployment file for the Logger service
04:28
113
Creating a deployment file for the Listener service
02:03
114
Running Postgres on the host machine, so we can connect to it from k8s
02:48
115
Creating a deployment file for the Authentication service
03:51
116
Trying things out by adding a LoadBalancer service
06:29
117
Creating a deployment file for the Front End microservice
04:42
118
Adding an nginx Ingress to our cluster
05:34
119
Trying out our Ingress
04:25
120
Scaling services
03:33
121
Updating services
02:04
122
Deploying to cloud services
05:21
123
Just some final thoughts and observations
03:52
Unlock unlimited learning

Get instant access to all 122 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Related courses

Frequently asked questions

What are the prerequisites for enrolling in this course?
Before enrolling, students should have a basic understanding of programming concepts and familiarity with Go (Golang). The course will guide you through installing Go and Visual Studio Code, so prior experience with these tools is helpful but not mandatory. Knowledge of Docker, databases like Postgres and MongoDB, and message queuing systems such as RabbitMQ is beneficial but not required as these will be covered in the lessons.
What projects will I build during the course?
Throughout the course, you will develop several microservices, including a Front End service for web page displays, an Authentication service with a Postgres database, a Logging service using MongoDB, a Listener service for RabbitMQ message processing, a Broker service, and a Mail service for email dispatch. These projects provide practical experience with various communication protocols like REST API, RPC, gRPC, and AMQP.
Who is the ideal audience for this course?
This course is ideal for developers interested in modern web application architectures, particularly those transitioning from monolithic to microservice-based systems. It suits individuals looking to expand their skills in Go (Golang) and those exploring efficient ways to manage and deploy scalable, independent application components.
How does the course depth compare to similar courses?
The course provides a hands-on approach to building microservices, offering practical insights into setting up services with Go and integrating them using REST, RPC, gRPC, and AMQP. It covers specific implementations like using Postgres, MongoDB, and RabbitMQ, which may not be covered in all microservice courses, making it a detailed option for those focused on these technologies.
What specific tools or platforms will I learn to use?
You will learn to work with Go (Golang) for developing microservices and use Visual Studio Code as the development environment. The course includes lessons on Docker for containerization, Postgres and MongoDB for database management, RabbitMQ for message queuing, and tools like Mailhog for email testing. Additionally, you'll use Makefiles to simplify the build process.
What topics are not covered in this course?
The course does not cover advanced topics in cloud deployment, security beyond basic mail security, or high-level orchestration tools like Kubernetes. It focuses on building and integrating microservices locally using Docker and does not delve into production-scale deployment strategies or performance optimization techniques.
What is the expected time commitment for this course?
With 123 lessons, the course is comprehensive and designed to be completed at your own pace. The runtime is not specified, but given the detailed nature of the projects and topics covered, students should expect to invest several weeks to fully grasp and implement the concepts, assuming a part-time study schedule.