Learning By Doing Golang - ToDo App - 01
🛠️ Requirement and Design Gathering

Search for a command to run...
🛠️ Requirement and Design Gathering

No comments yet. Be the first to comment.
"Learning by Doing with Golang" is a practical blog series focused on building real-world apps with Go. Each post breaks down components, libraries, design choices, and implementation details to help understand how and why things work in Go.
Working with Database
Learn the difference between an AI's context window and attention horizon, why models get lost in the middle, and how to optimize your prompts.

Understanding Tokens, BPE, and LLM Costs

A beginner friendly guide to understanding GatewayClass, Gateways, and HTTPRoute with a hands on Cilium lab.

A deep dive into Path-Based vs. Host-Based routing, the difference between Ingress resources and controllers, and how to optimize your K8s cluster networking.

Exploring Methods to Expose Your Kubernetes application to the public internet Safely, Securely and Efficiently

Let’s kick off our Learning by Doing with Golang series by building a simple ToDo application. This app will serve as our first hands-on project to understand the fundamentals of Go by applying them in a real-world context.
Before jumping into this project, we expect you to have a basic understanding of Golang, including:
Basic syntax and structure
Variables and data types
Arithmetic and logical operators
Conditional statements (if, switch)
Loops (for)
Functions and how to define/use them
If you're just starting out with Go and haven't covered these fundamentals yet, we recommend learning them first. You can find great beginner-friendly resources here , and once you're comfortable, come back and join us on this hands-on journey.
Note: We’re intentionally keeping this app simple to focus on learning. As we progress, you might notice some discrepancies or missing best practices—that’s by design. We’ll note these issues along the way and revisit them after we've developed a deeper understanding of Go. For now, the goal is to get started without getting overwhelmed.
We’re developing a basic ToDo list application that allows users to manage their tasks efficiently. The app will support the standard set of CRUD operations—Create, Read, Update, and Delete ToDos.
A ToDo app is a simple task management application that helps users keep track of things they need to do.
🔗 Note: We are not building a frontend or UI for this app. All interactions will happen through RESTful APIs. This will help us focus purely on backend development using Golang, and better understand how to build, structure, and manage APIs effectively
Before diving into the implementation, let’s understand the design requirements of our ToDo application and the reasoning behind each decision.
A place to store ToDo data
A Way to Access the content Database
A Way for Users to Interact with the App
Let’s see how we are planning that
The first thing our app needs is a place to store the ToDo items. For this, we’ll use a database, as it's the most common and reliable way to store structured data in applications. Specifically, we’ll use a MySQL database
There are two main types of databases:
SQL (Structured Query Language) – stores data in a tabular format
NoSQL (Not only SQL) – stores data in document or key-value format
We're choosing SQL (MySQL) for the following reasons:
It’s faster and more efficient for structured data.
Our data is simple and relational (each ToDo has fields like title, description, status).
We don’t require the flexibility of a document-based (NoSQL) structure for this use case.
It fits the purpose of a basic CRUD app with limited and predictable data.
To interact with our database and access the stored data, we need a way to connect to the database and execute SQL queries.
We’ll use one of Go’s standard libraries together with a MySQL driver. This setup allows us to:
Open and manage database connections
Execute SQL commands (INSERT, SELECT, UPDATE, DELETE)
Handle errors and manage resources efficiently
We'll explore the exact setup and usage of these libraries in the later section.
Now, as an end-user, how do we interact with our application?
We’ll expose a set of HTTP endpoints that clients (like browsers, Postman, or frontend apps) can call using URLs.
For example:
GET https://<your-app>/todos → Get all ToDos
POST https://<your-app>/todos → Create a new ToDo
GET https://<your-app>/todos/{id} → Get a specific ToDo
PUT https://<your-app>/todos/{id} → Update a ToDo
DELETE https://<your-app>/todos/{id} → Delete a ToDo
These endpoints will act as entry points to different operations within our app. Internally, each endpoint will trigger logic that interacts with the database and returns appropriate responses.
Now, we have a high-level understanding of what we need to build our ToDo app—and more importantly, why we need each component.
Don’t worry if everything doesn’t fully click yet. As we build more apps and go deeper into each concept, things will start to make sense. The key is to keep going.
In the next article, we’ll focus entirely on the Database Layer of our application. Here's what we’ll cover:
How to set up a MySQL database locally
How to connect to the database using Golang
Different approaches to database interaction in Go—and why we’re choosing a specific one
Step-by-step guide to implement the database layer in our ToDo app
We’ll apply everything we learn directly into our project, laying a strong foundation for how our app stores and retrieves data.