Working with Microservices in Go Golang

Build highly available, scalable, resilient distributed applications using Go
Working with Microservices in Go Golang
File Size :
3.38 GB
Total length :
11h 31m

Category

Instructor

Trevor Sawler

Language

Last update

6/2022

Ratings

4.6/5

Working with Microservices in Go Golang

What you’ll learn

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

Working with Microservices in Go Golang

Requirements

A basic understanding of the Go programming language
A Macintosh, Windows, or Linux computer with a connection to the internet

Description

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.

Overview

Section 1: Introduction

Lecture 1 Introduction

Lecture 2 About me

Lecture 3 Installing Go

Lecture 4 Installing Visual Studio Code

Lecture 5 Installing Make

Lecture 6 Installing Docker

Lecture 7 Asking for help

Lecture 8 Mistakes: we all make them.

Section 2: Building a simple front end and one Microservice

Lecture 9 What we’ll cover in this section

Lecture 10 Setting up the front end

Lecture 11 Reviewing the front end code

Lecture 12 Our first service: the Broker

Lecture 13 Building a docker image for the Broker service

Lecture 14 Adding a button and JavaScript to the front end

Lecture 15 Creating some helper functions to deal with JSON and such

Lecture 16 Simplifying things with a Makefile (Mac & Linux)

Lecture 17 Simplifying things with a Makefile (Windows)

Section 3: Building an Authentication Service

Lecture 18 What we’ll cover in this section

Lecture 19 Setting up a stub Authentication service

Lecture 20 Creating and connecting to Postgres from the Authentication service

Lecture 21 A note about PostgreSQL

Lecture 22 Updating our docker-compose.yml for Postgres and the Authentication service

Lecture 23 Populating the Postgres database

Lecture 24 Adding a route and handler to accept JSON

Lecture 25 Update the Broker for a standard JSON format, and conect to our Auth service

Lecture 26 Updating the front end to authenticate thorough the Broker and trying things out

Section 4: Building a Logger Service

Lecture 27 What we’ll cover in this section

Lecture 28 Getting started with the Logger service

Lecture 29 Setting up the Logger data models

Lecture 30 Finishing up the Logger data models

Lecture 31 Setting up routes, handlers, helpers, and a web server in our logger-service

Lecture 32 Adding MongoDB to our docker-compose.yml file

Lecture 33 Add the logger-service to docker-compose.yml and the Makefile

Lecture 34 Adding a route and handler on the Broker to communicate with the logger service

Lecture 35 Update the front end to post to the logger, via the broker

Lecture 36 Add basic logging to the Authentication service

Lecture 37 Trying things out

Section 5: Building a Mail Service

Lecture 38 What we’ll cover in this section

Lecture 39 Adding Mailhog to our docker-compose.yml

Lecture 40 Setting up a stub Mail microservice

Lecture 41 Building the logic to send email

Lecture 42 Building the routes, handlers, and email templates

Lecture 43 Challenge: Adding the Mail service to docker-compose.yml and the Makefile

Lecture 44 Solution to challenge

Lecture 45 Modifying the Broker service to handle mail

Lecture 46 Updating the front end to send mail

Lecture 47 A note about mail and security

Section 6: Building a Listener service: AMQP with RabbitMQ

Lecture 48 What we’ll cover in this section

Lecture 49 Creating a stub Listener service

Lecture 50 Adding RabbitMQ to our docker-compose.yml

Lecture 51 Connecting to RabbitMQ

Lecture 52 Writing functions to interact with RabbitMQ

Lecture 53 Adding a logEvent function to our Listener microservice

Lecture 54 Updating main.go to start the Listener function

Lecture 55 Change the RabbitMQ server URL to the Docker address

Lecture 56 Creating a Docker image and updating the Makefile

Lecture 57 Updating the broker to interact with RabbitMQ

Lecture 58 Writing logic to Emit events to RabbitMQ

Lecture 59 Adding a new function in the Broker to log items via RabbitMQ

Lecture 60 Trying things out

Section 7: Communicating between services using Remote Procedure Calls (RPC)

Lecture 61 What we’ll cover in this section

Lecture 62 Setting up an RPC server in the Logger microservice

Lecture 63 Listening for RPC calls in the Logger microservice

Lecture 64 Calling the Logger from the Broker using RPC

Lecture 65 Trying things out

Section 8: Speeding things up (potentially) with gRPC

Lecture 66 What we’ll cover in this section

Lecture 67 Installing the necessary tools for gRPC

Lecture 68 Defining a Protocol for gRPC: the .proto file

Lecture 69 Generating the gRPC code from the command line

Lecture 70 Getting started with the gRPC server

Lecture 71 Listening for gRPC connections in the Logger microservice

Lecture 72 Writing the client code

Lecture 73 Updating the front end code

Lecture 74 Trying things out

Section 9: Deploying our Distributed App using Docker Swarm

Lecture 75 What we’ll cover in this section

Lecture 76 Building images for our microservices

Lecture 77 Creating a Docker swarm deployment file

Lecture 78 Initializing and starting Docker Swarm

Lecture 79 Starting the front end and hitting our swarm

Lecture 80 Scaling services

Lecture 81 Updating services

Lecture 82 Stopping Docker swarm

Lecture 83 Updating the Broker service, and creating a Dockerfile for the front end

Lecture 84 Solution to the Challenge

Lecture 85 Adding the Front end to our swarm.yml deployment file

Lecture 86 Adding Caddy to the mix as a Proxy to our front end and the broker

Lecture 87 Modifying our hosts file to add a “backend” entry and bringing up our swarm

Lecture 88 Challenge: correcting the URL to the broker service in the front end

Lecture 89 Solution to challenge

Lecture 90 Updating Postgres to 14.2 – why monitoring is important!

Lecture 91 Spinning up two new servers on Linode

Lecture 92 Setting up a non-root account and putting a firewall in place.

Lecture 93 Installing Docker on the servers

Lecture 94 Setting the hostname for our server

Lecture 95 Adding DNS entries for our servers

Lecture 96 Adding a DNS entry for the Broker service

Lecture 97 Initializing a manager, and adding a worker

Lecture 98 Updating our swarm.yml and Caddy dockerfile for production

Lecture 99 Trying things out, and correcting some mistakes

Lecture 100 Populating the remote database using an SSH tunnel

Lecture 101 Enabling SSL certificates on the Caddy microservice

Section 10: Deploying our Distributed App to Kubernetes

Lecture 102 What we’ll cover in this section

Lecture 103 Installing minikube

Lecture 104 Installing kubectl

Lecture 105 Initializing a cluster

Lecture 106 Bringing up the k8s dashboard

Lecture 107 Creating a deployment file for Mongo

Lecture 108 Creating a deployment file for RabbitMQ

Lecture 109 Creating a deployment file for the Broker service

Lecture 110 When things go wrong…

Lecture 111 Creating a deployment file for MailHog

Lecture 112 Creating a deployment file for the Mail microservice

Lecture 113 Creating a deployment file for the Logger service

Lecture 114 Creating a deployment file for the Listener service

Lecture 115 Running Postgres on the host machine, so we can connect to it from k8s

Lecture 116 Creating a deployment file for the Authentication service

Lecture 117 Trying things out by adding a LoadBalancer service

Lecture 118 Creating a deployment file for the Front End microservice

Lecture 119 Adding an nginx Ingress to our cluster

Lecture 120 Trying out our Ingress

Lecture 121 Scaling services

Lecture 122 Updating services

Lecture 123 Deploying to cloud services

Section 11: Testing Microservices

Lecture 124 Testing Routes

Lecture 125 Getting started with the Repository pattern for our data package

Lecture 126 Updating our models, handlers, and the main function to use our repository

Lecture 127 Setting up a Test repository

Lecture 128 Correcting a (rather stupid) oversight in models.go

Lecture 129 Testing Handlers

Lecture 130 Mocking our call to the logger-service for tests

Lecture 131 Testing section in progress…

Section 12: Final Thoughts

Lecture 132 Just some final thoughts and observations

Go developers who have worked with monolithic applications and who want to learn how to work with Microservices

Course Information:

Udemy | English | 11h 31m | 3.38 GB
Created by: Trevor Sawler

You Can See More Courses in the Developer >> Greetings from CourseDown.com

New Courses

Scroll to Top