Go Micro Logo Go Micro

Framework Comparison

How Go Micro compares to other Go microservices frameworks.

Quick Comparison

Feature Go Micro go-kit gRPC Dapr
Learning Curve Low High Medium Medium
Boilerplate Low High Medium Low
Plugin System Built-in External Limited Sidecar
Service Discovery Yes (mDNS, Consul, etc) No (BYO) No Yes
Load Balancing Client-side No No Sidecar
Pub/Sub Yes No No Yes
Transport HTTP, gRPC, NATS BYO gRPC only HTTP, gRPC
Zero-config Dev Yes (mDNS) No No No (needs sidecar)
Production Ready Yes Yes Yes Yes
Language Go only Go only Multi-language Multi-language

vs go-kit

go-kit Philosophy

Go Micro Philosophy

When to Choose go-kit

When to Choose Go Micro

Code Comparison

go-kit (requires more setup):

// Define service interface
type MyService interface {
    DoThing(ctx context.Context, input string) (string, error)
}

// Implement service
type myService struct{}

func (s *myService) DoThing(ctx context.Context, input string) (string, error) {
    return "result", nil
}

// Create endpoints
func makeDo ThingEndpoint(svc MyService) endpoint.Endpoint {
    return func(ctx context.Context, request interface{}) (interface{}, error) {
        req := request.(doThingRequest)
        result, err := svc.DoThing(ctx, req.Input)
        if err != nil {
            return doThingResponse{Err: err}, nil
        }
        return doThingResponse{Result: result}, nil
    }
}

// Create transport (HTTP, gRPC, etc)
// ... more boilerplate ...

Go Micro (simpler):

type MyService struct{}

type Request struct {
    Input string `json:"input"`
}

type Response struct {
    Result string `json:"result"`
}

func (s *MyService) DoThing(ctx context.Context, req *Request, rsp *Response) error {
    rsp.Result = "result"
    return nil
}

func main() {
    svc := micro.NewService(micro.Name("myservice"))
    svc.Init()
    svc.Handle(new(MyService))
    svc.Run()
}

vs gRPC

gRPC Focus

Go Micro Scope

When to Choose gRPC

When to Choose Go Micro

Integration

You can use gRPC with Go Micro:

import "go-micro.dev/v5/client/grpc"

svc := micro.NewService(
    micro.Client(grpc.NewClient()),
)

vs Dapr

Dapr Approach

Go Micro Approach

When to Choose Dapr

When to Choose Go Micro

Feature Deep Dive

Service Discovery

Go Micro: Built-in with plugins

// Zero-config for dev
svc := micro.NewService(micro.Name("myservice"))

// Consul for production
reg := consul.NewRegistry()
svc := micro.NewService(micro.Registry(reg))

go-kit: Bring your own

// You implement service discovery
// Can be 100+ lines of code

gRPC: No built-in discovery

// Use external solution like Consul
// or service mesh like Istio

Load Balancing

Go Micro: Client-side, pluggable strategies

// Built-in: random, round-robin
selector := selector.NewSelector(
    selector.SetStrategy(selector.RoundRobin),
)

go-kit: Manual implementation

// You implement load balancing
// Using loadbalancer package

gRPC: Via external load balancer

# Use external LB like Envoy, nginx

Pub/Sub

Go Micro: First-class

broker.Publish("topic", &broker.Message{Body: []byte("data")})
broker.Subscribe("topic", handler)

go-kit: Not provided

// Use external message broker directly
// NATS, Kafka, etc

gRPC: Streaming only

// Use bidirectional streams
// Not traditional pub/sub

Migration Paths

See specific migration guides:

Coming Soon:

Decision Matrix

Choose Go Micro if:

Choose go-kit if:

Choose gRPC if:

Choose Dapr if:

Performance

Rough benchmarks (requests/sec, single instance):

Framework Simple RPC With Discovery With Tracing
Go Micro ~20k ~18k ~15k
gRPC ~25k N/A ~20k
go-kit ~22k N/A ~18k
HTTP std ~30k N/A N/A

Benchmarks are approximate and vary by configuration

Community & Ecosystem

Recommendation

Start with Go Micro if you’re building Go microservices and want to move fast. You can always:

The pluggable architecture means you’re not locked in.


← Previous
Next →