Resources

Resources

Docs, recipes, demos, and AWS study headlines.

Learn · Build · Explore · Follow

Rust docs for published families, then paths to build and explore the template.

Job recipes

Logistics dispatch, financial reconciliation, invoice fanout, and audit batches. Each recipe maps product behavior to Valence, Boson, Chronon, Photon, and Gluon.

AWS performance study

Both pages show the same completed-work profiles: embedded SQLite and remote fleet, measured on named AWS hosts. Scale-out is observed through four application nodes; sizing by division is valid only inside that range. The component-study section below is a separate tuning view.
ProductWorkloadProfileCompleted workp95Tested scaleHardwareTopologyCorrectnessSamplesScaling
ChrononDue-job burst with a five-minute cohortEmbedded SQLite1.7 completed jobs/s84 s1 hostc6i.large, us-west-2SQLite on one host580 successes, no missed five-minute fires3Single host
ChrononDue-job burst with a five-minute cohortRemote fleet2.4 completed jobs/s68 s4 worker hosts4× c6i.large workers, us-west-2Postgres and Redis, 4 worker hosts580 successes, no missed five-minute fires3Four workers vs one is 0.25. Drain waits for the five-minute analog.
BosonBounded job completionEmbedded SQLite117 completed jobs/snot reported1 hostc6i.large, us-west-2SQLite on one hostZero backlog on the driver completed-work path3Single host
BosonBounded job completionRemote fleet199 completed jobs/snot reported4 worker hosts4× c6i.large workers, us-west-2Redis, 4 worker hostsZero backlog on the driver completed-work path3Four workers vs one is 0.52
PhotonDurable publish, one subscriberEmbedded SQLite100 completed publishes/s6.3 ms1 hostc6i.large, us-west-2SQLite on one hostCheckpoint persisted for every acknowledged publish3Single host
PhotonDurable publish, one subscriberRemote fleet2,250 completed publishes/s1.7 ms4 app hosts4× c6i.large, us-west-2NATS, 4 app hostsCheckpoint persisted for every acknowledged publish34 publisher hosts
PhotonDurable publish, four-subscriber fanoutEmbedded SQLite500 completed publishes/s6.0 ms1 hostc6i.large, us-west-2SQLite on one hostCheckpoint persisted for every acknowledged publish3Single host
PhotonDurable publish, four-subscriber fanoutRemote fleet3,250 completed publishes/s1.8 ms4 app hosts4× c6i.large, us-west-2NATS, 4 app hostsCheckpoint persisted for every acknowledged publish34 publisher hosts
SpectraDurable write then read-your-writeEmbedded SQLite80 completed writes/s4.3 ms1 hostt3.xlarge, us-west-2SQLite on one hostVisible after flush inside the wait budget3Single host
SpectraDurable write then read-your-writeRemote fleet100,000 completed writes/s36 s4 writer hosts4× t3.2xlarge, us-west-2ClickHouse, 4 writersVisible after flush inside the wait budget3Holds 1.0 through 4 writers
ValenceHybrid lookup after a writeEmbedded SQLite5,740 completed lookups/s7.8 ms1 hostc6i.xlarge, us-west-2SQLite on one hostLookup results match the written rows3Single host
ValenceHybrid lookup after a writeRemote fleet17,715 completed lookups/s40 ms4 app hosts4× c6i.xlarge, us-west-2Postgres and IndraDB, 4 app hostsLookup results match the written rows3Four app hosts vs one is 0.42

Component study

Enqueue, ingress, claim, cache, latency, soak, and overload tracks answer a tuning question. They are not end-to-end capacity.
ProductDeploymentMeasurementProfile
BosonRemote / service-backed
·
BosonEmbedded SQLite
·
PhotonRemote fleet
·
PhotonEmbedded SQLite
·
ChrononRemote fleet
·
SpectraRemote / service-backed
·
ValenceEmbedded SQLite
·
ValenceEmbedded SQLite
·
ValenceEmbedded SQLite
·
ValenceRemote / service-backed
·
ValenceRemote / service-backed
·
ValenceRemote / service-backed
·

Code samples from upstream docs

Condensed getting-started samples from each family's README and docs.rs — open the platform guide or Rust docs for the full walkthrough.
Valence schemaValence
Schema DSL + builder backends
use std::sync::Arc;
use valence::{
    Database, DatabaseFromEngine, FieldType, InMemoryBackend, Valence, MEM_ENGINE_ID,
    valence_schema,
};

const COUNTER_DB: DatabaseFromEngine = Database::from_engine("default", MEM_ENGINE_ID);

valence_schema! {
    Counter {
        table: "counter",
        version: "0.1.0",
        description: "Simple counter",
        database: COUNTER_DB,
        fields: [
            id: { r#type: FieldType::String, primary_key: true, required: true },
            value: { r#type: FieldType::Integer, required: true },
        ],
    }
}

let valence = Valence::builder()
    .add_backend("default", Arc::new(InMemoryBackend::new()))
    .build()?;
Boson taskBoson
Typed #[task] + enqueue
use std::sync::Arc;
use boson::{
    configure, task, Boson, ExecutionContext, JsonExecutionContextFactory,
    MemQueueBackend,
};

#[task(name = "process_order")]
async fn process_order(
    ctx: Box<dyn ExecutionContext>,
    order_id: String,
    amount_cents: u64,
) -> boson_core::Result<()> {
    tracing::info!(actor = ctx.label(), %order_id, amount_cents);
    Ok(())
}

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let boson = Boson::builder()
        .queue_backend(Arc::new(MemQueueBackend::new()))
        .execution_context_factory(JsonExecutionContextFactory)
        .auto_registry()
        .build()?;
    configure(boson);

    ProcessOrder::send_with(
        serde_json::json!({"System": {"operation": "checkout"}}),
        ProcessOrderParams {
            order_id: "ord-42".into(),
            amount_cents: 9900,
        },
    )
    .await?;
    Ok(())
}
Chronon scriptChronon
Cron job + typed #[chronon::script]
use std::sync::Arc;
use chronon::prelude::*;
use chronon::InMemorySchedulerStore;

#[chronon::script(name = "nightly_cleanup")]
async fn nightly_cleanup(
    ctx: Box<dyn ScriptContext>,
    retention_days: u32,
) -> chronon::Result<()> {
    println!("{}: retaining {retention_days} days", ctx.label());
    Ok(())
}

#[tokio::main]
async fn main() -> chronon::Result<()> {
    let chronon = Chronon::builder()
        .scheduler_store(Arc::new(InMemorySchedulerStore::new()))
        .context_factory(Arc::new(JsonScriptContextFactory))
        .embedded()
        .auto_registry()
        .build()?;

    let mut nightly = Job::new("nightly-schedule", "nightly_cleanup");
    nightly.schedule_kind = ScheduleKind::Cron;
    nightly.cron_expr = Some("0 2 * * *".into());
    nightly.timezone = Some("UTC".into());
    nightly.params_json = serde_json::json!({ "retention_days": 7 });
    chronon.coordinator_service().upsert_job(nightly).await?;

    chronon.run().await
}
Photon topicPhoton
Typed topic + durable subscribe
use std::sync::Arc;
use photon::{subscribe, topic, JsonIdentityFactory, Photon};
use photon_core::Actor;

#[topic(name = "orders.created", keyed_by = "order_id")]
pub struct OrderCreated {
    pub order_id: String,
    pub amount_cents: u64,
}

#[subscribe(topic = "orders.created", durable = "billing")]
async fn on_order_created(actor: Box<dyn Actor>, event: OrderCreated) -> photon::Result<()> {
    tracing::info!(actor = actor.label(), order = %event.order_id, cents = event.amount_cents);
    Ok(())
}

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let photon = Photon::builder().auto_registry().build()?;
    photon.start_executor(Arc::new(JsonIdentityFactory))?;

    OrderCreated {
        order_id: "ord-1".into(),
        amount_cents: 9900,
    }
    .publish_on(&photon)
    .await?;
    Ok(())
}
Spectra schemaSpectra
Declarative metrics + event schemas
use spectra_macros::{spectra_metric, spectra_schema};

spectra_schema! {
    RequestDebugLog {
        store: "default",
        table: "request_debug_log",
        version: "0.1.0",
        description: "Structured debug events for request tracing",
        fields: [
            message: {
                r#type: String,
                classification: { pii: false, safe_for_console: true },
            },
        ],
    }
}

spectra_metric! {
    CacheHits {
        store: "default",
        name: "cache_hits",
        version: "0.1.0",
        description: "Counter for cache hit events",
    }
}
Gluon app + domainGluon
Create an application and attach a hostname
use gluon::applications::{
    ApplicationService, ContainerConfigSpec, CreateApplicationParams, HealthCheckSpec,
};
use gluon::domain::attach_hostname;
use gluon::generated::{GluonApplicationAppKind, GluonDomainZone};

let app = ApplicationService::create(
    valence,
    CreateApplicationParams {
        name: "marketing".into(),
        image_ref: "ghcr.io/acme/marketing:latest".into(),
        app_kind: GluonApplicationAppKind::Service,
        container: ContainerConfigSpec {
            container_port: 8080,
            ..Default::default()
        },
        health_check: Some(HealthCheckSpec {
            endpoint: "/health".into(),
            ..Default::default()
        }),
        lb: None,
        route: None,
        desired_instances: 2,
        target_node_id: None,
        metadata_json: serde_json::json!({}),
    },
)
.await?;

let zone = GluonDomainZone::get("zone:example.com", valence)
    .await?
    .expect("zone");
attach_hostname(valence, &app, &zone, "app.example.com").await?;
Nucleus stacksNucleus
Postgres and Redis in two regions, then shard
use nucleus::provision::{provision, EngineStrategy, ProvisionPolicy};
use nucleus::reconcile::reconcile_all_stacks;
use nucleus::shards::add_shard;

// us_east_cell / eu_west_cell: GluonCellCloudPlacement rows for those regions
let postgres = provision(
    valence,
    EngineStrategy::Postgres,
    ProvisionPolicy {
        logical_name: "orders-pg".into(),
        replica_count: 2,
    },
    Some(&us_east_cell),
)
.await?;

let _redis = provision(
    valence,
    EngineStrategy::Redis,
    ProvisionPolicy {
        logical_name: "orders-cache".into(),
        replica_count: 3,
    },
    Some(&eu_west_cell),
)
.await?;

add_shard(valence, &postgres).await?;
reconcile_all_stacks(valence).await?;
Orbital shellOrbital
OrbitalTemplate + Card on Leptos
use leptos::prelude::*;
use orbital::OrbitalTemplate;
use uf_product::components::{Card, CardContent, CardHeader, Subtitle1};
use uf_product::primitives::Button;

#[component]
fn App() -> impl IntoView {
    view! {
        <OrbitalTemplate>
            <Card>
                <CardHeader>
                    <Subtitle1>"Account"</Subtitle1>
                </CardHeader>
                <CardContent>"Signed-in settings use the same tokens as marketing."</CardContent>
                <Button>"Save"</Button>
            </Card>
        </OrbitalTemplate>
    }
}
Higgs + BosonHiggs
Server function enqueues a task; the task rebuilds the user
use boson_core::ExecutionContext;
use boson_macros::task;
use boson_valence_identity::valence_from_context;
use higgs::{require_session, Higgs};
use leptos::prelude::*;

#[server]
async fn queue_profile_rebuild() -> Result<(), ServerFnError> {
    let session = require_session().await?;
    let ctx = Higgs::from_request().await?;
    let valence = ctx.valence().map_err(ServerFnError::new)?;
    let user_id = valence
        .actor()
        .user_id()
        .unwrap_or(&session.user_id)
        .to_string();

    RebuildProfile::send_with(
        serde_json::json!({ "User": { "user_id": user_id } }),
        RebuildProfileParams {
            user_id: user_id.clone(),
        },
    )
    .await
    .map_err(ServerFnError::new)?;
    Ok(())
}

#[task(name = "rebuild_profile")]
async fn rebuild_profile(
    ctx: Box<dyn ExecutionContext>,
    user_id: String,
) -> boson_core::Result<()> {
    // Same user as the server function. Chronon scripts and Photon
    // subscribers rebuild context from the same ValenceFactory.
    let valence = valence_from_context(ctx.as_ref())?;
    tracing::info!(rebuilt_user = valence.actor().user_id(), %user_id);
    Ok(())
}