# geektutu/7days-golang

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/geektutu-7days-golang).**

16,812 stars · 2,593 forks · Go · mit

## Links

- GitHub: https://github.com/geektutu/7days-golang
- Homepage: https://geektutu.com/post/gee.html
- awesome-repositories: https://awesome-repositories.com/repository/geektutu-7days-golang.md

## Topics

`golang` `learning` `scratch` `starter-project`

## Description

This project is an educational framework designed to teach the fundamentals of building core distributed systems and web services from scratch in Go. It provides a collection of modular implementations that demonstrate how to construct essential infrastructure components, including web servers, remote procedure call systems, distributed caches, and database abstraction layers.

The framework distinguishes itself by focusing on the internal mechanics of these systems rather than providing a high-level abstraction for production use. It covers the implementation of complex architectural patterns such as consistent hashing for data distribution, least-recently-used cache eviction, and reflection-based service registration. By building these components manually, the project illustrates how to handle network connectivity, protocol negotiation, and service discovery in a distributed environment.

Beyond core networking and storage, the repository includes implementations for machine learning primitives, such as neural network architectures and training loops, as well as tools for database interaction and object-relational mapping. It also incorporates various utility layers for logging, performance benchmarking, and concurrency management to provide a comprehensive view of system-level programming.

The repository is structured as a series of guided modules, allowing developers to explore the implementation details of each system component through hands-on construction and testing.

## Tags

### Data & Databases

- [Distributed Caching](https://awesome-repositories.com/f/data-databases/distributed-caching.md) — The framework implements networked caching systems using LRU eviction, consistent hashing, and protocol-based communication to prevent data access bottlenecks. ([source](https://cdn.jsdelivr.net/gh/geektutu/7days-golang@master/README.md))
- [Database ORMs](https://awesome-repositories.com/f/data-databases/database-orms.md) — Maps database records to application objects and manages schemas.
- [Least Recently Used Caches](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/caching-performance/caching/least-recently-used-caches.md) — Implements least-recently-used cache eviction to maintain memory limits by discarding old items.
- [Data Insertion Interfaces](https://awesome-repositories.com/f/data-databases/data-insertion-interfaces.md) — The framework maps object fields to database columns and executes batch insertion commands to persist data into the underlying storage. ([source](https://geektutu.com/post/geeorm-day3.html))
- [Database Abstraction Layers](https://awesome-repositories.com/f/data-databases/database-abstraction-layers.md) — Provides a unified API for interacting with multiple database engines and dialects.
- [Database Migrations](https://awesome-repositories.com/f/data-databases/database-migrations.md) — The framework updates existing database tables to match current model definitions by adding new columns or recreating tables while preserving data. ([source](https://geektutu.com/post/geeorm-day7.html))
- [Database Query Execution](https://awesome-repositories.com/f/data-databases/database-query-execution.md) — The framework retrieves database rows and automatically maps the result set into a slice of objects using reflection to populate fields. ([source](https://geektutu.com/post/geeorm-day3.html))
- [Object Mappings](https://awesome-repositories.com/f/data-databases/table-definitions/object-mappings.md) — The framework parses structure definitions and metadata tags into database table schemas, including column names, types, and constraints. ([source](https://geektutu.com/post/geeorm-day2.html))
- [Record Updates](https://awesome-repositories.com/f/data-databases/database-record-management/record-updates.md) — The framework updates existing rows in a database table by accepting either a map or a list of key-value pairs to define the new data. ([source](https://geektutu.com/post/geeorm-day4.html))
- [Record Deletion](https://awesome-repositories.com/f/data-databases/record-deletion.md) — The framework deletes rows from a database table based on previously defined filtering criteria. ([source](https://geektutu.com/post/geeorm-day4.html))
- [Binary Serialization Formats](https://awesome-repositories.com/f/data-databases/binary-serialization-formats.md) — Encodes and decodes structured data using binary formats for efficient network transmission between distributed nodes. ([source](https://geektutu.com/post/geecache-day7.html))
- [Data Serialization Frameworks](https://awesome-repositories.com/f/data-databases/data-serialization-frameworks.md) — Supports pluggable serialization logic to enable diverse data encoding formats for service communication. ([source](https://geektutu.com/post/geerpc-day1.html))
- [Atomic Transactions](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/connection-transaction-management/atomic-transactions.md) — The framework groups multiple database operations into a single unit of work that automatically commits on success or rolls back if any error occurs. ([source](https://geektutu.com/post/geeorm-day6.html))
- [Database Query Interfaces](https://awesome-repositories.com/f/data-databases/database-query-interfaces.md) — Provides a unified session-based query interface for mapping object structures to database tables.
- [SQL Query Builders](https://awesome-repositories.com/f/data-databases/sql-query-builders.md) — The framework enables sequential method calls to build complex SQL queries by returning the session object after each configuration step. ([source](https://geektutu.com/post/geeorm-day4.html))
- [SQL Query Interfaces](https://awesome-repositories.com/f/data-databases/sql-query-interfaces.md) — Assembles complex database queries by chaining individual clauses into a single executable command. ([source](https://geektutu.com/post/geeorm-day3.html))
- [Database Interaction Layers](https://awesome-repositories.com/f/data-databases/database-interaction-layers.md) — The framework provides a reusable interface for constructing raw SQL queries, executing database operations, and automatically clearing state after each interaction. ([source](https://geektutu.com/post/geeorm-day1.html))
- [Database Connections](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/database-systems/database-connections.md) — The framework establishes and validates connectivity to a database engine and provides a factory method for creating isolated interaction sessions. ([source](https://geektutu.com/post/geeorm-day1.html))
- [Table Definitions](https://awesome-repositories.com/f/data-databases/table-definitions.md) — The framework executes commands to create, drop, or verify the existence of database tables based on mapped object structures. ([source](https://geektutu.com/post/geeorm-day2.html))

### Software Engineering & Architecture

- [Educational Frameworks](https://awesome-repositories.com/f/software-engineering-architecture/open-source-projects/educational-frameworks.md) — Provides structured learning paths and pedagogical resources for technical subjects.
- [Consistent Hashing](https://awesome-repositories.com/f/software-engineering-architecture/distributed-systems/distributed-data-management/consistent-hashing.md) — Uses consistent hashing with a circular address space to ensure balanced data distribution and minimal remapping.
- [Distributed Data Management](https://awesome-repositories.com/f/software-engineering-architecture/distributed-systems/distributed-data-management.md) — The framework uses consistent hashing to map keys to specific network nodes, ensuring data is partitioned and retrieved from the correct peer in a cluster. ([source](https://geektutu.com/post/geecache-day5.html))
- [Distributed Key-Value Stores](https://awesome-repositories.com/f/software-engineering-architecture/distributed-systems/distributed-data-management/distributed-key-value-stores.md) — The framework maps input keys to specific nodes using consistent hashing with virtual nodes to ensure balanced distribution and minimal remapping. ([source](https://geektutu.com/post/geecache-day4.html))
- [Service Registration Engines](https://awesome-repositories.com/f/software-engineering-architecture/reflection-engines/service-registration-engines.md) — Exposes internal methods as remote procedures by dynamically inspecting function signatures and mapping them to network endpoints.
- [Error Handling Patterns](https://awesome-repositories.com/f/software-engineering-architecture/error-handling-patterns.md) — The framework uses a result-based mechanism to handle recoverable errors explicitly, providing operators to propagate errors or trigger controlled panics for unrecoverable failures. ([source](https://geektutu.com/post/quick-rust.html))
- [API Route Groups](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/api-design-management/api-patterns/api-route-groups.md) — Organizes related API endpoints under common URL prefixes and supports nested structures to apply shared configurations. ([source](https://geektutu.com/post/gee-day4.html))
- [Asynchronous Request Handlers](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-execution-managers/asynchronous-concurrency-managers/asynchronous-request-handlers.md) — The framework handles multiple simultaneous requests from clients using asynchronous processing to maintain high throughput and responsiveness during network communication. ([source](https://geektutu.com/post/geerpc.html))

### Networking & Communication

- [Remote Procedure Call Frameworks](https://awesome-repositories.com/f/networking-communication/remote-procedure-call-frameworks.md) — Provides a comprehensive framework for registering services and managing distributed communication between independent software components. ([source](https://cdn.jsdelivr.net/gh/geektutu/7days-golang@master/README.md))
- [Middleware-Based Request Pipelines](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/request-processing/middleware-based-request-pipelines.md) — Processes incoming network traffic through a chain of modular handlers for logging, recovery, and transformation.
- [Remote Procedure Call Frameworks](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/remote-procedure-call-frameworks.md) — Facilitates remote execution of functions and inter-process communication across distributed system components.
- [Load Balancers](https://awesome-repositories.com/f/networking-communication/load-balancers.md) — The framework distributes incoming requests across multiple service instances to optimize resource utilization and improve overall system availability. ([source](https://geektutu.com/post/geerpc.html))
- [Remote Procedure Calls](https://awesome-repositories.com/f/networking-communication/remote-procedure-calls.md) — Implements remote procedure calls over standard HTTP transport to ensure compatibility with existing network infrastructure. ([source](https://geektutu.com/post/geerpc.html))
- [Remote Procedure Execution](https://awesome-repositories.com/f/networking-communication/remote-procedure-execution.md) — Executes remote functions by dynamically deserializing arguments and serializing responses across network boundaries. ([source](https://geektutu.com/post/geerpc-day3.html))
- [Connection Management](https://awesome-repositories.com/f/networking-communication/connection-management.md) — Manages persistent network connections and protocol negotiation for reliable communication between clients and servers. ([source](https://geektutu.com/post/geerpc-day2.html))
- [Connection Multiplexing](https://awesome-repositories.com/f/networking-communication/connection-multiplexing.md) — Handles multiple concurrent requests over a single network connection by multiplexing call states and responses.
- [Service Discovery](https://awesome-repositories.com/f/networking-communication/service-discovery.md) — The framework maintains a dynamic list of available server addresses and provides interfaces to update or retrieve them for client-side routing. ([source](https://geektutu.com/post/geerpc-day6.html))
- [Connection Establishment Protocols](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/communication-protocols-standards/network-protocols/connection-establishment-protocols.md) — Exchanges protocol metadata at the start of a connection to establish shared settings like serialization types. ([source](https://geektutu.com/post/geerpc-day1.html))
- [Concurrent Request Racers](https://awesome-repositories.com/f/networking-communication/http-request-utilities/concurrent-request-racers.md) — The framework sends a single request concurrently to all registered server instances and returns the result from the first successful response. ([source](https://geektutu.com/post/geerpc-day6.html))
- [Load Balancing](https://awesome-repositories.com/f/networking-communication/load-balancing.md) — The framework distributes incoming requests across multiple server instances using strategies like random selection or round-robin to optimize system throughput. ([source](https://geektutu.com/post/geerpc-day6.html))

### Web Development

- [Web Server Frameworks](https://awesome-repositories.com/f/web-development/web-server-frameworks.md) — Provides foundational libraries for building and launching web servers. ([source](https://cdn.jsdelivr.net/gh/geektutu/7days-golang@master/README.md))
- [Multiplexed Request Handlers](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/routing-request-handling/multiplexed-request-handlers.md) — The framework supports multiple simultaneous requests over a single connection by tracking individual call states and multiplexing responses back to the correct caller. ([source](https://geektutu.com/post/geerpc-day1.html))
- [Middleware](https://awesome-repositories.com/f/web-development/middleware.md) — Provides modular middleware components for intercepting and processing network requests within the framework. ([source](https://geektutu.com/post/quick-go-gin.html))
- [HTTP Servers](https://awesome-repositories.com/f/web-development/http-servers.md) — Wraps standard network listeners to initialize and run a web service that dispatches incoming requests. ([source](https://geektutu.com/post/gee-day1.html))
- [Request Context](https://awesome-repositories.com/f/web-development/request-context.md) — Wraps network requests in a unified context object to propagate cancellation signals and deadlines across processing layers.
- [HTTP Routing](https://awesome-repositories.com/f/web-development/routing-systems/http-routing.md) — Maps incoming request methods and paths to specific handler functions and returns standard error responses. ([source](https://geektutu.com/post/gee-day2.html))
- [HTTP RPC Transports](https://awesome-repositories.com/f/web-development/http-rpc-transports.md) — Enables RPC traffic to coexist with standard web services by using HTTP CONNECT requests for transport. ([source](https://geektutu.com/post/geerpc-day5.html))
- [Route Grouping](https://awesome-repositories.com/f/web-development/routing-systems/routing/route-definition-strategies/route-grouping.md) — Organizes routes with shared URL prefixes or common middleware to simplify path management and enforce access control. ([source](https://geektutu.com/post/quick-go-gin.html))
- [HTTP Response Builders](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-utilities/http-response-builders.md) — Formats and sends structured data like JSON or HTML back to clients by setting appropriate headers and status codes. ([source](https://geektutu.com/post/gee-day2.html))
- [HTTP Request Handlers](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/routing-request-handling/http-request-handlers.md) — Routes incoming network traffic through a centralized handler to enable global request processing and logging. ([source](https://geektutu.com/post/gee-day1.html))
- [Middleware Chains](https://awesome-repositories.com/f/web-development/middleware-chains.md) — Implements middleware chains for processing request and response pipelines. ([source](https://geektutu.com/post/gee-day5.html))
- [Request Context Management](https://awesome-repositories.com/f/web-development/request-context-management.md) — Wraps raw HTTP request and response objects into a unified structure that persists throughout the request lifecycle. ([source](https://geektutu.com/post/gee-day2.html))
- [Route Parameter Captures](https://awesome-repositories.com/f/web-development/routing-systems/routing/parameter-handling-utilities/route-parameter-captures.md) — Supports route patterns with placeholders and wildcards to capture variable path segments during request routing. ([source](https://geektutu.com/post/gee-day3.html))

### DevOps & Infrastructure

- [Service Discovery](https://awesome-repositories.com/f/devops-infrastructure/service-discovery.md) — Provides a central registry for dynamic service discovery, allowing clients to locate and connect to healthy nodes. ([source](https://geektutu.com/post/geerpc.html))
- [Service Registries](https://awesome-repositories.com/f/devops-infrastructure/service-registries.md) — Maintains a central registry of server addresses and automatically removes inactive instances based on heartbeat timeouts. ([source](https://geektutu.com/post/geerpc-day7.html))

### System Administration & Monitoring

- [Request Timeouts](https://awesome-repositories.com/f/system-administration-monitoring/request-timeouts.md) — The framework monitors the execution time of individual service requests on the server and sends an error response if processing exceeds the configured limit. ([source](https://geektutu.com/post/geerpc-day4.html))
- [Service Maintenance](https://awesome-repositories.com/f/system-administration-monitoring/service-maintenance.md) — Maintains service availability by sending periodic heartbeat signals to a registry to confirm active status. ([source](https://geektutu.com/post/geerpc-day7.html))

### Artificial Intelligence & ML

- [Neural Network Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-frameworks.md) — Constructs computational graphs using weights, biases, and activation functions to map input features to categorical predictions. ([source](https://geektutu.com/post/tensorflow-mnist-simplest.html))
- [Custom Neural Network Layers](https://awesome-repositories.com/f/artificial-intelligence-ml/custom-neural-network-layers.md) — Implements specialized neural network layers and mathematical operations to extend standard model capabilities. ([source](https://geektutu.com/post/tf2doc.html))
- [Gradient Computation](https://awesome-repositories.com/f/artificial-intelligence-ml/gradient-computation.md) — Calculates function gradients automatically to support custom optimization and backpropagation during neural network training. ([source](https://geektutu.com/post/tf2doc.html))
- [Machine Learning Implementations](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning-implementations.md) — Provides code-based reference examples and implementations of core machine learning algorithms.
- [Machine Learning Training](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/machine-learning-training.md) — Provides frameworks and utilities used to train, fine-tune, and align machine learning models. ([source](https://geektutu.com/post/tensorflow-mnist-simplest.html))

### Testing & Quality Assurance

- [Unit Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/unit-testing-frameworks.md) — Ships a built-in testing framework for executing unit and integration tests. ([source](https://geektutu.com/post/quick-rust.html))
- [Unit Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/unit-testing.md) — Executes test suites against code packages to verify logic correctness. ([source](https://geektutu.com/post/quick-golang.html))

### Programming Languages & Runtimes

- [Interface Contract Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/interface-contract-implementations.md) — Defines method signatures that types must satisfy to enable polymorphic behavior. ([source](https://geektutu.com/post/quick-golang.html))
- [Mutual Exclusion Locks](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/synchronization-primitives/mutual-exclusion-locks.md) — Enforces exclusive access to shared resources by blocking other processes until the current holder releases the lock. ([source](https://geektutu.com/post/geecache-day2.html))

### User Interface & Experience

- [HTML Template Renderers](https://awesome-repositories.com/f/user-interface-experience/layout-utilities/presentation-engines/template-engines/server-side-rendering-engines/html-template-renderers.md) — The framework loads and parses HTML templates from the filesystem to dynamically generate web pages using provided data and custom helper functions. ([source](https://geektutu.com/post/gee-day6.html))
