Oppskrift / oppskrift_api

0 stars 0 forks source link

Which framework for Rust API ? #1

Closed Scttpr closed 4 years ago

Scttpr commented 4 years ago

Hello,

I think it's mainly a choice between Actix-web and Rocket.

Actix-web

Avantages : Production ready (v3.0.0), API Futures, seems to be the go to right now Inconvenients : No AP crates

Rocket

Avantages : activityStreams crate is based on it, seems light and easy to handle Inconvenients : v0.4 for nightly projects right now, could lead to breaking changes in near future.

Slight pref for Actix if we can use activityStreans on top of it ?

Djyp commented 4 years ago

You can still install the activitystream crate with actix, and I don't see the activitystream crate in the rocket framework :thinking:

I've been searching what would be best between the two. As Actix also uses Diesel and seems to deal pretty well with APIs it would be a good fit for the backend. It's lighter and doesn't come with front features (like forms and templates)

Djyp commented 4 years ago

Hello ! So I'm finally back here. Been thinking a lot about the project and working a lot on my rust skills. Still not enough but a lot for the PHP/Symfony expert I am. I tried a lot of things and read a lot about actix and rocket. No other framework is on the table for they don't have the community of these two and they have the same philosophy as Actix. As I understand it, Actix is more like Flask and Rocket is more like Django. Actix is lighter and made for many types of projects and Rocket is built mainly for web projects so it has more tools to build web projects, like a templating system.

I'm a lazy developper, as lazy as most developpers I guess. So the more tools the better and I'd tend to use Rocket. BUT (!!!), and that's a big but(t), Rocket is still not stable. Using 6 months old code requires update as Rocket uses rust in nightly. Promises are made for Rocket v0.5 but it's still not here atm. Rocket as great perks, it uses a great deal of well chosen attributes to declare stuff like routes. It's clean. It's quite pleasant to use it. Actix is a bit too light for my tastes, but I guess it's complete enough. At least it is stable and it's still the most adopted Rust framework.

My main problem with both is architecture. They give you code logic and tools but they don't suggest code and file architecture. I guess I just lack knowledge there, but I think we'll manage anyway.

So, let's make it final, let's close this en choose Actix