Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
February 14, 2022 09:58 pm GMT

Hello, Robyn!

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.

sansyrox/robyn - GitHub

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 secsSlowest: 0.0784 secsFastest: 0.0028 secsAverage: 0.0275 secsRequests/sec: 1809.8082
total: 4.1314 secsSlowest: 0.0733 secsFastest: 0.0027 secsAverage: 0.0206 secsRequests/sec: 2420.4851
Total: 13.5070 secsSlowest: 0.3635 secsFastest: 0.0249 secsAverage: 0.0674 secsRequests/sec: 740.3558
Total: 1.8324 secsSlowest: 0.0269 secsFastest: 0.0024 secsAverage: 0.0091 secsRequests/sec: 5457.2339
Total: 1.5592 secsSlowest: 0.0211 secsFastest: 0.0017 secsAverage: 0.0078 secsRequests/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(Coming very soon!)
  • Community First and truly FOSS!
  • Under active development!

Future Roadmap

  • Add typing support
  • Add middlewares(almost complete)
  • 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

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.

stars - robyn


Original Link: https://dev.to/sansyrox/hello-robyn-39bm

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To