Hello, Robyn!
Sanskar Jethi
Posted on February 14, 2022
Hi, I'm Sanskar Jethi(@sansyrox), the author and maintainer of Robyn!
This article was written in celebration of Robyn passing 100k installs on PyPi.
What is robyn?
Robyn is a fast asynchronous web Python framework with a Rust runtime. Other similar products that are available are Flask, FastAPI, Django but they need a web server of choice. However, when you create a robyn app, you do not need an external web server for production.
🤔 Why another web framework?
Currently, all the other frameworks in the Python community are written only in Python, which does not allow true concurrency due to the notorious GIL and slow speed of execution. Robyn, having a Rust runtime and a coupled web server, tries to move around the GIL in many ways improving the runtime performance. While having a decoupled webserver brings along a lot of benefits, an integrated web server in Robyn allows us more control over the execution performance.
Performance Benchmarks(on a dual core machine)
You can read the detailed version on the docs website.
*Flask(Gunicorn) | FastAPI(API) | Django(Gunicorn) | Robyn(1 process and 1 worker) | Robyn(5 processes and 5 workers)* |
---|---|---|---|---|
Total: 5.5254 secs | Slowest: 0.0784 secs | Fastest: 0.0028 secs | Average: 0.0275 secs | Requests/sec: 1809.8082 |
total: 4.1314 secs | Slowest: 0.0733 secs | Fastest: 0.0027 secs | Average: 0.0206 secs | Requests/sec: 2420.4851 |
Total: 13.5070 secs | Slowest: 0.3635 secs | Fastest: 0.0249 secs | Average: 0.0674 secs | Requests/sec: 740.3558 |
Total: 1.8324 secs | Slowest: 0.0269 secs | Fastest: 0.0024 secs | Average: 0.0091 secs | Requests/sec: 5457.2339 |
Total: 1.5592 secs | Slowest: 0.0211 secs | Fastest: 0.0017 secs | Average: 0.0078 secs | Requests/sec: 6413.6480 |
⚡ Current features
- Written in Rust, btw xD
- A multithreaded Runtime
- Extensible
- A simple API
- Sync and Async Function Support
- Dynamic URL Routing
- Multi Core Scaling
- WebSockets!
- Hot Reloading
- Middlewares
- Community First and truly FOSS!
- Under active development!
🔮 Future Roadmap
- Add typing support
- Document the process of plugin creation
- Create some plugins(e.g. for various Database providers like PgSQL, Mongo,etc.)
- Increase the execution speed.
- Better documentation
- Spend more time improving the Community and Ecosystem.
👣 A short history about robyn.
It was April of 2021 and I was in the final year of my university. My final year project deadline was approaching and like any other hard-working student, I was spending all my time scrolling reddit. During that time, Reddit's CS threads were being flooded with "Rewrite in Rust" memes. And since I was such a hardworking student, I was working on a completely unrelated project which had a flask backend.
Also, having written some backends in JavaScript from time to time, I used to really miss async methods while writing flask. That is when I told myself, you know Sanskar(yes sometimes I talk to myself in 3rd person) what would be cool: If you could create an Async Flask(I had used FastAPI at that time but it was not a regular part of my dev toolkit).
You know what would be cooler: IF IT WOULD BE WRITTEN IN RUST, BTW xD.
And this is how Robyn was born.
Acknowledgements
Thank you to all the people involved in the development of Robyn. From creating libraries over which robyn is built, to helping me out with rust queries to contributing and reviewing code. Thank you to everyone who is helping out with the project. 💖
Conclusion
We are always eager for new contributors and support. Consider starring us for increased visibility.
Posted on February 14, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.