Building better Python microservices using GRPC

Narendran R (~narendran)


12

Votes

Description:

Abstract

Today, massive systems are running on microservices communicating with each other using REST APIs. REST is easy to get started, loosely structured and does good job in exchanging messages. But it's convenience comes with a performance trade-off, which takes us back to other optimal alternative: gRPC

Description

In this talk we will see what gRPC is and how it is different from REST. We will get started with GRPC by generating stubs for python and build a simple gRPC API server. We will try to find out the advantages of gRPC over REST by doing a side by side comparison of our APIs. We then deploy our server in Kubernetes and discuss how we could scale our microservices.

Outline

  1. Introduction to gRPC (3 min)
  2. gRPC concepts (5 min)
  3. Designing the APIs REST-fully (3 min)
  4. Going the gRPC way (5 min)
    • Generating python stubs
  5. Duel: gRPC vs REST python servers (4 min)
  6. Demo (4 min)
    • Deploying our gRPC apis in kubernetes
  7. Summary (3 min)
  8. Q & A (3 min)

Key take aways to audience

  1. Audience will get a practical introduction to gRPC and protocol buffers.
  2. Now the audience will know an alternative to HTTP/REST. This allows them to design better microservices based on their use cases.
  3. Bonus: Deploying and scaling python microservices in Kubernetes.

Links

Prerequisites:

This talk targets intermediate audiences. As it involves microservices, a little bit of knowledge in REST API is nice to have to realise how gRPC is different from REST. But nevertheless, it will also be useful to curious beginners.

Content URLs:

Slides

TBD

Code repository

TBD

Speaker Info:

Naren is a Product Engineer with specific focus on building robust backend systems. Past 5 years, he has built dozens of microservices and scalable systems using Python, Go and AWS cloud. He is an open source enthusiast who loves speaking at tech conferences and currently works as Senior Software Consultant at Tarka Labs. In his industry experience he’s worn plenty of hats- like the one of a Trainer, Embedded Engineer, Product Engineer and Consultant and sometimes even helmets- while he’s out cycling. When he’s not stirring up code, you can find him whipping up a delicious gluten-free treat or training for cycling races. He also blogs about software, productivity and goes by the handle DudeWhoCode across the internet.

Speaker Links:

Past 5 years I have been architecting and building scalable backend systems using Python. I have built a dozen of microservices at scale. Recently I built a production infrastructure in Python that handles 20+ millions of API calls per day. At one point of time, I realised I should know some alternatives other than REST to communicate between the microservices. Out of curiosity I explored and used gRPC in few of my microservices. Since then, I wanted to share the knowledge so that developers will get to know other options while architecting their infrastructure.

This talk targets intermediate audiences. As it involves microservices, a little bit of knowledge in REST API is nice to have to realise how gRPC is different from REST. But nevertheless, it will also be useful to curious beginners.

I have spoken in various conferences, my recent one was PyCon Singapore 2018. Below are some of my previous talks and speaker portfolio:

Section: Web development
Type: Talks
Target Audience: Intermediate
Last Updated: