Backend Master Class [Golang + PostgreSQL + Kubernetes]
Course description
This course is designed with a lot of details, so that everyone, even with very little programming experience can understand and do it by themselves. I strongly believe that after the course, you would be able to work much more confidently and effectively in your projects. In this course, you will learn step-by-step how to design, develop and deploy a backend web service from scratch. I believe the best way to learn programming is to build a real application.
Read more about the course
Therefore, throughout the course, you will learn how to build a backend web service for a simple bank.
It will provide APIs for the frontend to do the following things:
Create and manage bank accounts.
Record all balance changes to each of the accounts.
Perform a money transfer between 2 accounts.
The programming language we will use to develop the service is Golang, but the course is not just about coding in Go.
The course is divided into 4 main parts:
In the first part, you will learn deeply about how to design the database, generate codes to talk to the DB in a consistent and reliable way using transactions, understand the DB isolation levels, and how to use it correctly in production. Besides the database, you will also learn how to use docker for local development, how to use Git to manage your codes, and how to use Github Action to run unit tests automatically.
In the second part, you will learn how to build a set of RESTful HTTP APIs using Gin - one of the most popular Golang frameworks for building web services. This includes everything from loading app configs, mocking DB for more robust unit tests, handling errors, authenticating users, and securing the APIs with JWT and PASETO access tokens.
In the third part, you will learn how to build your app with Docker and deploy it to a production Kubernetes cluster on AWS. The lectures are very detailed with a step-by-step guide, from how to build a minimal docker image, set up a free-tier AWS account, create a production database, store and retrieve production secrets, create a Kubernetes cluster with EKS, use Github Action to automatically build and deploy the image to the EKS cluster, buy a domain name and route the traffics to the service, secure the connection with HTTPs and auto-renew TLS certificate from Let's Encrypt.
The last part is a work-in-progress, where we discuss more advanced backend topics such as managing user sessions, building gRPC APIs, using gRPC gateway to serve both gRPC and HTTP with 1 single implementation of the handler, and embedding Swagger documentation as part of the backend service, etc.
Watch Online
All Course Lessons (79)
| # | Lesson Title | Duration | Access |
|---|---|---|---|
| 1 | 1.1. Design DB schema and generate SQL code with dbdiagram.io Demo | 09:58 | |
| 2 | 1.2. Setup development environment on Windows WSL2, Go, VSCode, Docker, Make, Sqlc | 09:15 | |
| 3 | 1.3. Setup development environment on MacOS Install Go and Visual Studio Code | 06:19 | |
| 4 | 1.4. Use Docker + Postgres + TablePlus to create DB schema | 12:39 | |
| 5 | 1.5. How to write & run database migration in Golang | 09:52 | |
| 6 | 1.6. Generate CRUD Golang code from SQL Compare dbsql, gorm, sqlx & sqlc | 21:22 | |
| 7 | 1.8. Write unit tests for database CRUD with random data in Golang | 20:05 | |
| 8 | 1.10. A clean way to implement database transaction in Golang | 19:53 | |
| 9 | 1.11. DB transaction lock & How to handle deadlock in Golang | 28:21 | |
| 10 | 1.12. How to avoid deadlock in DB transaction Queries order matters! | 13:04 | |
| 11 | 1.13. Deeply understand transaction isolation levels & read phenomena | 29:37 | |
| 12 | 1.14. Setup Github Actions for Golang + Postgres to run automated tests | 19:27 | |
| 13 | 2.1. Implement RESTful HTTP API in Go using Gin | 25:22 | |
| 14 | 2.2. Load config from file & environment variables in Go with Viper | 09:33 | |
| 15 | 2.3. Mock DB for testing HTTP API in Go and achieve 100% coverage | 26:55 | |
| 16 | 2.4. Implement transfer money API with a custom params validator | 14:25 | |
| 17 | 2.5. Add users table with unique & foreign key constraints in PostgreSQL | 14:08 | |
| 18 | 2.6. How to handle DB errors in Golang correctly | 11:13 | |
| 19 | 2.7. How to securely store passwords Hash password in Go with Bcrypt! | 16:54 | |
| 20 | 2.8. How to write stronger unit tests with a custom gomock matcher | 12:01 | |
| 21 | 2.9. Why PASETO is better than JWT for token-based authentication | 15:25 | |
| 22 | 2.10. How to create and verify JWT & PASETO token in Golang | 23:31 | |
| 23 | 2.11. Implement login user API that returns PASETO or JWT access token in Go | 13:52 | |
| 24 | 2.12. Implement authentication middleware and authorization rules in Golang using Gin | 29:18 | |
| 25 | 3.1. How to build a small Golang Docker image with a multistage Dockerfile | 12:00 | |
| 26 | 3.2. How to use docker network to connect 2 stand-alone containers | 10:08 | |
| 27 | 3.3. How to write docker-compose file and control service start-up orders | 16:09 | |
| 28 | 3.4. How to create a free-tier AWS account | 06:45 | |
| 29 | 3.5. Auto build & push docker image to AWS ECR with Github Actions | 20:45 | |
| 30 | 3.6. How to create a production database on AWS RDS | 10:09 | |
| 31 | 3.7. Store & retrieve production secrets with AWS secrets manager | 23:32 | |
| 32 | 3.8. Kubernetes architecture & How to create an EKS cluster on AWS | 17:28 | |
| 33 | 3.9. How to use kubectl & k9s to connect to a kubernetes cluster on AWS EKS | 15:04 | |
| 34 | 3.10. How to deploy a web app to Kubernetes cluster on AWS EKS | 20:54 | |
| 35 | 3.11. Register a domain & set up A-record using Route53 | 10:31 | |
| 36 | 3.12. How to use Ingress to route traffics to different services in Kubernetes | 09:51 | |
| 37 | 3.13. Auto issue & renew TLS certificates with cert-manager and Let's Encrypt | 14:26 | |
| 38 | 3.14. Automatic deploy to Kubernetes with Github Action | 14:39 | |
| 39 | 4.1. How to manage user session with refresh token | 22:56 | |
| 40 | 4.2. Generate DB documentation page and schema SQL dump from DBML | 11:10 | |
| 41 | 4.3. Introduction to gRPC | 07:48 | |
| 42 | 4.4. Define gRPC API and generate Go code with protobuf | 16:16 | |
| 43 | 4.5. How to run a golang gRPC server and call its API | 10:09 | |
| 44 | 4.6. Implement gRPC API to create and login users in Go | 13:38 | |
| 45 | 4.7. gRPC Gateway write code once, serve both gRPC & HTTP requests | 16:43 | |
| 46 | 4.8. How to extract information from gRPC metadata | 08:44 | |
| 47 | 4.9. Automatic generate & serve swagger documentation from Go server | 13:19 | |
| 48 | 4.10. Embed static front-end files inside Golang backend server's binary | 10:24 | |
| 49 | 4.11. Validate gRPC parameters and send humanmachine friendly response | 15:43 | |
| 50 | 4.12. Run DB migrations directly inside Golang code | 11:45 | |
| 51 | 4.13. Partial update DB record with SQLC nullable arguments | 18:22 | |
| 52 | 4.14. Build gRPC update API with optional parameters | 14:19 | |
| 53 | 4.15. Add authorization to protect gRPC API | 14:29 | |
| 54 | 4.16. Write structured logs for gRPC APIs | 15:19 | |
| 55 | 4.17. How to write HTTP logger middleware in Go | 10:05 | |
| 56 | 5.1. Implement background worker with Redis task queue | 19:39 | |
| 57 | 5.2. Integrate async worker to Go web server | 13:59 | |
| 58 | 5.3. Send async tasks to Redis within a DB transaction | 09:27 | |
| 59 | 5.4. How to handle errors and print logs for Async workers | 10:43 | |
| 60 | 5.5. Some delay might be good for your async tasks | 06:15 | |
| 61 | 5.6. How to send email in Go via Gmail | 15:06 | |
| 62 | 5.7. How to skip test in Go and config test flag in vscode | 03:30 | |
| 63 | 5.8. Email verification feature design DB and send email | 18:37 | |
| 64 | 5.9. Implement email verification API in Go | 16:46 | |
| 65 | 5.10. Unit test gRPC API with mock DB & Redis | 24:34 | |
| 66 | 5.11. How to test a gRPC API that requires authentication | 14:34 | |
| 67 | 6.1. Upgrade and config sqlc with version 2 syntax | 05:44 | |
| 68 | 6.2. Switch DB driver from libpq to pgx | 17:44 | |
| 69 | 6.3. How to properly handle DB errors with pgx driver | 09:36 | |
| 70 | 6.4. Docker compose port + volume mapping | 09:02 | |
| 71 | 6.5. How to install & use binary packages in Go | 04:43 | |
| 72 | 6.6. Implement role-based access control (RBAC) in Go | 14:36 | |
| 73 | 6.7. Grant AWS EKS cluster access to Postgres and Redis using security group | 14:22 | |
| 74 | 6.8. Deploy gRPC + HTTP server to AWS EKS cluster | 15:57 | |
| 75 | 6.9. Don't lose money on AWS | 03:54 | |
| 76 | 6.10. Graceful shutdown gRPCHTTP servers and async worker | 14:11 | |
| 77 | 6.11. Go 1.22 fixed the most common for-loop trap | 07:22 | |
| 78 | 6.12. How to setup CORS policy in Go | 10:06 | |
| 79 | 6.13. Upgrade golang JWT package to the latest version (v5) | 05:28 |
Unlock unlimited learning
Get instant access to all 78 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.
Learn more about subscriptionBooks
Read Book Backend Master Class [Golang + PostgreSQL + Kubernetes]
| # | Title |
|---|---|
| 1 | 1.1. 01-presentation-backend-master-class |
| 2 | 1.4. 02-presentation-docker-postgres-table-plus |
| 3 | 1.4. trouble-shoot-root-does-not-exist |
| 4 | 1.5. 03-presentation-db-migration |
| 5 | 1.6. 04-presentation-sqlc-crud |
| 6 | 1.10. 06-presentation-db-transaction |
| 7 | 1.13. 09-presentation-transaction-isolation |
| 8 | 1.14. 10-presentation-github-action |
| 9 | 2.1. 11-presentation-gin |
| 10 | 2.2. 12-presentation-config-viper |
| 11 | 2.3. 13-presentation-db-mock |
| 12 | 2.7. 17-presentation-hash-password |
| 13 | 2.9. 19-presentation-paseto-vs-jwt |
| 14 | 2.11. 21-login-api |
| 15 | 2.12. 22-presentation-gin-auth-middleware |
| 16 | 3.1. 23-presentation-minimal-docker-image |
| 17 | 3.8. 30-presentation-kubernetes-cluster |
| 18 | 4.1. 37-presentation-session-refresh-token |
| 19 | 4.3. 39-presentation-grpc |
| 20 | 4.4. 40-presentation-grpc-protobuf |
| 21 | 4.5. 41-presentation-grpc-server-evans-client |
| 22 | 4.8. 44-grpc-metadata |
| 23 | 4.16. 52-presentation-grpc-logger |
| 24 | 5.1. 54-presentation-async-worker |
| 25 | 5.6. trouble-shoot-gmail-app-password |
Comments
0 commentsWant to join the conversation?
Sign in to commentSimilar courses
gRPC [Golang] Master Class: Build Modern API & Microservices
Testing with Go
Blockchain from scratch with GRPC and Protobuffers
Let's Build a Go version of Laravel