Why NetEase Media Adopted Go and Built the NGO Cloud‑Native Web Framework
Facing high memory usage and slow builds with Java SpringBoot, NetEase Media switched to Go in 2020, rebuilt core services, and created the cloud‑native ngo framework to deliver lighter containers, faster compilation, built‑in business libraries, tracing and monitoring, now running in production while hiring engineers.
At the end of 2020 NetEase Media began experimenting with the Go programming language for business development, and in 2021 it rebuilt its core services using Go. Today more than half of its services have been migrated to Go and are running in production.
Go, officially announced in November 2009, is a statically typed, compiled, concurrent language with garbage collection. Its key advantages include fast compilation, simple syntax, a development experience similar to dynamic languages, low resource consumption, design for concurrent I/O, good operability, compatibility with C/C++, and a comprehensive toolchain.
NetEase Media’s legacy Java services (built with SpringBoot) suffer from several issues:
High memory usage – typical containers consume 2 GB to 4 GB or more.
Slow compile and startup times due to Maven‑based build, image packaging, and transfer.
Large container images because the JVM alone requires several hundred megabytes.
To address these problems the team needed a Go web framework that provides common business libraries (Kafka, Redis, RPC, distributed locks, etc.), supports callback injection, offers a usable ORM, and delivers better HTTP server performance. Existing Go frameworks such as Beego did not meet these requirements, prompting the creation of the ngo framework.
The primary goals of the ngo framework are:
Deliver higher performance and lower resource usage than the previous Java frameworks.
Provide a comprehensive set of libraries required by business developers.
Embed cloud‑native monitoring with automatic data upload.
Support full‑link tracing via the OpenTracing protocol and integrate with Jaeger or Zipkin.
Automatically load configuration and initialize the runtime environment.
Align with health‑check and operational interfaces without additional developer effort.
Quick start
Clone the repository:
git clone https://github.com/NetEase-Media/ngo.gitEnter the quick‑start example directory:
cd ./ngo/examples/quickstartBelow is the main.go source for the HelloWorld service:
package main
import (
"context"
"github.com/NetEase-Media/ngo/adapter/log"
"github.com/NetEase-Media/ngo/adapter/protocol"
"github.com/NetEase-Media/ngo/server"
"github.com/gin-gonic/gin"
)
func main() {
s := server.Init()
s.PreStart = func() error {
log.Info("do pre‑start...")
return nil
}
s.PreStop = func(ctx context.Context) error {
log.Info("do pre‑stop...")
return nil
}
s.AddRoute(server.GET, "/hello", func(ctx *gin.Context) {
ctx.JSON(protocol.JsonBody("hello"))
})
s.Start()
}The corresponding app.yaml configuration is:
service:
appName: ngo-demo
clusterName: ngo-demo-localRun the service with:
go run . -c ./app.yamlThe service starts immediately. More examples can be found in the examples directory of the repository.
Repository URL: https://github.com/NetEase-Media/ngo
NetEase Media is actively recruiting cloud‑native engineers. Interested candidates can email [email protected] . Current openings include:
Service Mesh Engineer – design and implement the Service Mesh architecture, support discovery, governance, security, flow control, and telemetry, and build large‑scale centralized control.
Serverless Engineer – design and implement the Serverless platform, build Faas runtime, and integrate Envoy with Serverless.
Both positions require a bachelor’s degree or higher in Computer Science or related fields, strong Linux skills, proficiency in Go/C/C++, and solid knowledge of operating systems, data structures, and algorithms.
NetEase Media Technology Team
NetEase Media Technology Team
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.