XUtils

go-zero

A web and rpc framework. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity.


🤷‍ What is go-zero?

English | 简体中文

zeromicro%2Fgo-zero | Trendshift go-zero - A web & rpc framework written in Go. | Product Hunt

go-zero (listed in CNCF Landscape: https://landscape.cncf.io/?selected=go-zero) is a web and rpc framework with lots of builtin engineering practices. It’s born to ensure the stability of the busy services with resilience design and has been serving sites with tens of millions of users for years.

go-zero contains simple API description syntax and code generation tool called goctl. You can generate Go, iOS, Android, Kotlin, Dart, TypeScript, JavaScript from .api files with goctl.

Advantages of go-zero:

  • Improves the stability of the services with tens of millions of daily active users
  • Builtin chained timeout control, concurrency control, rate limit, adaptive circuit breaker, adaptive load shedding, even no configuration needed
  • Builtin middlewares also can be integrated into your frameworks
  • Simple API syntax, one command to generate a couple of different languages
  • Auto validate the request parameters from clients
  • Plenty of builtin microservice management and concurrent toolkits

Architecture

Backgrounds of go-zero

At the beginning of 2018, we decided to re-design our system, from monolithic architecture with Java+MongoDB to microservice architecture. After research and comparison, we chose to: In early 2018, we embarked on a transformative journey to redesign our system, transitioning from a monolithic architecture built with Java and MongoDB to a microservices architecture. After careful research and comparison, we made a deliberate choice to:

  • Go Beyond with Golang

    • Great performance
    • Simple syntax
    • Proven engineering efficiency
    • Extreme deployment experience
    • Less server resource consumption
  • Self-Design Our Microservice Architecture

    • Microservice architecture facilitates the creation of scalable, flexible, and maintainable software systems with independent, reusable components.
    • Easy to locate the problems within microservices.
    • Easy to extend the features by adding or modifying specific microservices without impacting the entire system.

Design considerations on go-zero

By designing the microservice architecture, we expected to ensure stability, as well as productivity. And from just the beginning, we have the following design principles:

  • Keep it simple
  • High availability
  • Stable on high concurrency
  • Easy to extend
  • Resilience design, failure-oriented programming
  • Try best to be friendly to the business logic development, encapsulate the complexity
  • One thing, one way

After almost half a year, we finished the transfer from a monolithic system to microservice system and deployed on August 2018. The new system guaranteed business growth and system stability.

The simplified architecture that we use with go-zero

image

Benchmark

benchmark

Checkout the test code

Documents

Chat group

Join the chat via https://discord.gg/4JQvC5A4Fe

Cloud Native Landscape

   

go-zero enlisted in the CNCF Cloud Native Landscape.

Give a Star! ⭐

If you like or are using this project to learn or start your solution, please give it a star. Thanks!

Buy me a coffee

Buy Me A Coffee


Articles

  • coming soon...