EventGet 50% off your ticket to MongoDB.local NYC on May 2. Use code Web50!Learn more >>
MongoDB Developer
Rust
plus
Sign in to follow topics
MongoDB Developer Centerchevron-right
Developer Topicschevron-right
Languageschevron-right
Rustchevron-right

Using Rust Web Development Frameworks with MongoDB

Rachelle Palmer1 min read • Published Jun 11, 2022 • Updated Aug 30, 2022
MongoDBRust
Facebook Icontwitter iconlinkedin icon
Rate this article
star-empty
star-empty
star-empty
star-empty
star-empty

Introduction

So, you've decided to write a Rust application with MongoDB, and you're wondering which of the top web development frameworks to use. Below, we give some suggestions and resources for how to:
  1. Use MongoDB with Actix and Rust.
  2. Use MongoDB with Rocket.rs and Rust.
The TLDR is that any of the popular Rust frameworks can be used with MongoDB, and we have code examples, tutorials, and other resources to guide you.

Building MongoDB Rust apps with Actix

Actix is a powerful and performant web framework for building Rust applications, with a long list of supported features.
You can find a working example of using MongoDB with Actix in the databases directory under Actix's github, but otherwise, if you're looking to build a REST API with Rust and MongoDB, using Actix along the way, this tutorial is one of the better ones we've seen.

Building MongoDB Rust apps with Rocket.rs

Prefer Rocket? Rocket is a fast, secure, and type safe framework that is low on boilerplate. It's easy to use MongoDB with Rocket to build Rust applications. There's a tutorial on Medium we particularly like on building a REST API with Rust, MongoDB, and Rocket.
If all you want is to see a code example on github, we recommend this one.

Facebook Icontwitter iconlinkedin icon
Rate this article
star-empty
star-empty
star-empty
star-empty
star-empty
Related
Article

Structuring Data with Serde in Rust


Apr 03, 2024 | 5 min read
Tutorial

Red Mosquitto: Implement a noise sensor with an MQTT client in an ESP32


Mar 18, 2024 | 25 min read
Quickstart

Get Started with Rust and MongoDB


Sep 23, 2022 | 17 min read
Quickstart

Getting Started with Aggregation Pipelines in Rust


Sep 23, 2022 | 15 min read
Table of Contents
  • Introduction