rpcx
Best microservices framework in Go, like alibaba Dubbo, but with more features, Scale easily. Try it. Test it. If you feel it's better, use it! 𝐉𝐚𝐯𝐚有𝐝𝐮𝐛𝐛𝐨, 𝐆𝐨𝐥𝐚𝐧𝐠有𝐫𝐩𝐜𝐱! build for cloud!
A fast Go framework for building microservices using remote procedure calls, with built-in service discovery, load balancing, and support for multiple transports and message formats.
rpcx is a framework for building microservices in Go. Microservices are an approach to software architecture where a large application is split into many small, independent programs that communicate with each other over a network. rpcx provides the plumbing to make that communication fast and reliable, handling how services find each other, how they send and receive data, and what happens when something goes wrong.
The framework is built around the concept of remote procedure calls, which let code in one service call a function in another service almost as if it were a local call. With rpcx, you write ordinary Go functions and the framework takes care of the network layer. You do not need to define special interface description files as some other RPC systems require.
On the transport side, rpcx supports TCP, HTTP, QUIC, and KCP connections, and can encode messages in JSON, Protobuf, MessagePack, or raw bytes. This flexibility means clients in other languages, such as Java, Python, or Node.js, can call services written in Go. A gateway component lets any language that can make HTTP requests reach rpcx services as well.
For service discovery, which is the problem of how services find the addresses of other services at runtime, rpcx supports several well-known coordination systems including etcd, Zookeeper, and Consul, as well as simpler peer-to-peer and local multicast approaches. Load balancing across multiple instances of a service can be configured with strategies like round-robin, random, consistent hashing, weighted distribution, or proximity.
Additional features include circuit breakers for handling failing services, authorization, heartbeat monitoring, bidirectional communication, metrics, and an optional web-based management UI. The project is released under the Apache 2.0 license.
Where it fits
- Build a set of Go microservices that can call each other's functions over the network as if they were local.
- Connect services written in different languages (Java, Python, Node.js) to a Go backend using the HTTP gateway.
- Set up automatic load balancing across multiple instances of a service using round-robin or consistent hashing.
- Add circuit breakers so your app degrades gracefully when one microservice starts failing.