Maxim Leonovich
1 min readAug 5, 2019

--

Hey, Artem! Thanks for the kind words!
Honestly, we didn’t think much when choosing the API lib. We just wanted the one where we’d need to write the least code + it’d give us multi-threading for free, and that turned out to be gRPC :)
Basically, with flask you still need to invent some format, on top of JSON, in which you’re going to send your data, then validate it, then maybe wrap requests into something more task specific, etc. With gRPC you just write a spec, run a generator and get:

  • a server stub, where you just have to add implementation
  • rigid schema on top of protobuf for both methods and messages
  • a client lib with the exact same RPC methods as you’ve defined in the spec
  • if you use a plugin, as a bonus you also get a mypy stub, so that you can static-check all your API calls.

All that from a single command — pretty convenient I think :)

As of the experience so far — our API is super tiny, we’ve just implemented it and forgot about. I guess that’s exactly what we wanted from it.

--

--

No responses yet