All Projects → harlow → Go Micro Services

harlow / Go Micro Services

Licence: mit
HTTP up front, Protobufs in the rear

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Micro Services

Orion
Orion is a small lightweight framework written around grpc/protobuf with the aim to shorten time to build microservices at Carousell.
Stars: ✭ 101 (-88.16%)
Mutual labels:  microservice, grpc, protobuf
Kratos
A modular-designed and easy-to-use microservices framework in Go.
Stars: ✭ 15,844 (+1757.44%)
Mutual labels:  grpc, protobuf, microservice
Go Shopping
A sample suite of services built on the go-micro framework
Stars: ✭ 98 (-88.51%)
Mutual labels:  microservice, grpc, protobuf
Brpc Java
Java implementation for Baidu RPC, multi-protocol & high performance RPC.
Stars: ✭ 647 (-24.15%)
Mutual labels:  microservice, grpc, protobuf
Go Micro Boilerplate
The boilerplate of the GoLang application with a clear microservices architecture.
Stars: ✭ 147 (-82.77%)
Mutual labels:  microservice, grpc, protobuf
Go Project Sample
Introduce the best practice experience of Go project with a complete project example.通过一个完整的项目示例介绍Go语言项目的最佳实践经验.
Stars: ✭ 344 (-59.67%)
Mutual labels:  microservice, grpc, consul
Ketchup
ketchup (番茄酱) 是一个基于dotnet core的微服务框架。
Stars: ✭ 170 (-80.07%)
Mutual labels:  microservice, grpc, consul
Hyperf
🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.
Stars: ✭ 4,206 (+393.08%)
Mutual labels:  microservice, grpc, consul
Prototool
Your Swiss Army Knife for Protocol Buffers
Stars: ✭ 4,932 (+478.19%)
Mutual labels:  grpc, protobuf
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (-37.63%)
Mutual labels:  microservice, protobuf
Rpc Thunderdome
A comparison between Proteus RPC and other commonly used RPC frameworks
Stars: ✭ 22 (-97.42%)
Mutual labels:  grpc, protobuf
Grpc Jersey
gRPC<->Jersey bridge
Stars: ✭ 23 (-97.3%)
Mutual labels:  grpc, protobuf
Grpcurl
Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
Stars: ✭ 6,149 (+620.87%)
Mutual labels:  grpc, protobuf
Chatengine
Open source mtproto server written in golang with compatible telegram client
Stars: ✭ 544 (-36.23%)
Mutual labels:  microservice, grpc
Mortar
Mortar is a GO framework/library for building gRPC (and REST) web services.
Stars: ✭ 492 (-42.32%)
Mutual labels:  microservice, grpc
Gubernator
High Performance Rate Limiting MicroService and Library
Stars: ✭ 609 (-28.6%)
Mutual labels:  microservice, grpc
Grpclib
Pure-Python gRPC implementation for asyncio
Stars: ✭ 615 (-27.9%)
Mutual labels:  grpc, protobuf
Polyglot
A universal grpc command line client
Stars: ✭ 488 (-42.79%)
Mutual labels:  grpc, protobuf
Proteus
Generate .proto files from Go source code.
Stars: ✭ 593 (-30.48%)
Mutual labels:  grpc, protobuf
Danby
A webserver that's also a grpc proxy for browsers
Stars: ✭ 26 (-96.95%)
Mutual labels:  microservice, grpc

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
  • Consul for service discovery
  • 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.

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

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]
		}
	}]
}

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:

www.hward.com  ·  GitHub @harlow  ·  Twitter @comma_ok

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].