
Break a monolith into Golang microservices using Aperture Kafka, with separate frontend-specific microservices and dedicated admin, ambassador, and checkout services plus a separate email service.
Set up the Golang microservices project by cloning repos, launching docker-compose, initiating the Go backend and React frontend, and populating the database to verify end-to-end functionality.
Configure stripe keys in a monolith by placing publishable keys in the frontend and secret keys in the backend, and set up mailhook to send admin and ambassador emails.
Explore the codebase to be broken into microservices, with docker support, a database, and Redis cache. See how go fiber, routes, controllers, and cookie-based JWT authentication tie the app together.
Compare monoliths and microservices, showing how a single app with search, product list, product recommendation, and contact form splits into services connected by an event bus, enabling scalable, language-diverse implementations.
Extract the email microservice from a monolith, which won’t have its own database, and show how it communicates with others via an event bus using Apache Kafka.
Create the email microservice by initializing a go module, defining the email model and main file, and preparing docker and compose files while removing Redis and setting up for Kafka.
Set up kafka with confluent cloud on Google cloud, create a Europe cluster named microservices, configure topics and credentials, and learn to publish and consume messages from the terminal.
Install and login to Confluent Cloud CLI, configure environment and cluster, set API keys, and use a topic to run producer and consumer exchanging messages.
Install the confluent kafka go client, configure a consumer with bootstrap servers and ssl credentials, subscribe to a topic, and validate by producing messages; then create a producer.
Configure a Kafka producer to send email-related messages to the email microservice, constructing a payload that includes ambassador revenue, code, ambassador, and email fields.
Test the email microservice by listening to events, extracting message data, and sending emails via docker; verify Kafka delivery and finalize the first microservice.
Create the users microservice with its own database, and enable communication via internal API requests, avoiding Kafka, as you tackle the most complex microservice to learn key patterns.
Set up the user microservice: scaffold project and model, install dependencies, configure Docker Compose, adjust database and ports, and run migrations to create the users table in Golang microservices.
Connect to both the ambassador database and the user microservice database, then import real users from the monolith by looping through ambassador users and creating them in the users database.
Organize the microservice by creating controllers and routes, set the api prefix and authenticated middleware, and implement a user registration route with ambassador field handling for inter-service communication.
Send an http post from the ambassador to the user microservice by preparing json data, including the ambassador field, posting to localhost:10001/api/register, and decoding the response into a user model.
Explore splitting a monolith by moving login logic to the user microservice, handling scope and JWT creation, and setting cookies via the ambassador gateway for cross-service authentication.
Learn how to propagate authentication across microservices by using middleware to verify jwt tokens and cookies, and fetch the authenticated user from the user service, while keeping ambassador fields out.
Refactor user requests into a dedicated user service to centralize endpoints, handle get and post requests, manage cookies and headers, and simplify repeated code across the monolith.
refactor the monolith by introducing a generic service struct with endpoint mapping, enabling multiple services like user and post, and implementing get and post helpers for clean, private request handling.
Implement secure logout by managing server-side jwt tokens with a user_token table, validating tokens in middleware, and removing tokens on logout to invalidate sessions.
Complete the auth controller by adding update and password endpoints to the user microservice, implement put and delete requests, and verify updates through login and user data changes.
Add a general endpoint in the user microservice to fetch all users and filter ambassadors by is_ ambassador, with access protected or public as needed.
Implement a public get user endpoint in the user microservice that fetches a single user by id and decodes the JSON response into a user model, integrating with order flow.
Streamline authenticated user handling by using middleware to fetch and store the user in fiber context, then access the user ID in controllers via the user service.
Explain how to enforce access control in the user microservice by handling scopes (ambassador vs admin) through middleware and payload scope, ensuring authenticated user retrieval and route-based authorization.
Remove the Go ambassador app by eliminating the user table, migrate users to the user microservice, and update rankings to populate ambassadors.
Leverage Docker networks to connect the user microservice with other services, using a dedicated external users network and explicit container names, enabling secure internal API calls and faster inter-service communication.
Create an external package to share code across Go microservices, host it on GitHub, importing into services. Build with docker compose and test the authenticated user endpoint using Postman.
Create the admin microservice with its own database, enable communication with Kafka and the user microservice, and route the admin frontend to the admin microservice only.
Set up the admin microservice, configuring docker compose and network admin, aligning the database admin_db, and scaffolding the Go fiber service with tailored models for the admin service.
Import data from the other microservice by executing the provided import commands, and preload orders, order items, and products with their links to populate the new microservices.
Move controllers to the admin microservice by adjusting API prefixes, data scopes, and removing or repurposing routes, then test endpoints with Postman and prepare for Kafka integration.
Configure Kafka in the admin microservice to publish product created, updated, and deleted events using a producer and consumer, with topics like admin_topic and email_topic.
Demonstrate splitting the architecture into ambassador and checkout microservices, giving each frontend its own service with a dedicated database and Kafka integration that interfaces with the users microservice.
Set up the ambassador microservice by scaffolding the project, initializing modules, configuring docker and network, installing dependencies, adjusting models, and implementing simple revenue calculations across services.
Learn to initialize the database with Docker Compose, troubleshoot port conflicts, and import data for products, ambassadors, and orders using scripted imports and calculated totals.
Refactor and wire microservice controllers and services for ambassadors, authentication, and revenue, adjust routes and rankings, test endpoints, and prepare for Kafka integration.
Configure Kafka for the ambassador microservice by creating the ambassador topic, setting up a producer, and handling link and product events to update the database and clear Redis cache.
Run the consumer.go to start listening for events and see started consuming. Add an ambassador queue service and rebuild.
Investigate and validate kafka-based event flows by testing producers and consumers, debugging nil references, and confirming event delivery across admin and ambassador services in a microservices setup.
Create a Kafka errors model to store consumer errors in the database, including the key, value, and the error, and update functions to return errors for production debugging.
Set up the checkout microservice by creating the project folder, initializing go modules, adding docker files, and wiring fiber, database migrations, and Kafka integration, with JSON error handling adjustments.
Set up and populate the database, import data, wire checkout and order routes, and configure the controllers to break the monolith into microservices, preparing for kafka integration.
Configure kafka for golang microservices by setting up topics and listeners, wiring producers and consumers across checkout, admin, and ambassador services, and propagating order and revenue events.
Test the frontend across microservices, validating port configurations and admin, ambassador, and checkout flows via Kafka events. Verify product creation, login, and checkout using Stripe in a connected frontend environment.
Deploy our app with Kubernetes on Google Cloud Platform to manage, automate deployments, and scale containers; install via Docker Desktop and prepare a Kubernetes directory for the next lecture.
learn to build a production go microservice by creating a production dockerfile and docker compose, removing dev tooling, building a binary, and naming the image for kubernetes with the username/project:tag format.
Learn how to deploy a Docker compose production setup to Kubernetes by creating a pod definition, explaining that a pod is the smallest unit, and understanding Kubernetes' self-healing behavior.
Configure docker compose and Kubernetes deployments with environment variables for Kafka bootstrap servers, credentials, and email settings. Test with mail trap and propagate host, port, username, and password to deployment.
Learn how to convert Docker Compose files to Kubernetes deployments with Kompose, adjust replicas from 1 to 3, and apply updated Kubernetes configurations to manage pods.
Create and manage Kubernetes secrets for Kafka and email credentials, using secret generic and from literal, to securely reuse values across microservices and prevent GitHub exposure.
Deploy a Golang email microservice on Google Kubernetes Engine by creating a Google Cloud project, enabling the Kubernetes Engine API, and spinning up an autopilot cluster in Europe.
Learn to deploy a yaml file in google cloud using cloud shell, configure project and cluster, edit kubernetes yaml, and address image issues before installing the google cloud sdk.
Install the Google Cloud SDK on macOS, authenticate with gcloud, set your project, and push your container image to Google Cloud Registry.
Push and deploy a docker image to Google container registry, building with docker compose, tagging for GCR, and pushing; address Kafka secrets and resource limits for email microservice on Kubernetes.
Copy the production Dockerfile and adapt docker-compose for Kubernetes, then create a Google Cloud SQL instance and configure host, port, and credentials.
Learn to authorize cloud database access by adding your IP to the connections in Google Cloud, fix DSN typos, create the users database, and bring up services with docker compose.
Convert docker compose to kubernetes by creating a users deployment and a service, map container port 8000 to exposed port 8001, and push the image to Google Cloud container registry.
Deploy the users microservice by building with docker compose, pushing images to Google Cloud Registry, and updating Kubernetes YAML with latest tags, then expose via ingress and test endpoints.
Configure a Kubernetes ingress to expose microservice APIs at a unified URL using api/users path to the users service on port 8001. Test the endpoint and diagnose database connection errors.
Resolve database connection by switching to a private IP, avoiding cloud proxy complexity, configuring the network and Kubernetes, updating the db host in YAML, and deploying a new users endpoint.
In this admin setup, configure production Dockerfiles, clone and tailor the admin database, set environment values including Kafka topics and user service endpoints, and prepare Kubernetes files.
Convert the composite product YAML to Kubernetes manifests, configure admin microservice deployments and services, set secrets and private IPs, then deploy the admin image to the cluster.
Deploy and push the admin microservice image to google cloud registry, set /api/admin endpoints on port 8002, and validate communication with the users service on port 8001.
configure the ambassador microservice by converting docker compose to a product yaml, provisioning the ambassador db, Redis, and Kafka topics, and generating Kubernetes manifests for deployment.
Move and refine Kubernetes files using docker compose, place them in ambassador and Redis folders, update bootstrap credentials, and prepare the ready deployment for Google Cloud.
Deploy a microservices ambassador on Google Cloud by building with Docker, pushing to Google Container Registry, updating YAML configs, validating readiness and endpoints with Postman.
Deploy the checkout microservice by provisioning and cloning the database, updating docker compose and environment values, and wiring products, orders, and kubernetes files for a complete checkout workflow.
Convert the checkout folder's docker compose to a single Kubernetes file, remove annotations and strategy notations, adjust the service and resources, then deploy checkout.
Deploy the checkout microservice by building and pushing images to Google Cloud Registry, update IPs and values, and apply ingress so all services share the same IP with different endpoints.
Welcome to Golang and Kafka: Breaking a Monolith to Microservices Course - the course that will take your Golang development skills to the next level.
Here are some interesting facts:
The average Golang developer salary in the US is $131,844
However:
The average salary for the Golang developers that know the Microservices Architecture in the US is $160,000
This means if you are a Golang developer you have the potential to increase your salary by up to 20% just by purchasing this course!
How this course works
This course will start with a pre-built monolith, the building of the starting app won't be covered in this course. So in this course, you will start immediately with Microservices Architecture, this course is intended for people that have a solid understanding of Golang and want to learn in a short amount of time more advanced concepts. I am very clear and precise in my way of teaching so this course won't have unnecessary explanations on my part, I will explain what is needed when it is needed.
If you are interested in learning how the Monolith is created you can check my other courses:
Angular Material, Universal & Golang: A Rapid Guide
React, Next.js and Golang: A Rapid Guide - Advanced
Vue 3, Nuxt.js and Golang: A Rapid Guide - Advanced
In those courses, you will learn how to build a SPA with your favorite frontend framework.
What you will learn in this course
In this course, you will start with a pre-built monolith and you will learn:
What is the Microservices Architecture
How to Configure Kafka with Golang
Internal Http Requests
How to make a Microservice only for Authentication Purposes
Run Docker with multiple networks
Produce Kafka Events to multiple topics
Create Custom Middlewares & Services
Import Data from multiple databases
About Me
I'm a FullStack Developer with 10+ years of experience. I'm obsessed with clean code and I try my best that my courses have the cleanest code possible.
My teaching style is very straightforward, I will not waste too much time explaining all the ways you can create something or other unnecessary information to increase the length of my lectures. If you want to learn things rapidly then this course is for you.
If you have any coding problems I will offer my support within 12 hours when you post the question. I'm very active when trying to help my students.
So what are you waiting for, give this course a try and you won't get disappointed.