mdzhang / grpc-python-example

Demos dockerized Python grpc server, database, and text and http clients

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

grpc_python_example

Demos the following:

  • a simple service that can return an Item from Postgres database using SQLAlchemy as an ORM, and Alembic for migrations
  • the following APIs to access the service:
  • example Dockerfile and docker-compose.yml file that dockerizes the service and its apis

Table of Contents

Description

(AFAIK)

grpc architecture diagram

Pros

gRPC server

  • Fast! Uses HTTP 2 and encodes requests in binary format

Language agnostic stubs

  • Don't have to reimplement same client in multiple languages
  • Stubs are just plain old objects/modules so don't have to worry about it not working with one framework or another
  • Just have to generate stub from protobuf definitions in an e.g. organization level .proto repository

Cons

  • Documentation is lacking
  • Few established best practices, conventions, code snippets etc.

About

Demos dockerized Python grpc server, database, and text and http clients


Languages

Language:Python 89.4%Language:Makefile 4.5%Language:Protocol Buffer 3.0%Language:Mako 1.9%Language:Shell 1.0%Language:Ruby 0.3%