Skip to content

01‐ Intro

Rabieh Fashwall edited this page Jan 21, 2025 · 5 revisions

This workshop will guide you through the process of building a robust and scalable microservices-based application using Go. We'll cover essential concepts, patterns, and tools to design, implement, and deploy interconnected services.

Workshop Overview

Throughout this workshop, we'll be building a simple User and Task Management system. This system will be decomposed into independent micro-services, each responsible for a specific domain or functionality.

Learning Objectives

By the end of this workshop, you'll be able to:

  • Understand the core principles of micro-service architecture.
  • Design and implement Go micro-services using the Fiber framework.
  • Set up communication between micro-services using HTTP and the NATS messaging system.
  • Persist data using a MySQL database.
  • Implement the Command Query Responsibility Segregation (CQRS) pattern for better data handling.
  • Use Docker Compose to define and run multi-container applications.
  • Gain insights into testing, monitoring, and other crucial aspects of micro-service development.

Technologies

We'll be using a modern technology stack that is well-suited for micro-service development:

  • Go (Golang): A fast, concurrent, and efficient programming language ideal for building micro-services.
  • Fiber: A lightweight and high-performance web framework for Go, perfect for creating RESTful APIs (https://gofiber.io/).
  • MySQL: A popular open-source relational database for data persistence.
  • NATS: A simple and performant messaging system for asynchronous communication between services (https://nats.io/).
  • Docker Compose: A tool for defining and managing multi-container Docker applications.

Project Structure

Our project will be divided into multiple services, each representing a distinct part of our system:

  1. User Service:

    • Responsible for managing user data (creation, retrieval, updates, deletion).
    • Will be implemented using the CQRS pattern, separating commands (data modification) from queries (data retrieval).
  2. Task Service:

    • Handles task-related operations (creating tasks, assigning tasks to users, updating task status, etc.).
    • Will communicate with the User Service to retrieve user information when needed.
  3. Notification Service (Optional):

    • A potential addition for handling asynchronous notifications to users, such as email or real-time updates.

Workshop Branches

To help you learn progressively, the workshop is divided into branches. Each branch builds upon the previous one, introducing new concepts and features:

Getting Started

1. Install Go

  1. Download Go: Visit the official Go download page and download the installer for your operating system.
  2. Install Go: Follow the installation instructions for your OS.
  3. Verify Installation: Open a terminal and run go version to verify the installation.

2. Install Docker

  1. Download Docker: Visit the Docker website and download Docker Desktop for your OS.
  2. Install Docker: Follow the installation instructions provided by Docker.
  3. Verify Installation: Run docker --version in your terminal to ensure Docker is installed correctly.

3. Install git

  1. Download Git: Git Page
  2. Install Git: Follow the installation instructions provided by Git.

go-task-400

  1. Clone the Repository:
    • git clone https://github.com/rfashwall/go-task.git
  2. Navigate to the First Branch:
    • git checkout 01-create-our-first-micro-service 

Now we're ready to begin the workshop! Let's start by building our first micro-service.

Clone this wiki locally