Course Overview
For a long time, web applications were usually a single application that handled everything—in other words, a monolithic application. This monolith handled user authentication, logging, sending email, and everything else. While this is still a popular (and useful) approach, today, many larger scale applications tend to break things up into microservices. Today, most large organizations are focused on building web applications using this approach, and with good reason.
Microservices, also known as the microservice architecture, are an architectural style which structures an application as a loosely coupled collection of smaller applications. The microservice architecture allows for the rapid and reliable delivery of large, complex applications. Some of the most common features for a microservice are:
it is maintainable and testable;
it is loosely coupled with other parts of the application;
it can deployed by itself;
it is organized around business capabilities;
it is often owned by a small team.
In this course, we'll develop a number of small, self-contained, loosely coupled microservices that will will communicate with one another and a simple front-end application with a REST API, with RPC, over gRPC, and by sending and consuming messages using AMQP, the Advanced Message Queuing Protocol. The microservices we build will include the following functionality:
A Front End service, that just displays web pages;
An Authentication service, with a Postgres database;
A Logging service, with a MongoDB database;
A Listener service, which receives messages from RabbitMQ and acts upon them;
A Broker service, which is an optional single point of entry into the microservice cluster;
A Mail service, which takes a JSON payload, converts into a formatted email, and send it out.
All of these services will be written in Go, commonly referred to as Golang, a language which is particularly well suited to building distributed web applications.
We'll also learn how to deploy our distributed application to a Docker Swarm and Kubernetes, and how to scale up and down, as necessary, and to update individual microservices with little or no downtime.
Please note that this course requires you to download Docker Desktop from Docker. If you are a Udemy Business user, please check with your employer before downloading software.
FAQ
FAQ area empty
Course curriculum
Chương 1 Introduction 8 bài · 20 phút
Chương 2 Building a simple front end and one Microservice 9 bài · 55 phút
-
What we'll cover in this section 0:41
-
Setting up the front end 1:36
-
Reviewing the front end code 3:36
-
Our first service: the Broker 14:56
-
Building a docker image for the Broker service 8:59
-
Adding a button and JavaScript to the front end 8:38
-
Creating some helper functions to deal with JSON and such 9:04
-
Simplifying things with a Makefile (Mac & Linux) 4:18
-
Simplifying things with a Makefile (Windows) 3:26
Chương 3 Building an Authentication Service 9 bài · 1 giờ 10 phút
-
What we'll cover in this section 1:52
-
Setting up a stub Authentication service 11:13
-
Creating and connecting to Postgres from the Authentication service 8:55
-
A note about PostgreSQL
-
Updating our docker-compose.yml for Postgres and the Authentication service 14:13
-
Populating the Postgres database 2:27
-
Adding a route and handler to accept JSON 8:40
-
Update the Broker for a standard JSON format, and conect to our Auth service 15:06
-
Updating the front end to authenticate thorough the Broker and trying things out 7:09
Chương 4 Building a Logger Service 11 bài · 1 giờ 13 phút
-
What we'll cover in this section 1:00
-
Getting started with the Logger service 10:07
-
Setting up the Logger data models 15:05
-
Finishing up the Logger data models 8:01
-
Setting up routes, handlers, helpers, and a web server in our logger-service 8:41
-
Adding MongoDB to our docker-compose.yml file 6:32
-
Add the logger-service to docker-compose.yml and the Makefile 4:23
-
Adding a route and handler on the Broker to communicate with the logger service 6:31
-
Update the front end to post to the logger, via the broker 4:12
-
Add basic logging to the Authentication service 4:24
-
Trying things out 4:23
Chương 5 Building a Mail Service 10 bài · 1 giờ 8 phút
-
What we'll cover in this section 1:10
-
Adding Mailhog to our docker-compose.yml 2:07
-
Setting up a stub Mail microservice 5:09
-
Building the logic to send email 23:18
-
Building the routes, handlers, and email templates 12:30
-
Challenge: Adding the Mail service to docker-compose.yml and the Makefile 0:45
-
Solution to challenge 3:47
-
Modifying the Broker service to handle mail 8:00
-
Updating the front end to send mail 9:49
-
A note about mail and security 1:18
Chương 6 Building a Listener service: AMQP with RabbitMQ 13 bài · 1 giờ 13 phút
-
What we'll cover in this section 2:29
-
Creating a stub Listener service 3:20
-
Adding RabbitMQ to our docker-compose.yml 4:21
-
Connecting to RabbitMQ 7:51
-
Writing functions to interact with RabbitMQ 21:15
-
Adding a logEvent function to our Listener microservice 2:40
-
Updating main.go to start the Listener function 2:44
-
Change the RabbitMQ server URL to the Docker address 0:40
-
Creating a Docker image and updating the Makefile 6:39
-
Updating the broker to interact with RabbitMQ 4:29
-
Writing logic to Emit events to RabbitMQ 5:58
-
Adding a new function in the Broker to log items via RabbitMQ 6:37
-
Trying things out 3:55
Chương 7 Communicating between services using Remote Procedure Calls (RPC) 5 bài · 21 phút
-
What we'll cover in this section 2:14
-
Setting up an RPC server in the Logger microservice 5:38
-
Listening for RPC calls in the Logger microservice 4:45
-
Calling the Logger from the Broker using RPC 5:41
-
Trying things out 2:46
Chương 8 Speeding things up (potentially) with gRPC 9 bài · 43 phút
-
What we'll cover in this section 2:28
-
Installing the necessary tools for gRPC 2:46
-
Defining a Protocol for gRPC: the .proto file 4:22
-
Generating the gRPC code from the command line 6:18
-
Getting started with the gRPC server 7:00
-
Listening for gRPC connections in the Logger microservice 4:07
-
Writing the client code 10:48
-
Updating the front end code 2:11
-
Trying things out 2:42
Chương 9 Deploying our Distributed App using Docker Swarm 27 bài · 2 giờ 11 phút
-
What we'll cover in this section 3:18
-
Building images for our microservices 3:52
-
Creating a Docker swarm deployment file 11:50
-
Initializing and starting Docker Swarm 4:39
-
Starting the front end and hitting our swarm 2:12
-
Scaling services 3:19
-
Updating services 4:30
-
Stopping Docker swarm 1:50
-
Updating the Broker service, and creating a Dockerfile for the front end 5:54
-
Solution to the Challenge 2:26
-
Adding the Front end to our swarm.yml deployment file 1:25
-
Adding Caddy to the mix as a Proxy to our front end and the broker 10:15
-
Modifying our hosts file to add a "backend" entry and bringing up our swarm 6:31
-
Challenge: correcting the URL to the broker service in the front end 6:43
-
Solution to challenge 2:20
-
Updating Postgres to 14.2 - why monitoring is important! 1:53
-
Spinning up two new servers on Linode 4:38
-
Setting up a non-root account and putting a firewall in place. 5:32
-
Installing Docker on the servers 3:19
-
Setting the hostname for our server 3:32
-
Adding DNS entries for our servers 5:44
-
Adding a DNS entry for the Broker service 1:18
-
Initializing a manager, and adding a worker 2:26
-
Updating our swarm.yml and Caddy dockerfile for production 7:05
-
Trying things out, and correcting some mistakes 10:48
-
Populating the remote database using an SSH tunnel 2:33
-
Enabling SSL certificates on the Caddy microservice 11:12
Chương 10 Deploying our Distributed App to Kubernetes 22 bài · 1 giờ 34 phút
-
What we'll cover in this section 1:58
-
Installing minikube 1:54
-
Installing kubectl 2:38
-
Initializing a cluster 3:06
-
Bringing up the k8s dashboard 2:46
-
Creating a deployment file for Mongo 14:07
-
Creating a deployment file for RabbitMQ 4:52
-
Creating a deployment file for the Broker service 3:21
-
When things go wrong... 7:53
-
Creating a deployment file for MailHog 2:20
-
Creating a deployment file for the Mail microservice 4:18
-
Creating a deployment file for the Logger service 4:27
-
Creating a deployment file for the Listener service 2:02
-
Running Postgres on the host machine, so we can connect to it from k8s 2:47
-
Creating a deployment file for the Authentication service 3:50
-
Trying things out by adding a LoadBalancer service 6:28
-
Creating a deployment file for the Front End microservice 4:41
-
Adding an nginx Ingress to our cluster 5:33
-
Trying out our Ingress 4:24
-
Scaling services 3:32
-
Updating services 2:03
-
Deploying to cloud services 5:20
Chương 11 Testing Microservices 7 bài · 42 phút
-
Testing Routes 10:12
-
Getting started with the Repository pattern for our data package 4:45
-
Updating our models, handlers, and the main function to use our repository 5:06
-
Setting up a Test repository 5:16
-
Correcting a (rather stupid) oversight in models.go 1:31
-
Testing Handlers 6:36
-
Mocking our call to the logger-service for tests 8:08
Chương 12 Final Thoughts 1 bài · 4 phút
-
Just some final thoughts and observations 3:51
Requirment
-
A basic understanding of the Go programming language
-
A Macintosh, Windows, or Linux computer with a connection to the internet
Outcomes
-
Learn what Microservices are and when to use them
-
How to develop loosely coupled, single purpose applications which work together as a distributed application
-
How to communicate between services using JSON, Remote Procedure Calls, and gRPC
-
How to push events to microservices using the Advanced Message Queuing Protocol (AMQP) using RabbitMQ
-
How to deploy your distributed application to Docker Swarm
-
How to deploy your your distributed application to a Kubernetes Cluster
0 Student
12 Courses
0 review