Zero: A simple, fast, low-latency Python framework (RPC) for building microservices or distributed servers
TLDR; https://github.com/Ananto30/zero
I am recently working on the concept of creating a framework for Python microservices. We usually use REST APIs for inter-service communication. But if we use Python for the whole ecosystem, we can leverage the option of making things much more simpler.
So I came up with the concept of using the messaging pattern for inter-service communication and call RPC to reduce the overhead of HTTP. I used Zeromq under the hood and made this framework to easily communicate with other services.
The power of Zero is like Distributed systems. We can use Zero to spawn several servers in different machines and just connect them to handle the distributed tasks. We can use Zero to -
- Create high-performance web servers, that communicate using RPC.
- Distributed computing
- Train ML models concurrently
- Act as job workers, also handles scheduling tasks
- etc….
Installation
pip install zeroapi
Simple client server example
Zero also supports generating client code!
If you run the above server then you can create the client code remotely! Run the command below -
python -m zero.generate_client --host localhost --port 5559 --overwrite-dir ./my_client
The client code will be generated under my_client
directory.
Benchmarks
As the title of this post shows promises, here are the benchmarks -
You can run your own benchmarks (and please share with us) following the instructions here.
Play with Zero and please let me know your thoughts and what can be improved in Zero.