We wanted our technology choices to support our mission: a greener modern world, supported by a cleaner modern web. To do that, we decided to take a chance on two novel inventions: Rust for our serverless back-end, and PlanetScale for an enterprise-quality database. By Thomas.
Rust is a memory-safe systems programming language that has secured the title of most beloved language on StackOverflow’s annual developer survey for the past six years running. It’s not just hype. Programs written in Rust can run as fast as the processor, with no VM or garbage collector taking up cycles. Then there’s PlanetScale, which provides small teams with exceptional cloud database features (like sharding and size-balancing) under a progressive pricing structure.
For the purpose of this guide, we’ll be developing a profile API, or org-service … using PlanetScale, Rust, the Rocket web-framework, and the Diesel ORM. You can view the finished project on GitHub.
The article then covers step by step:
- Creating a database
- Our first migration
- Building the API service
- Deploying the API service
All the steps are accompanied by the well explained code and you will also learn to package the service into a Docker image. From there, you could easily deploy it to Google Cloud Run (or AWS, or Azure)! Nice one!
[Read More]