DEV Community

Cover image for What we learned building our SaaS with Rust 🦀

What we learned building our SaaS with Rust 🦀

Gaspard Boursin on April 29, 2024

In this post we will not answer the question everybody asks when starting a new project: Should I do it in Rust ? Instead, we'll explore the pitf...
Collapse
 
gaspardb profile image
Gaspard Boursin • Edited

Thanks for reading ! This was my first post ever, I'd love to have your feedback !

What should we write about next ?

  1. 🔥Top libraries that boosted our productivity
  2. 🤯 Clean error propagation in Rust
  3. 💖 Top Rust open source projects we take inspiration from
  4. 🚀 Building a SaaS with Rust + GRPC + React
  5. 🦄 How we leveraged Clickhouse to build our dynamic Metering module

Or if you have suggestions, don't hesitate to let us know in comments !

Collapse
 
eli_glanz profile image
Eli

Choosing #5!

Collapse
 
robinbastien profile image
Robin Bastien • Edited

*#4 please! *
Mid-read I veered off and researched how one would approach this. Thank you for the article!

Collapse
 
best_codes profile image
Best Codes

Hmm… I'd say it's up to you (of course), and I can't really decide…
I guess I would choose 2 or 5.

Awesome article!

Collapse
 
jar profile image
Phil R.

I'd vote for 1 & 2

Collapse
 
bhirmbani profile image
Bhirawa Mbani

please do number 4 sir

Collapse
 
benbpyle profile image
Benjamen Pyle

Great article. I've been working to transition teams into Rust in the world of AWS Serverless with Lambda Functions and Containers. The learning curve is real but the productivity and performance is amazing.

Collapse
 
gaspardb profile image
Gaspard Boursin

Thanks ! Serverless is a great use case for Rust yes, cold start diff can be huge ! What language are they coming from ?

Collapse
 
benbpyle profile image
Benjamen Pyle

So I work with a lot of different teams. Most come from Go but I've moved teams from TypeScript too.

Collapse
 
tombohub profile image
tombohub

do you mean productivity once you get over the learning curve? Where does this productivity come from? is it type safe code? easier error handling?

Collapse
 
benbpyle profile image
Benjamen Pyle

Fewer defects. Better project/library management. Cleaner code paradigms like errors and enums.

Collapse
 
gaspardb profile image
Gaspard Boursin • Edited

The support following this post has been amazing, thanks everyone ❤️

We're now working on our deep dive series ✨

In the meantime if you want to start looking at some webdev projects, we did a tiny "listicle" with a couple of opensource saas/fullstack tools that have been invaluable to us while learning, I hope it can be useful to you as well 🙌
The projects that helped us learn Rust 🦀
On a different theme, we published yesterday: What's coming to Postgres ? 🐘, a dive into the recent innovations in that space.
Cheers !

Collapse
 
timibolu profile image
Oluwatimilehin Adesina

Thanks for this article. Amazingly, you're open-source. I will surely learn from the repo.
I am also learning rust. I built a basic backend with Axum and MongoDB. Unfortunately, I can't share -- client work. It was a bittersweet experience. I enjoyed some things but found other things stressful coming from a TypeScript/Golang and Python background. I am still learning though.

Collapse
 
gaspardb profile image
Gaspard Boursin

Thanks ! I can relate, until you've truly integrated the concepts lifecycle and ownership can drive you crazy. It'll get easier with practice !

Collapse
 
curry44424 profile image
Curry44424

Great to hear I’m using rust in my backend as well it’s just crazy cause when I started like most Rust was foreign language people were knee deep in react and Ruby so to see rust take off is nuts future definitely bright in Rust

Collapse
 
gaspardb profile image
Gaspard Boursin

Adoption from larger players and efforts from the community have made it a lot easier to onboard for a variety of use cases, and we're still early 👍

Collapse
 
december1981 profile image
Stephen Brown

I can't speak for the relational db drivers, but the mongodb rust driver is excellent, and quite mature.

Collapse
 
ricardogesteves profile image
Ricardo Esteves

Cool, thanks for sharing it.
4 would be nice!

Collapse
 
vingitonga profile image
Vincent Gitonga

Wow.
I loved the article.
It's really encouraging and I think it's time I head back and learn rust 😂.

Collapse
 
gaspardb profile image
Gaspard Boursin

Thanks Vincent :) Join us 🦀 🦀

Collapse
 
ddbb1977 profile image
Danny Boyd

Why not Scala? Since you were Scala developers what is the reason not to choose Scala?

I'm myself wondering if Scala is a dead end as moving to Scala 3, licensing problems with Akka/Pekko,, reduced community, ABI stability, and so on and I've been wondering if I should move to Rust.

I love coding in Scala, it's type system, hybrid OOP functional paradigm, JVM based and lot of other merits, but it feels like investing more time in it's ecosystem is not worth it.

I would love to hear why you've made the move over to Rust more than just the "drama-heavy and sometimes toxic Scala community". Do you see Scala as a technical dead end too?

Collapse
 
gaspardb profile image
Gaspard Boursin

Hey Danny,
We had the same feeling as you. Although we really enjoyed the language, we didn't feel like committing to a long-term project based primarily on Scala, even if it meant starting from scratch in a new ecosystem. I wouldn't say that Scala is a dead end, but it has definitely lost its flavor for us, and starting this project was a good opportunity to change and have fun learning something new.

Collapse
 
ashkanmohammadi profile image
Amohammadi2

2

Collapse
 
louaiboumediene profile image
Louai Boumediene

I've been exited to start learning rust since a long time, after this article... ITS JUST THE TIME!

Collapse
 
gaspardb profile image
Gaspard Boursin

ahah happy to hear it 😄

Collapse
 
steeve profile image
Steeve

Great article, and it motivates me to start learning Rust (probably in a couple of days 🙄)...

Collapse
 
gaspardb profile image
Gaspard Boursin

Thanks, first few weeks are hard but hang in there, it gets pretty rewarding afterward :)

Collapse
 
jar profile image
Phil R.

Insightful post 👍

Collapse
 
gaspardb profile image
Gaspard Boursin

Glad you liked it 🙌

Collapse
 
caniko profile image
Can H. Tartanoglu

Lovely! Will solo build a product in Rust very soon.

Collapse
 
gaspardb profile image
Gaspard Boursin

Great ! Let us know how it goes :)

Collapse
 
skadyan profile image
Sandeep Kadyan

Thanks for sharing your Rust experience. I found it a well-articulated article.

Collapse
 
gaspardb profile image
Gaspard Boursin

Thanks Sandeep :)

Collapse
 
jitenpalaparthi profile image
Jiten Palaparthi

This is awesome post

Collapse
 
gaspardb profile image
Gaspard Boursin

Thanks Jiten ;)

Collapse
 
ankeshkapil profile image
Ankesh Kapil

Is it really worth it to move from java ecosystem to rust.Considering the effort it needs to migrate and also finding folks in rust is not possible so you need to give some time to devs to warm up. Also its not possible to achieve good productivity due to the lack of tooling.

Collapse
 
gaspardb profile image
Gaspard Boursin

If you don't feel the need for your use case (or motivation), or if you have short-term productivity requirements, don't move to rust !
However regarding the tooling I must say it has been pretty straightforward (at least it is not something that impacted negatively our productivity)

Collapse
 
panjibaskoro profile image
Panji Iman Baskoro

love the article. the best part of rust is even the learning curve is really something but their documentation, their book even the ruslings is so great. Even better they do really know how to make error messages lol

Thank you for the articles, i'll refer anyone that start to learn rust to read this one <3