// Private beta
Declare databases, Pub/Sub, object storage, caches, cron jobs, and secrets in your Rust code. Encore provisions them locally and in your own AWS or GCP account.
Want to talk it through first? Get practical advice from an Encore engineer.
“What used to take days or weeks of back-and-forth between developers and infra teams is now automated and completed in minutes.”
Declare what your application needs directly in Rust, and Encore automatically provisions it across local development, preview environments, and production.
use encore::storage::postgres::Database;
static DB: Database = Database::new("users").migrations("./migrations");
async fn user_name(id: i64) -> Result<String, encore::Error> {
let row = DB
.query_one("SELECT name FROM users WHERE id = $1", &[&id])
.await?;
Ok(row.get("name"))
}use encore::pubsub::{Message, Subscription, Topic};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct SignupEvent {
user_id: String,
email: String,
}
static SIGNUPS: Topic<SignupEvent> = Topic::new("signups");
#[encore::pubsub::register]
static WELCOME: Subscription<SignupEvent> =
Subscription::new(&SIGNUPS, "send-welcome", send_welcome);
async fn send_welcome(msg: Message<SignupEvent>) -> Result<(), encore::Error> {
send_email(&msg.data.email).await
}use encore::objects::Bucket;
static AVATARS: Bucket = Bucket::new("avatars").public();
async fn save_avatar(user_id: &str, image: Vec<u8>) -> Result<String, encore::Error> {
let key = format!("{user_id}.png");
AVATARS.upload(&key, image).await?;
AVATARS.public_url(&key)
}use encore::cron;
// Encore calls POST /internal/welcome-emails every 2 hours.
static WELCOME_EMAILS: cron::Job = cron::Job::new(
"welcome-email",
"/internal/welcome-emails",
cron::Schedule::Every("2h"),
)
.title("Send welcome emails");
let app = Router::new()
.route(WELCOME_EMAILS.path(), post(send_welcome_emails));use encore::secrets::Secret;
static STRIPE_KEY: Secret = Secret::new("StripeSecretKey");
// Read the value at runtime, no .env files to manage
let client = StripeClient::new(&*STRIPE_KEY.value()?);use encore::storage::redis;
static SESSIONS: redis::Database = redis::Database::new("sessions");
async fn track_visit(page: &str) -> Result<i64, encore::Error> {
SESSIONS.string().incr(format!("visits:{page}"), 1).await
}use encore::metrics::{Counter, Histogram};
static ORDERS_PLACED: Counter = Counter::new("orders_placed");
static CHECKOUT_TIME: Histogram = Histogram::new("checkout_duration").unit("seconds");
ORDERS_PLACED.increment();
CHECKOUT_TIME.observe(0.42);encore run starts your Rust app along with every database, topic, bucket, and cache it declares.
No Docker Compose. No config files. No manual setup.
Postgres, Redis, Pub/Sub, and object storage start automatically, with migrations applied
encore test runs your test suite against real local infrastructure, not mocks
Requests, queries, and messages are traced with OpenTelemetry from the first run
The same declarations run locally, in preview environments, and in production. Encore works out the infrastructure, so you and your team can focus on the product.
Encore.rs handles infrastructure only. Routing, validation, and request handling stay in axum or whatever you already use, so adopting it doesn't mean a rewrite.
Encore provisions managed databases, queues, buckets, and caches in your own AWS or GCP account. Your data stays in your account.
Static analysis knows which service uses which resource, so each service gets only the IAM permissions it actually needs.
Every pull request gets an isolated environment with its own infrastructure, so changes are tested against the real thing before they merge.
Region, sizing, and scaling are set per environment in the Encore dashboard or your existing Terraform, not in application code.
Traces, logs, and metrics flow through OpenTelemetry, with each request connected to the queries and messages it caused.
Encore gives agents a structured model of your application and its infrastructure, so they can ship features in your Rust systems without being handed the keys to your AWS or GCP account.
"Encore is our foundation for all new development. Since adopting it, we've seen a 2-3x increase in development speed and 90% shorter project lead times."
"Encore lets us go from idea to shipped product at least 3x faster and saves us hours of devops work every week."
"We've reduced time spent on DevOps by 95%, and we're now on track to save $60K annually in cloud costs."
"Encore is an unfair advantage. At Pave we've moved 2x faster than we did at Monzo."
"We're saving $200k+ annually compared to additional hiring. The ROI is outstanding, easily 10x."
"You define infrastructure in your code and it's automatically spun up for you. You can go from zero to a deployed service on GCP in an hour. I don't know how else to do it."
"Encore's inferred infrastructure has allowed us to move at unprecedented speed. Combined with database branching in Neon, we're able to spin ephemeral environments up and down with incredible ease. Stakeholders love preview app URLs."
The Encore.rs beta is for teams already running Rust on AWS or GCP. We’ll work with you directly on migration and deployment in your own cloud.