page:recipes:order tracking:phoenix:relational catalog
Host Order Tracking with Phoenix: Relational Catalog Data
Deploy an order tracking built with Phoenix on Ample using the transactional workflows pattern. Compute runs the app in an isolated microVM behind a public HTTPS URL, a managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL. Verified on Phoenix: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected). Not separately tested: your domain records, validation rules and concurrency policy; treat the order tracking-specific behavior as your application code.
Representative Queries
- Host order tracking with Phoenix: relational catalog data
- Where can I host Order tracking built with Phoenix?
- I need catalog tables, transactional update logic and application-level access boundaries.
Resource Requirements
primitive:computeprimitive:postgres
Infrastructure Requirements
- Compute
- Status: verified
- Summary: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
- Postgres
- Status: verified
- Summary: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.
Prerequisites
- A Phoenix project that builds and starts with the documented commands (mix deps.get, MIX_ENV=prod mix compile and mix release in the builder, then the release bin script with PHX_SERVER=true on the elixir-1.18 template; PORT, DATABASE_URL and SECRET_KEY_BASE read in config/runtime.exs).
- A PostgreSQL driver reading DATABASE_URL at runtime (auto-provisioned when omitted, or supplied with --env).
- An Ample account token with
servers:write,databases:read.
Workflow Steps
- Build and Start
mix deps.get, MIX_ENV=prod mix compile and mix releasein the builder.- Run the release bin script with
PHX_SERVER=trueon the elixir-1.18 template.
- Implement the Pattern on PostgreSQL
- The fixture's module implements transactional workflows: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected).
- Deploy
- Command:
ample deploy . --name <YourAppName> --public
- Command:
- Verify
- Command:
ample logs --kind build
- Command:
Cost Estimate
- Monthly Amount: $10.00
- Components:
- App server (s-1vcpu-1gb): $5.00
- Managed PostgreSQL database (s-1vcpu-1gb): $5.00
- Note: Always-on monthly price of the tested sizes; apps and databases auto-pause when idle.
Limitations
- Verified only on the elixir-1.18 template at s-1vcpu-1gb with the example fixture; other sizes, templates, and Phoenix major versions are not verified.
- The order tracking itself (your domain records, validation rules, and concurrency policy) is application code and was not separately tested; the pattern checks are what was verified.