Is rust good to write an API for a mobile app?

Hi There,
New to rust and been learning it for a few months and I wonder if rust is good to write an API for mobile app. Here are the issues I expect/did to encounter:

1. Lack of proper documentation to do this.
2. Lack of proper libraries to speed up the process.
3. Authentication not well documented. For example I want to implement facebook login and there is nothing out there (except for the Aouth2 that I need to implement myself).
 4. Not sure the speed will be significant faster since it still uses the same database (which would be the limiting factor) then high level languages.

Any thoughts?

Do you mean server-side API, or something running on mobile devices?

If server-side, there are a few frameworks to choose from:

In terms of speed, it depends. If your API is just a "CRUD" interface to a database, then Rust won't make it much faster. If you have some data processing involved, or need to have very low latency or low memory usage, then Rust will help.

Hi Kornel, Thanks for your answer I will check the link. By API I mean server API connected to a postgres or mysql database and using an ORM such as Diesel.

My exact use for my project is to build a simple social network (with auth, ect) using an ORM. I already did that in rails and it was pretty simple. I want more control over the code so I though of choosing rust.

You definitely can, if you want low level access then Rust is definitely the way to go. It most likely won't be a "lot" faster as the database gives most of the overhead, but will improves some aspects of the API. About the code, it's very likely to take a lot longer to write compared to Rails due to the complexity of most frameworks.

If you want a challenge then yeah, rust is definitely recommended for this task.

Pretty common use case so the answer is common as well

you can do it with rust just fine

it'll take longer to make, as with all things rust

it'll be more robust, same as most things rust

probably won't be all that faster as the bottlenecks will be elsewhere

Thanks for your answers guys. I might have fun with rust and build an API.

1 Like

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.