We may earn an affiliate commission when you visit our partners.
Course image
TECH SCHOOL

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. 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.

Read more

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. 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. You will learn a lot of different topics regarding backend web development. They are presented in 6 sections:

  1. In the 1st section, 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.

  2. In the 2nd section, 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. 

  3. In the 3rd section, 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.

  4. In the 4th section, we will discuss several advanced backend topics such as managing user sessions, building gRPC APIs, using gRPC gateway to serve both gRPC and HTTP requests at the same time, embedding Swagger documentation as part of the backend service, partially updating a record using optional parameters, and writing structured logger HTTP middlewares and gRPC interceptors.

  5. Then the 5th section will introduce you to asynchronous processing in Golang using background workers and Redis as its message queue. We'll also learn how to create and send emails to users via Gmail SMTP server. Along the way, we'll learn more about writing unit tests for our gRPC services that might involve mocking multiple dependencies at once.

  6. The final section 6th concludes the course with lectures about how to improve the stability and security of the server. We'll keep updating dependency packages to the latest version, use Cookies to make the refresh token more secure, and learn how to gracefully shut down the server to protect the processing resources. As this part is still a work in progress, we will keep making and uploading new videos about new topics in the future. So please come back here to check them out from time to time.

This course is designed with a lot of details, so that everyone, even those with very little programming experience can understand and do it by themselves. I firmly believe that after the course, you will be able to work much more confidently and effectively on your projects.

Enroll now

What's inside

Learning objectives

  • Design database schema using dbml and automatically generate sql code from it
  • Deeply understand the db isolation levels, transactions and how to avoid deadlock
  • Automatically generate golang code to interact with the database
  • Develop a restful backend web service using the gin framework
  • Secure the apis with user authentication, jwt and paseto
  • Write stronger test set with high coverage using interfaces and mocking
  • Build a minimal docker image for deployment and use docker-compose for development
  • Set up github action to automatically build and deploy the app to aws kubernetes cluster
  • Register a domain and config kubernetes ingress to route traffic to the web service
  • Enable automatic issue & renew tls certificate for the domain with let's encrypt
  • Take your web service to the next level with grpc and grpc gateway
  • Run background workers to process tasks asynchronously with redis and asynq
  • Show more
  • Show less

Syllabus

Working with database [Postgres + SQLC]

Hello guys, welcome to the course!

In the resource, there's a link to the Github repository, where you can find all the codes used in the lectures. You can also take a look at the Pull request history to understand how it evolves over time.

The most important thing is to understand the ideas and implement them on your own.

If you face any troubles that you can't solve on yourself, please ask questions in the Q&A section or in Tech School's discord group. I will try my best to help you. Besides, you might also find some valuable answers from other students as well.

Thank you for taking the course, and hope you will find it interesting and useful.
Happy learning! Cheers!

Read more

Note: This video is recorded after other videos in the course, so the version of Go and SQLC is newer than in the others.

Hey guys, in this lecture we will learn how to generate CRUD golang code from SQL queries using sqlc.

The video was recorded on a Mac, but it should be similar for Linux and Windows. You can refer to it in the sqlc's documentation page.

For Windows users, please follow the previous lecture about "Setup development environment on Windows" to learn how to install & run it with WSL.

This is a self-assessment exercise that you must do in order to follow the next lectures of the course.

In this exercise, you'll have to configure sqlc.yaml, and write 2 SQL files inside the db/query folder: 

1. In the transfer.sql file: you must write 3 queries to CreateTransfer, GetTransfer, and ListTransfers

2. In the entries.sql file: you must write 3 queries to CreateEntry, GetEntry, and ListEntries
Then, finally you must run the make sqlc command in the terminal to generate golang codes from those 2 SQL files.

Before moving to the next lecture, make sure you have configured the right SQL driver (database/sql) in your sqlc.yaml file, otherwise you will see some errors.

That's because when the lecture was recorded, the old version of sqlc (v1) still used database/sql as the default database driver. So if you use newer version of sqlc (v2), which uses pgx driver instead, there will be some incompatibility between the two.

In order to easily following the lectures, I strongly recommend that you use the same sqlc setting as mine, which uses database/sql as the DB driver. Then, later, in section 6 of the course, you will find a new lecture that shows how to switch to pgx.

Note: If you're using newer version of migrate, such as 4.15.1, the binary file name has been changed to just migrate instead of migrate.linux-amd64. So you should change the COPY command in the Dockerfile to reflect this.

Hey guys, actually this is not the end of the course yet. I've decided to add more lectures about advanced backend topics to this course.
I will keep uploading more and more videos in the future, so stay tuned and make sure to check out this course from time to time, or you can subscribe to our Youtube channel or follow us on Twitter/Facebook (links in the profile).
Thanks a lot and happy learning!

In this lecture, I will give you an overview of #gRPC - one of the best frameworks to develop a backend web service.

The first step to develop a gRPC web service is to define the RPC API and its request/response structure using protobuf, then use that protobuf definition to generate codes for the server and client. And that’s exactly what we’re gonna do in this lecture.

In this video, let’s learn how to use the previous lecture's generated codes to run a gRPC server, and then connect to it using an interactive client tool called Evans CLI.

In this video, let’s learn how to implement 2 gRPC APIs to create and login users in Golang.

In this videos, we will learn how to extract information from gRPC metadata, such as getting client's IP address or user agent.

In this video, we will learn how to write parameters validation for a gRPC service, then send a human/machine friendly response to the client.

For those who can't find the "App password" section:
That's because Google just moved it inside the "2-Step Verification" page. So you'll have to click on the "2-Step Verification" button to open that page, then you'll find the "App password" section at the bottom of the page.

In this video, we'll learn how to install & use binary packages in Go, specifically some gRPC & gRPC gateway packages to generate golang codes. This will help you fix the error: "protoc-gen-grpc-gateway" is a program, not an importable package.

Hey guys,

This is not the end of the course! I will keep making and posting new lectures about more advanced backend topics such as using Cookies, bulk inserts, etc.

So please come back to check out the course from time to time. You can also join our Discord group to chat with me and other students: https://bit.ly/techschooldc

And if you like the course, don't forget to give it some positive feedback and reviews. Thanks a lot and see you soon in the following lecture!

Congratulations on completing the course! I hope it was interesting and useful for you.

If you like the course, don't forget to give it a good review and share it with your friends and colleagues.

Thank you, happy learning and hope to see you again in another course of Tech School!

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Uses Golang, Postgres, Kubernetes, and gRPC, which are technologies commonly used in modern backend development and microservices architectures
Covers RESTful HTTP APIs using Gin, a popular Golang framework, which is useful for building web services and integrating with front-end applications
Includes deploying applications to a production Kubernetes cluster on AWS, which is a highly sought-after skill in DevOps and cloud engineering roles
Explores advanced backend topics such as managing user sessions and building gRPC APIs, which are essential for building scalable and robust systems
Teaches asynchronous processing using background workers and Redis, which is valuable for improving application performance and handling long-running tasks
Requires setting up a free-tier AWS account, which may involve providing billing information and incurring potential costs if usage exceeds the free tier limits

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Comprehensive go backend development

According to learners, this is a highly comprehensive master class that covers the full spectrum of backend development using Go, Postgres, Docker, and Kubernetes. Students highlight the practical, hands-on approach centered around building a real-world banking application, finding it exceptionally valuable for understanding concepts through application. The instructor's ability to explain complex topics clearly and step-by-step is frequently praised. While some mention initial challenges with environment setup or keeping up with dependencies, overall feedback indicates the course provides a strong foundation and prepares students well for professional backend roles.
Instructor actively updates content and addresses issues.
"It's great that the instructor keeps adding new lectures and updating parts of the course."
"Noticed updates addressing newer versions of tools like sqlc, which is very helpful."
"The instructor seems responsive to feedback and improves the course over time."
"Appreciate the effort to keep the content current in a fast-moving field."
Instructor explains complex topics step-by-step.
"The instructor has a gift for explaining difficult concepts in a simple, easy-to-follow manner."
"Lectures are very detailed with a step-by-step guide, which is perfect for learning new tech."
"I never felt lost because the explanations were so clear and well-structured."
"His teaching style makes complex topics like Kubernetes and gRPC approachable."
Hands-on project helps solidify understanding.
"Building the bank project from scratch was the best way to learn; everything connects logically."
"I love that this isn't just theoretical; I'm building a real application I can showcase."
"The hands-on coding and projects are the strongest part of the course for me."
"Applying concepts immediately in the project made them much easier to grasp."
Covers a wide range of essential backend topics.
"This course is incredibly comprehensive, touching on everything from database design to deployment on Kubernetes."
"I appreciate how it covers not just Go code but also critical infrastructure like Docker, Postgres, and Kubernetes."
"The breadth of topics covered, including gRPC and async workers, is fantastic for a single course."
"It truly feels like a 'master class' due to the depth and variety of subjects integrated into one project."
Environment setup can be a bit tricky initially.
"Setting up the development environment and getting everything running took a little more effort than expected."
"Encountered some issues with dependency versions not matching the lectures exactly."
"Had some trouble with the initial Docker and Postgres setup, but the Q&A helped."
"It required careful following of instructions and sometimes external troubleshooting for setup."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Backend Master Class [Golang + Postgres + Kubernetes + gRPC] with these activities:
Review Database Transactions
Solidify your understanding of database transactions, isolation levels, and deadlock avoidance before diving into the course's database sections.
Browse courses on Database Transactions
Show steps
  • Read articles or watch videos explaining ACID properties.
  • Review SQL transaction syntax and commands.
  • Practice writing simple transactions with rollback and commit.
Review 'Designing Data-Intensive Applications'
Gain a deeper understanding of the principles behind database design and distributed systems, which are crucial for building robust backend services.
View Secret Colors on Amazon
Show steps
  • Read the chapters on data models and storage engines.
  • Study the sections on distributed systems and consistency.
  • Relate the concepts to the technologies used in the course.
Implement a Simple REST API
Practice building a RESTful API using Go and a framework like Gin to reinforce the concepts learned in the course.
Show steps
  • Define API endpoints for basic CRUD operations.
  • Implement the API using Go and the Gin framework.
  • Test the API endpoints using a tool like Postman.
  • Add authentication using JWT or PASETO.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Review 'Kubernetes in Action'
Deepen your understanding of Kubernetes concepts and best practices for deploying and managing applications in a cluster.
Show steps
  • Read the chapters on Kubernetes architecture and core concepts.
  • Study the sections on deployment strategies and service management.
  • Experiment with the examples provided in the book.
Blog Post: gRPC vs REST
Solidify your understanding of gRPC and RESTful APIs by writing a blog post comparing their advantages and disadvantages.
Show steps
  • Research the key differences between gRPC and REST.
  • Outline the blog post with clear sections and examples.
  • Write the blog post, explaining the pros and cons of each approach.
  • Publish the blog post on a platform like Medium or Dev.to.
Kubernetes Deployment Script
Create a Kubernetes deployment script for a sample Go application to practice deploying applications to a Kubernetes cluster.
Show steps
  • Write a Dockerfile for a simple Go application.
  • Create Kubernetes deployment and service YAML files.
  • Deploy the application to a local Kubernetes cluster (e.g., Minikube).
  • Test the deployment and service.
Contribute to a Go Project
Contribute to an open-source Go project to gain practical experience and learn from experienced developers.
Show steps
  • Find a Go project on GitHub that interests you.
  • Read the project's contribution guidelines.
  • Identify a bug or feature to work on.
  • Submit a pull request with your changes.

Career center

Learners who complete Backend Master Class [Golang + Postgres + Kubernetes + gRPC] will develop knowledge and skills that may be useful to these careers:
Backend Engineer
A backend engineer is responsible for building and maintaining the server-side logic of web applications, working with databases, APIs, and ensuring server stability and security. This course would be quite beneficial to a backend engineer because it covers numerous key aspects of backend development such as designing databases, building RESTful APIs with Gin, deploying applications to Kubernetes, and working with gRPC. It will help any aspiring backend engineer understand concepts, like database transactions, user authentication, and asynchronous processing which are essential to their role. This course is a strong choice for any backend engineer looking to improve their skillset.
Software Engineer
A software engineer develops and maintains software applications, using programming languages, databases, and various developer tools. This course directly relates to a software engineer's role by offering hands-on experience in building a complete backend service. It will be quite helpful in understanding how to design database schemas, write unit tests, deploy applications to the cloud, and implement secure APIs. Any software engineer will find the practical skills gained from building a real-world project to be a solid addition to their experience. A software engineer looking for a full-stack approach to backend development should consider this course.
API Developer
An application programming interface developer designs, develops, and manages APIs that facilitate communication between different software systems. This course would be useful to an API developer, as it covers creating RESTful APIs using Gin, securing them with JWT and PASETO tokens, and building gRPC APIs. This course also provides valuable exposure to API documentation and versioning. An API developer will find that this course helps them understand the full lifecycle of API development. Someone who wishes to work as an API developer will benefit from the course's focus on building and securing web based services.
Cloud Engineer
A cloud engineer is tasked with managing and maintaining cloud resources, often working with platforms like AWS, using technologies such as Docker and Kubernetes. This course will be particularly helpful to a cloud engineer as it outlines, in detail, how to deploy applications to a Kubernetes cluster on AWS, create Docker images, set up GitHub Actions for automated deployment, and use secrets managers. It helps any cloud engineer by providing them with the skills to deploy and manage applications in a production environment. A cloud engineer will find this to be a useful reference in the day to day management of a system.
DevOps Engineer
A DevOps engineer focuses on automating software development processes, and deployment, using tools like Docker, Kubernetes, and CI/CD pipelines. This course directly aligns with the responsibilities of a DevOps engineer by providing hands-on experience with setting up Docker for development, creating CI/CD pipelines using GitHub Actions, and deploying applications to Kubernetes clusters. It helps a DevOps engineer with understanding how to streamline the development workflow from code to deployment. A DevOps engineer will find the course's focus on automation and deployment to be well suited to this career path.
Database Administrator
A database administrator is responsible for the maintenance, performance, and security of databases. This course would be helpful for a database administrator because it explores database design, transaction management, and how to avoid deadlocks. The course also demonstrates how to use SQLC to generate code for interacting with databases. A database administrator will find the material on database transactions and isolation levels especially helpful to their role. Those interested in database administration may find this course useful because of the detailed approach it takes to databases.
System Architect
System architects design the high-level structure of software systems, considering factors such as scalability, reliability, and security. This course will help prepare a system architect by providing insights into designing a complete backend system, working with various technologies for databases, APIs, and deployment. It exposes the learner to key elements of system design, such as database schema generation, API design, and production deployment. A system architect will find the course provides an overview of the complete lifecycle of a complex system. This course may be helpful to anyone who wishes to become a system architect.
Full-Stack Developer
A full stack developer works on both front-end and back-end aspects of software applications, requiring a broad range of skills. This course is useful for a full stack developer because it focuses on the back-end, covering topics from database design, API development, to deployment. The course’s detailed approach will help a full stack developer who needs to understand backend services and how to integrate them into a larger application. A full stack developer will appreciate the course's focus on creating production-ready backend services. This course may be useful to anyone seeking to become a full stack developer.
Solutions Architect
A solutions architect designs and oversees the implementation of complex IT solutions, often requiring knowledge of databases, cloud infrastructure, and software development practices. This course may be useful to a solutions architect by walking through the creation of a complete backend system, encompassing design, development, and deployment. It offers a solutions architect insight into how different components of a system work together. This course can provide exposure to common technologies, patterns, and best practices for building backend solutions. Someone who wishes to become a solutions architect may find this to be relevant material.
Technical Lead
A technical lead is responsible for guiding a team of developers, making technical decisions, and ensuring project success. This course may help a technical lead by providing a comprehensive understanding of backend web development processes, from database design to deployment. It can provide an understanding of the different technologies and practices used in developing and deploying a backend service. A technical lead will find that the knowledge gained from this course improves their ability to lead development projects effectively. This course may be useful to anyone who wishes to become a technical lead.
Application Developer
An application developer builds and maintains software applications, and typically requires knowledge of programming languages and development tools. This course may be helpful for an application developer since it covers the complete lifecycle of developing a backend service. The course provides hands-on experience with APIs, databases, and deployment. An application developer will find the course provides an understanding of many aspects of backend work that they may not be directly exposed to. This course may be helpful to anyone who wishes to become an application developer.
Software Consultant
A software consultant advises clients on technology solutions, often requiring a strong understanding of various software development practices and technologies. This course may be useful for a software consultant by offering insight into the process of building, deploying, and securing a backend service. The course covers backend technologies and common development patterns, providing a useful perspective for the role. This course may be helpful to a software consultant who needs to advise on backend systems with a variety of tech stacks. A software consultant may find this course useful to better advise their clients.
System Analyst
A system analyst is responsible for analyzing and documenting system requirements, as well as bridging the gap between business needs and technical implementation. This course may be helpful to a system analyst by providing an understanding of the technical aspects of a backend system. The course covers many technologies used in a modern backend system, and includes best practices for setting them up. A system analyst may find that this helps them create a more complete set of requirements documentation. This course may be helpful to anyone who wishes to become a system analyst.
Technical Project Manager
A technical project manager is responsible for planning and overseeing software development projects, requiring knowledge of development processes and technologies. This course may be useful to a technical project manager by providing hands-on experience with the technologies and steps required for a backend service. It exposes the learner to a real world development project workflow, assisting in the planning and execution of a similar project. A technical project manager may find that this will help them better understand the different phases of a software development project. This course may be useful to anyone seeking to become a technical project manager.
IT Manager
An IT manager oversees an organization's technology infrastructure, including software and hardware, while often needing a broad understanding of software development practices. This course may be useful to an IT manager by providing insights into the practical aspects of backend web development, including database management, API development, and deployment strategies. This course can help an IT manager understand the complexity and requirements for modern backend services. Someone who wishes to become an IT manager may find this course to be beneficial, as it covers many areas they may oversee.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Backend Master Class [Golang + Postgres + Kubernetes + gRPC].
Provides a comprehensive overview of the challenges and solutions involved in building scalable and reliable data systems. It covers topics such as data models, storage engines, distributed systems, and data consistency. It is highly recommended as additional reading to gain a deeper understanding of the underlying principles behind the technologies used in the course. This book is commonly used as a textbook at academic institutions and by industry professionals.
Provides a comprehensive guide to Kubernetes, covering everything from basic concepts to advanced deployment strategies. It is particularly useful for understanding how to deploy and manage applications in a production environment. It is highly recommended as additional reading to gain a deeper understanding of the underlying principles behind the technologies used in the course. This book is commonly used as a textbook at academic institutions and by industry professionals.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser