Go Micro Services

HTTP up front, Protobufs in the rear
Alternatives To Go Micro Services
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Dubbo39,5825,4611739 hours ago59December 29, 20211,056apache-2.0Java
The java implementation of Apache Dubbo. An RPC and microservice framework.
Echo27,1832,8842 days ago173November 07, 202377mitGo
High performance, minimalist Go web framework
Kratos21,78732818 hours ago546October 23, 202379mitGo
Your ultimate Go microservices framework for the cloud-native era.
Chi15,9886642,5582 days ago82September 07, 202365mitGo
lightweight, idiomatic and composable router for building Go HTTP services
Falcon9,2931,5211882 days ago81December 05, 2023163apache-2.0Python
The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
Up8,73968162 months ago11March 02, 2018290mitGo
Deploy infinitely scalable serverless apps, apis, and sites in seconds to AWS.
Easegress5,582
15 hours ago38December 04, 202342apache-2.0Go
A Cloud Native traffic orchestration system
Imaginary5,166
9 days ago35October 17, 2021116mitGo
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
Dubbo Go4,586513 days ago160December 02, 2023135apache-2.0Go
Go Implementation For Apache Dubbo .
Armeria4,516101367 hours ago228November 17, 2023639apache-2.0Java
Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
Alternatives To Go Micro Services
Select To Compare


Alternative Project Comparisons
Readme

Golang Microservices Example

A demonstration of Golang micro-services that expose a HTTP/JSON frontend and then leverages gRPC for inter-service communication.

  • Services written in Golang
  • gRPC for inter-service communication
  • Jaeger for request tracing

The example application plots Hotel locations on a Google map:

screen shot 2016-11-07 at 9 31 12 pm

The web page makes an HTTP request to the API Endpoint which in turn spawns a number of RPC requests to the backend services.

Data for each of the services is stored in JSON flat files under the data/ directory. In reality each of the services could choose their own specialty datastore. The Geo service for example could use PostGis or any other database specializing in geospacial queries.

Installation

Setup

Docker is required for running the services https://docs.docker.com/engine/installation.

Protobuf v3 are required:

$ brew install protobuf

Install the protoc-gen libraries:

$ go get -u github.com/golang/protobuf/{proto,protoc-gen-go}

Clone the repository:

$ git clone [email protected]:harlow/go-micro-services.git

Run

To make the demo as straigforward as possible; Docker Compose is used to run all the services at once (In a production environment each of the services would be run (and scaled) independently).

$ make run

Vist the web page in a browser:

http://localhost:5000/

cURL the API endpoint and receive GeoJSON response:

$ curl "http://localhost:5000/hotels?inDate=2015-04-09&outDate=2015-04-10"

The JSON response:

{
	"type": "FeatureCollection",
	"features": [{
		"id": "5",
		"type": "Feature",
		"properties": {
			"name": "Phoenix Hotel",
			"phone_number": "(415) 776-1380"
		},
		"geometry": {
			"type": "Point",
			"coordinates": [-122.4181, 37.7831]
		}
	}, {
		"id": "3",
		"type": "Feature",
		"properties": {
			"name": "Hotel Zetta",
			"phone_number": "(415) 543-8555"
		},
		"geometry": {
			"type": "Point",
			"coordinates": [-122.4071, 37.7834]
		}
	}]
}

Request Tracing

The Jaeger Tracing project is used for tracing inter-service requests. The tracing package is used initialize a new service tracer:

tracer, err := tracing.Init("serviceName", jaegeraddr)
if err != nil {
    fmt.Fprintf(os.Stderr, "%v\n", err)
    os.Exit(1)
}
jaeger tracing example

View dashboard: http://localhost:16686/search

Protobufs

If changes are made to the Protocol Buffer files use the Makefile to regenerate:

$ make proto

Bindata

The example app data is stored in flat files in the /data directory. When any of the data files are manually editied the bindata must be regenerated.

Install the go-bindata libraries:

$ go get -u github.com/go-bindata/go-bindata/...

If changes are made to any of the raw JSON data files use the Makefile to regenerate:

$ make data

Credits

Thanks to all the contributors. This codebase was heavily inspired by the following talks and repositories:

Popular Http Projects
Popular Microservices Projects
Popular Networking Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Golang
Http
Microservices
Grpc
Protocol Buffers
Tracing
Consul