Sign inSign up

[Open Source] Shorten the Journey from Requirements to Deployment with a Web and RPC Framework Integrating Engineering Best Practices

Open SourceFrameworks & Low-Code
2026-06-28 08:13 6 views • 0 downloads 0KB
[Open Source] Shorten the Journey from Requirements to Deployment with a Web and RPC Framework Integrating Engineering Best Practices

1. Project Overview

go-zero (featured in the CNCF Cloud Native Landscape) is a web and RPC framework that integrates various engineering best practices. Its resilient design ensures the stability of highly concurrent server-side applications and has been thoroughly validated in real-world scenarios.

go-zero includes a minimalist API definition and code generation tool called goctl. Based on defined API files, it can generate Go, iOS, Android, Kotlin, Dart, TypeScript, and JavaScript code with a single command, ready to run directly.

Benefits of using go-zero:

  • Easily achieve the stability required to support services with tens of millions of daily active users
  • Built-in microservice governance capabilities, including cascading timeout control, rate limiting, adaptive circuit breaking, and adaptive load shedding, with no additional configuration or code required
  • Microservice governance middleware can be seamlessly integrated into other existing frameworks
  • Minimalist API definitions with one-click code generation for all platforms
  • Automatically validates the legality of client request parameters
  • A comprehensive collection of microservice governance and concurrency toolkits

2. Open Source License

Licensed under MIT

3. Screenshots

go-zero is a framework integrating various engineering best practices, including web and RPC frameworks. Its main features include:

  • Powerful tool support with as little code as possible
  • Minimalist interfaces
  • Fully compatible with net/http
  • Middleware support for easy extensibility
  • High Performance
  • Failure-oriented programming and resilient design
  • Built-in service discovery and load balancing
  • Built-in rate limiting, circuit breaking, and load shedding, with automatic triggering and recovery
  • Automatic API parameter validation
  • Cascading timeout control
  • Automatic cache management
  • Distributed tracing, statistics, alerts, and more
  • Supports high concurrency and reliably handles daily traffic peaks during the pandemic

As shown below, we ensure overall high availability across multiple layers:

5. Tech Stack

Basic architecture diagram of our go-zero implementation

Installation

Run the following command in the project directory to install:

GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/zeromicro/go-zero

Quick Start

For a complete example, please refer to the READMD.md documentation.

Environment Preparation

Before starting actual development, we need to complete some preparations, such as installing the Go environment, installing tools for gRPC code generation, installing the essential Goctl tool, and configuring the Golang environment. This section covers the following topics (see the READMD.md documentation for details):

  • Development Workflow
  • Golang Installation
  • go modudle Configuration
  • goctl Installation
  • protoc & protoc-gen-go Installation
  • Other Features

Development Workflow

  • goctl Environment Setup
  • Database Design
  • Business Development
  • Create a New Project
  • Create Service Directories
  • Create Service Types (api/rpc/rmq/job/script)
  • Write API and proto Files
  • Code Generation
  • Generate Database Access Layer Code (model)
  • Configure config and YAML Changes
  • Populate Resource Dependencies (ServiceContext)
  • Add Middleware
  • Implement Business Logic
  • Error Handling


Development Tools

  • Visual Studio Code
  • Goland (Recommended)

#1
资源直链https://github.com/zeromicro/go-zero/archive/refs/heads/master.zip
Download