Back

Rust API Development: My Hot Take

7/17/2026 ยท 4 min read

Background

I have most of my production API development experience in TypeScript and C#. I wanted to self host an app on my Banana Pi but hated the idea of writing a single line of OOP (no offense, OOP friends). I wasn't confident that TypeScript was the most performant tool for the job so I opted to learn Rust for this use case. Truthfully, I have wanted to learn the language for years, and this project finally gave me the perfect opportunity (because learning how to write fizzbuzz solutions in a new language just doesn't get me excited for some reason ๐Ÿ˜†).

Project repo, for reference: https://github.com/ploymahloy/fitness-app

Preconceived Opinions

As I had alluded in the previous section, I had taken a stab at learning Rust before. Working through Rust by Example, I was able to learn the basics of the syntax (sans AI, see post), and how this lower-level language handled primitives that were abstracted by JavaScript. Rust even handles string encoding differently than JavacSript!

Both Python and Rust encode strings as UTF-8 but Rust does not allow indexing characters of strings with single integers, i.e. let char = str[0], because that integer alone is too ambiguous to specify whether the developer wants the first byte, the first Unicode character, or the first human-perceivable character. At the cost of memory and overall performance via encoding and decoding, Python makes the assumption that the developer is requesting the human-perceivable character. DevX 1, Performance 0 for Python.

TL;DR: Rust assumes nothing and it improves performance dramatically at the cost of a somewhat tedious level of specificity relative to higher-level languages.

Rust API Dev: Day 0

Using axum for HTTP routing and requests and sqlx for writing SQL queries made the API development experience in Rust rather pleasant. While sqlx is not a de facto ORM, it does offer the protection against SQL injection attacks with the bind() method; which replaces placeholder values at execution time.

Cargo is a fantastic package manager; much easier to work with than npm or pip. The compiler is unforgiving, but it provides hints and suggestions for how to make it happy. The granular detail of required typing and specification is tedious at first, but it is empowering to deliver such a performant application in a small binary.

First impression of Rust API development: 9/10 (The official docs are ROUGH).

Where Rusts Belongs In Your Tool Belt

Rust is no language that can be learned in a day. It is rarely anyone's first language, and it's not even the industry's first choice for API development. With that being said, I was able to get my basic CRUD app to query my database, free of compilation errors, in a matter of hours. I have demonstrated that it is possible to learn Rust for API development despite my high-level language abstraction habitus and UI-heavy background. I'm no "10X Engineer", I'm simply a senior-level engineer that craves a technical challenge. In saying this, is Rust a good option for API development? I'm inclined to say yes, but ONLY if certain factors are at play. I'll elaborate.

Rust provides lightning fast performance, memory safety, and can be used for full stack web dev; in addition to the more common systems-level development use cases. The tradeoffs that make Rust a poor choice are its learning curve, the strict borrow checker, the relatively small Rust talent pool, and its ecosystem that lacks the maturity for certain critical use cases.

I opted for Rust for my project primarily because I am hosting my API server on a Banana Pi and am constrained by space. In addition, the learning curve is actually a pro in my case because I am an engineering masochist and extract joy from technical challenges; such as learning Rust as a TypeScript dev. Above all else, this project has limited product requirements and zero stakeholders to frustrate with missed deadlines so I could use bash scripts if I really wanted to.

Closing Thoughts

If you want to do more than change the visual behavior of pixels, or are bored by managing global state and API endpoints, I recommend diving into a lower-level language like Rust. By nature of the compiler, production Rust code can't emit a segfault error as C code can, but the Rust ecosystem lacks the maturity and industry trust of C++.

Weigh your use case for a language in this realm and make your choice accordingly. Worst-case scenario is that you have a shiny new tool in your technical tool belt and a newfound appreciation for what is abstracted by high-level languages.

Trust your gut, give it a shot.