Website developed in Rust

I am from .Net stack, I want to learn Rust for web development.

Want to know who using Rust in web development and their experience.

And which is the best combination for Rust based application development?

Like Database, Frontend, Web server etc.

1 Like

Here is an old question asking the same:

For the second part I can't give you an answer, since I've only used a web server once, without database and frontend framework.
I tired Rocket, Actix and Gotham. The first one seemed to me the easiest framework, but it requires Rust nightly, the last one has been used since I considered it simpler than Actix (and I had only need for a single-threaded webserver, so I've not cared about if it is async/await or multithreaded and fast)

Maybe @kornel has more experiences to share with you.

1 Like

I'm new to Rust almost one year ago. I soon had a Rust website running in production using Rocket together with the CockroachDB distributed SQL database and the NATS messaging system. This has all been running flawlessly since.

Rocket was selected for this project mostly because I did not know of many other ways to do it. Rocket's documentation is good and something I could understand pretty quickly. The thing that convinced me to go Rocket (and indeed Rust itself) for this project was this brilliant presentation by Rockets creator Sergio Benitez: " RustConf 2017 - Building Rocket": https://www.youtube.com/watch?v=t_FUZ34ahBE&t

I heard of Actix a bit later. All that async stuff put me off. I love it in node.js, I can't fathom it in Rust. At the time the project looked like it was going to disappear when the developer threatened to delete the repo after spat with some users. Not very confidence inspiring.

I don't see the objection to needing Rust nightly for Rocket. It's been solid. What few issues have turned up were dealt with in very short order. It's not as if you have to upgrade everything everyday and hope nothing breaks. Everything is version controlled in Rust nicely so you can stay on a version as long as you like.

2 Likes

I recently went with Rust (Actix) as a back-end and Elm as a front-end and it went great, highly recommended for SPAs.

You developed REST services in Rust ? Which database you used ?Why you used Elm ? Why not Angular or Vue.js ?

REST services in Rust are easy. At least with Rocket. I guess Actix and others as well. I happen to use CockroachDB. I'm sure others will work as well.

Choice of front end is another matter.

If you want to be Rusty there is Yew: https://github.com/yewstack/yew I have not looked into that yet.

In the JS world. What the hell? There are so many frameworks/libraries. Take your pick. They are all pretty terrible. I settled on React.

Yes, you can call it REST, in reality it also serves the static files (Elm's JS and some others).

I've used Elm because I find it the best thing that has ever happened to the world of front-end development, and because I now have quite substantial experience working with it commercially. Happy to tell more, but I think that would be an off-topic on this website.

Let me just say one more thing, I have most of my experience working with Haskell and Elm, and they can be combined together greatly, and I suspect the same story is possible for Rust. I'm looking forward in using Serde types to generate Elm encoders/decoders. That would make sure my APIs don't break and avoid unnecessary boilerplate.

Edit: forgot to mention, I'm using Redis and Amazon S3 at the moment, will probably add PostgreSQL for reading later.

I'm somewhat confused by this question.

To my mind a REST service has a REST API and that is totally independent of any database it may use or any browser framework that might use it. A REST service should not know and care, the consumer of it's service is likely not even a browser.

Or were you getting at something else?

There is warp (based on hyper), which is very easy to use to develop a multithreaded REST API.

I saw this project which uses Rust for the webserver, Node.js for the front and SQLite for db.

I use sled for local databases. It is pure Rust, simple, lightweight.

@tuxmain Why we use warp , when we have Rocket, Actix to developer Rest services. We can use warp with Actix ?

Hi there,
I've been using tide to built a REST API with MongoDB as database. However, no frontend experience yet as the API is not consumed by any browser.

When I needed a network library for my API, I chose the first I've found... I also want to use the fewer frameworks as possible, as they are often heavy and force you to rewrite all your code to comply with it.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.