Zenler Player
Your course is loading. Hang tight.
Working with Microservices in Go (Golang)
Back to curriculum
0% Complete
0% Complete
Introduction
Installing Go
Installing Visual Studio Code
Installing Make
Installing Docker
Asking for help
Mistakes. We all make them.
What we'll cover in this section
Setting up the front end
Reviewing the front end code
Our first service: the Broker
Building a docker image for the Broker service
Adding a button and JavaScript to the front end
Creating some helper functions to deal with JSON and such
Simplifying things with a Makefile (Mac & Linux)
Simplifying things with a Makefile (Windows)
What we'll cover in this section
Setting up a stub Authentication service
Creating and connecting to Postgres from the Authentication service
A note about PostgreSQL
Updating our docker-compose.yml for Postgres and the Authentication service
Populating the Postgres database
Adding a route and handler to accept JSON
Update the Broker for a standard JSON format, and conect to our Auth service
Updating the front end to authenticate thorough the Broker and trying things out
What we'll cover in this section
Getting started with the Logger service
Setting up the Logger data models
Finishing up the Logger data models
Setting up routes, handlers, helpers, and a web server in our logger-servic
Adding MongoDB to our docker-compose.yml file
Add the logger-service to docker-compose.yml and the Makefile
Adding a route and handler on the Broker to communicate with the logger service
Update the front end to post to the logger, via the broker
Add basic logging to the Authentication service
Trying things out
What we'll cover in this section
Adding Mailhog to our docker-compose.yml
Setting up a stub Mail microservice
Building the logic to send email
Building the routes, handlers, and email templates
Challenge: Adding the Mail service to docker-compose.yml and the Makefile
Solution to challenge
Modifying the Broker service to handle mai
Updating the front end to send mail
A note about mail and security
What we'll cover in this section
Creating a stub Listener service
Adding RabbitMQ to our docker-compose.yml
Connecting to RabbitMQ
Writing functions to interact with RabbitMQ
Adding a logEvent function to our Listener microservice
Updating main.go to start the Listener function
Change the RabbitMQ server URL to the Docker address
Creating a Docker image and updating the Makefile
Updating the broker to interact with RabbitMQ
Writing logic to Emit events to RabbitMQ
Adding a new function in the Broker to log items via RabbitMQ
Trying things out
What we'll cover in this section
Setting up an RPC server in the Logger microservice
Listening for RPC calls in the Logger microservice
Calling the Logger from the Broker using RPC
Trying things out
What we'll cover in this section
Installing the necessary tools for gRPC
Defining a Protocol for gRPC: the .proto file
Generating the gRPC code from the command line
Getting started with the gRPC server
Listening for gRPC connections in the Logger microservices
Writing the client code
Updating the front end code
Trying things out
What we'll cover in this section
Building images for our microservices
Creating a Docker swarm deployment file
Initializing and starting Docker Swarm
Starting the front end and hitting our swarm
Scaling services
Updating Services
Stopping Docker swarm
Updating the Broker service, and creating a Dockerfile for the front end
Solution to the Challenge
Adding the Front end to our swarm.yml deployment file
Adding Caddy to the mix as a Proxy to our front end and the broker
Modifying our hosts file to add a "backend" entry and bringing up our swarm
Challenge: correcting the URL to the broker service in the front end
Solution to challenge
Updating Postgres to 14.2 - why monitoring is important!
Spinning up two new servers on Linode
Setting up a non-root account and putting a firewall in place.
Installing Docker on the servers
Setting the hostname for our server
Adding DNS entries for our servers
Adding a DNS entry for the Broker service
Initializing a manager, and adding a worker
Updating our swarm.yml and Caddy dockerfile for production
Trying things out, and correcting some mistakes
Populating the remote database using an SSH tunnel
Enabling SSL certificates on the Caddy microservice
What we'll cover in this section
Installing minikube
Installing kubectl
Initializing a cluster
Bringing up the k8s dashboard
Creating a deployment file for Mongo
Creating a deployment file for RabbitMQ
Creating a deployment file for the Broker service
When things go wrong...
Creating a deployment file for MailHog
Creating a deployment file for the Mail microservice
Creating a deployment file for the Logger service
Creating a deployment file for the Listener service
Running Postgres on the host machine, so we can connect to it from k8s
Creating a deployment file for the Authentication service
Trying things out by adding a LoadBalancer service
Creating a deployment file for the Front End microservice
Adding an nginx Ingress to our cluster
Trying out our Ingress
Scaling services
Updating services
Deploying to cloud services
Testing Routes
Getting started with the Repository pattern for our data package
Updating our models, handlers, and the main function to use our repository
Setting up a Test repository
Correcting a (rather stupid) oversight in models.go
Testing Handlers
Mocking our call to the logger-service for tests
Just some final thoughts and observations
Introduction
Introduction
Preview
Installing Go
Preview
Installing Visual Studio Code
Installing Make
Installing Docker
Asking for help
Mistakes. We all make them.
Building a simple front end and one Microservice
What we'll cover in this section
Setting up the front end
Reviewing the front end code
Our first service: the Broker
Building a docker image for the Broker service
Adding a button and JavaScript to the front end
Creating some helper functions to deal with JSON and such
Simplifying things with a Makefile (Mac & Linux)
Simplifying things with a Makefile (Windows)
Building an Authentication Service
What we'll cover in this section
Setting up a stub Authentication service
Creating and connecting to Postgres from the Authentication service
A note about PostgreSQL
Updating our docker-compose.yml for Postgres and the Authentication service
Populating the Postgres database
Adding a route and handler to accept JSON
Update the Broker for a standard JSON format, and conect to our Auth service
Updating the front end to authenticate thorough the Broker and trying things out
Building a Logger Service
What we'll cover in this section
Getting started with the Logger service
Setting up the Logger data models
Finishing up the Logger data models
Setting up routes, handlers, helpers, and a web server in our logger-servic
Adding MongoDB to our docker-compose.yml file
Add the logger-service to docker-compose.yml and the Makefile
Adding a route and handler on the Broker to communicate with the logger service
Update the front end to post to the logger, via the broker
Add basic logging to the Authentication service
Trying things out
Building a Mail Service
What we'll cover in this section
Adding Mailhog to our docker-compose.yml
Setting up a stub Mail microservice
Building the logic to send email
Building the routes, handlers, and email templates
Challenge: Adding the Mail service to docker-compose.yml and the Makefile
Solution to challenge
Modifying the Broker service to handle mai
Updating the front end to send mail
A note about mail and security
Building a Listener service: AMQP with RabbitMQ
What we'll cover in this section
Creating a stub Listener service
Adding RabbitMQ to our docker-compose.yml
Connecting to RabbitMQ
Preview
Writing functions to interact with RabbitMQ
Adding a logEvent function to our Listener microservice
Updating main.go to start the Listener function
Change the RabbitMQ server URL to the Docker address
Creating a Docker image and updating the Makefile
Updating the broker to interact with RabbitMQ
Writing logic to Emit events to RabbitMQ
Adding a new function in the Broker to log items via RabbitMQ
Trying things out
Communicating between services using Remote Procedure Calls (RPC)
What we'll cover in this section
Preview
Setting up an RPC server in the Logger microservice
Listening for RPC calls in the Logger microservice
Calling the Logger from the Broker using RPC
Trying things out
Speeding things up (potentially) with gRPC
What we'll cover in this section
Preview
Installing the necessary tools for gRPC
Defining a Protocol for gRPC: the .proto file
Generating the gRPC code from the command line
Getting started with the gRPC server
Listening for gRPC connections in the Logger microservices
Preview
Writing the client code
Updating the front end code
Trying things out
Deploying our Distributed App using Docker Swarm
What we'll cover in this section
Building images for our microservices
Creating a Docker swarm deployment file
Initializing and starting Docker Swarm
Starting the front end and hitting our swarm
Scaling services
Updating Services
Stopping Docker swarm
Updating the Broker service, and creating a Dockerfile for the front end
Solution to the Challenge
Adding the Front end to our swarm.yml deployment file
Adding Caddy to the mix as a Proxy to our front end and the broker
Modifying our hosts file to add a "backend" entry and bringing up our swarm
Challenge: correcting the URL to the broker service in the front end
Solution to challenge
Updating Postgres to 14.2 - why monitoring is important!
Spinning up two new servers on Linode
Setting up a non-root account and putting a firewall in place.
Installing Docker on the servers
Setting the hostname for our server
Adding DNS entries for our servers
Adding a DNS entry for the Broker service
Initializing a manager, and adding a worker
Updating our swarm.yml and Caddy dockerfile for production
Trying things out, and correcting some mistakes
Populating the remote database using an SSH tunnel
Enabling SSL certificates on the Caddy microservice
Deploying our Distributed App to Kubernetes
What we'll cover in this section
Installing minikube
Installing kubectl
Initializing a cluster
Bringing up the k8s dashboard
Creating a deployment file for Mongo
Creating a deployment file for RabbitMQ
Creating a deployment file for the Broker service
When things go wrong...
Creating a deployment file for MailHog
Creating a deployment file for the Mail microservice
Creating a deployment file for the Logger service
Creating a deployment file for the Listener service
Running Postgres on the host machine, so we can connect to it from k8s
Creating a deployment file for the Authentication service
Trying things out by adding a LoadBalancer service
Creating a deployment file for the Front End microservice
Adding an nginx Ingress to our cluster
Trying out our Ingress
Scaling services
Updating services
Deploying to cloud services
Testing Microservices
Testing Routes
Getting started with the Repository pattern for our data package
Updating our models, handlers, and the main function to use our repository
Setting up a Test repository
Correcting a (rather stupid) oversight in models.go
Testing Handlers
Mocking our call to the logger-service for tests
Final Thoughts
Just some final thoughts and observations
×
This is an unpublished lesson. This lesson will not be shown for students unless you set it as Public.
Back to Dashboard
No contents are available in this lesson!
No lessons available !
Back to Dashboard
Lesson contents locked
Enroll to unlock this lesson.
Enroll to unlock
Next Lesson