How to design & develop REST microservices in Golang (Go)
4.5 (295 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
3,201 students enrolled

How to design & develop REST microservices in Golang (Go)

All you need to integrate SQL & NoSQL databases, search engines and all the tools that you need in your REST API.
4.5 (295 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
3,201 students enrolled
Created by Federico León
Last updated 4/2020
English
English [Auto]
Current price: $69.99 Original price: $99.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 20.5 hours on-demand video
  • 1 article
  • 2 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • How to structure and organize your microservice.
  • Domain Driven Development.
  • Hexagonal architecture applied.
  • MySQL integration and configuration.
  • Integrate Cassandra DB in your microservices.
  • Elasticsearch integration and configuration.
  • Logging to standard output and log files.
  • DAO pattern implementation.
  • How to build, publish and use a custom Go library.
  • Testing all the layers of your application.
  • How dependencies work in Go.
Course content
Expand all 48 lectures 20:40:10
+ Introducción
3 lectures 18:19

A brief description about what we're going to build during this course.

Preview 07:34

In this video we're looking at a quick preview on what we're going to build, the approaches, the technologies, the patterns, the tools, everything so you can have a good idea about what you're about to learn during this course.

Preview 10:14

In this lecture I'm just sharing the course repositories so you can take a look at them from day one. This is all we're going to do during this course! Don't feel overwhelmed, I can ensure you that by the end of this course you'll dominate all of this! Enjoy and let's Go :)

These are all of the repos!
00:31
+ Creating our projects: Users API
6 lectures 02:42:24

Creating all of our projects in Github.

Create projects in Github
13:19

An introduction to HTTP frameworks in Go. We're using gin-gonic for both our Users and OAuth API and gorilla/mux for our Items API later.

HTTP frameworks
10:11

An introduction to the MVC pattern in Go.

Basic application structure: MVC pattern
30:09

How and why we should always start from our domain and then going backwards in the layers.

Starting from our domain
46:34

How to structure the domain persistence layer: a kind introduction to the DAO pattern.

How to structure our domain persistence
41:07

How to work with dates in Go.

Working with dates
21:04
+ MySQL integration
7 lectures 03:31:49

Adding and configuring our MySQL database in Go.

Configure MySQL client in Go
29:38

How to insert rows in our MySQL database.

How to insert rows
26:41

How to read a single row from our MySQL server.

How to read rows
14:58

How to handle MySQL errors.

How to handle MySQL errors
33:30

How to update rows in our MySQL database.

How to update rows
33:38

How to delete rows from our MySQL database.

How to delete rows
21:42

How to find rows in our MySQL database.

How to find rows
51:42
+ Fixing the mistakes we made
3 lectures 01:36:43

An introduction to the marshaller concept, how to develop and where to use it!

How to marshal structs
33:03

Implementing our services via interfaces so we have a consistent and mockeable business logic handler in our entire application.

Preview 25:33

Adding a logger to our application ( zap from Uber in this case).

No logging system
38:07
+ Creating our projects: OAuth API
4 lectures 01:34:10

An introduction to OAuth authentication.

OAuth authentication
11:27

An introduction to Domain Driven Development.

Domain Driven Development
18:20

How to start working on the domain as the start point of our application development process.

DDD - Starting with the domain
27:57

How to implement our DDD approach in Go.

DDD - Project structure
36:26
+ Cassandra integration
4 lectures 01:08:52

An introduction to CassandraDB.

Introduction to Cassandra DB
10:55

An introduction to one of the Cassandra clients in Go.

Cassandra Go client
22:10

In this lesson we're interacting with our Cassandra cluster to insert, get and update records.

How to insert, get and update records
29:57

In this lesson we're improving our GetSession() implementation based on recommendations from the Cassandra Go client.

Tune our get session implementation
05:50
+ Making the authentication work
3 lectures 01:24:14

How to authenticate users in our ecosystem by leveraging on the OAuth API.

Authenticating users
11:27

In this lesson we're looking at how to generate access tokens in our OAuth API. Please take a look at the external resources attached to this lesson so you can define the best approach that fits the best for your use cases.

Generating access tokens
57:11

In this lesson we're defining two different requests: One for our OAuth API and other for our Users API so you can create one based on the other one and not be restrained to the same interface.

Different requests for the two APIs
15:36
+ Golang libraries & dependencies
4 lectures 01:50:34

How to create an OAuth library in Github that we're going to use in all of our microservices to authenticate against our OAuth API.

Creating a shared OAuth library
52:45

An introduction to how dependencies work in Go and how we can use dep to generate and maintain our vendor folder.


GOROOT: Where Go is installed. Default: /usr/local/go

    export GOROOT=/usr/local/go

    export PATH=$PATH:$GOROOT/bin


GOPATH: Workspace for Go projects. Default: ~/go

    Go 1.13 set "modules" as the confirmed dependency system in Go.

    Go < 1.13: Every Go project must be cloned INSIDE of your GOPATH.

    Go >= 1.13: Every Go project using modules must be cloned OUTSIDE of your GOPATH.


How dependencies work: go modules
24:37

How to explicitly define transitive dependencies in our libraries.

Defining transitive dependencies
06:31

How to create a Utils library in Github and use it in all of our projects.

Creating a shared utils library
26:41
+ Creating our projects: Items API
11 lectures 05:37:19
Application structure: MVC & gorilla/mux
47:00

In this lesson we're configuring our Mux router in the Items API.

Configure our mux router
36:24

A kind introduction to ES.

Introduction to Elasticsearch
12:10

Adding the ES client in our Go application.

Adding ElasticSearch client
29:44

In this lesson we're covering how to implement and organize our code in order to index new documents in ES.

Index documents in ES
38:58

In this lesson we're removing the copies of the logger from all the repos and moving it to a common library that we can import and use.

Moving our logger to the utils library
33:03

In this lesson we're improving the quality of our errors library.

Improving our errors library
32:46

In this lesson we're applying vendor to all of our projects and making them ready to ship.

Dependencies: Using modules in all projects
22:23
How to get documents by ID
36:13

In this lesson we're implementing both the get by id and search features in our API.

Searching documents in ES
44:46

In this video I'm explaining the homework you have in order to add the delete and update endpoints to our API.

Homework: Add delete and update endpoints
03:52
+ Testing
1 lecture 28:15

In this lesson we're unit testing our OAuth library. I'll leave some exercises so you can continue testing the application.

Testing our application: OAuth client
28:15
Requirements
  • Just complete the Golang tour available at Golang's website
  • Nice to have: Part 1 of this course
Description

Welcome!


In this second part of the series I'm working with MySQL, Cassandra and Elasticsearch as persistence layers and we're going to create 3 different microservices using different design patterns: MVC, featured MVC and Domain Driven Development implementing the Hexagonal architecture.


At the end of the course you'll learn:

  • How to structure our application's packages and code.

  • MVC pattern, Domain Driven Development and Hexagonal Architecture applied!

  • How to configure MySQL client in Go. DAO pattern implemented.

  • How to configure and use CassandraDB client in Go.

  • How to configure and use Elasticsearch in Go.

  • Testing and mocking database integrations.

  • Stress test the microservice with goroutines.

  • How dependencies work in Go. Usage of Go modules.

  • How to build, publish, use and share a custom Go library.

  • Application design patterns.

  • Preparing our distributed logging system.

  • Real life examples and exercises.


I'm sure you're going to enjoy this course! if you have any doubts, please check the reviews on my other courses so you can get an idea about what you're about to get. This is real life and industry experience!


Hope to hear from you!

Fede.

Who this course is for:
  • Software engineers.
  • Software developers.
  • Technical leaders.
  • Architects.
  • Anyone who wants to get serious about microservices in Go.