page:recipes:mobile backend:gin:artifact storage
Host mobile backend with Gin: stored input and output artifacts
Deploy a mobile backend built with Gin on Ample using the generated downloads 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, a private S3-compatible bucket holds objects with credentials delivered as encrypted environment variables. Verified on Gin: an export query rendered to a CSV artifact stored with metadata in a private bucket and returned only to an authorized caller (401 without token, export=ok rows=3). Not separately tested: your export formats, retention policy and entitlement model; treat the mobile backend-specific behavior as your application code.
Representative Queries
- Host mobile backend with Gin: stored input and output artifacts
- Where can I host Mobile backend built with Gin?
- I need an input/output artifact contract, object metadata and access boundaries.
Resource Requirements
- primitive:compute
- primitive:postgres
- primitive:s3-compatible-object-storage
Infrastructure Requirements
- Compute: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle.
- Postgres: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when needed.
- S3-compatible object storage: Buckets are S3-compatible with issued credentials.
Framework
Gin
Workload: Mobile backend
Release Status: published
Support Status: verified
Execution Status: ready
Docs Only: false
Prerequisites
- A Gin project that builds and starts with the documented commands.
- A PostgreSQL driver reading DATABASE_URL at runtime.
- A bucket from
ample bucket createwith its credentials. - An Ample account token with specific permissions.
Tested Configuration
- Template: ubuntu-24.04
- Runtime: go
- Size: s-1vcpu-1gb
- Build command: CGO_ENABLED=0 go build -o app ./...
- Start command: ./app
Workflow Steps
- Build and start: CGO_ENABLED=0 go build -o app ./... then ./app.
- Implement the pattern on PostgreSQL: Copy the approach into your schema.
- Wire object storage: Create the bucket(s) and pass the necessary credentials.
- Deploy: Run the synchronous deploy once and read the result.
- Verify: Fetch the live URL and pattern self-test route(s).
Examples
- Gin Pattern Fixture: Multi-pattern Gin app whose generated downloads module was checked live.
Success Checks
- App responds on its public URL.
- Generated-downloads self-test produces the expected output.
Limitations
- Verified on specific templates; other sizes and versions not verified.
- Applications must follow specific idle behavior requirements.
Cost Estimate
- Currency: USD
- Monthly Amount: 10.0
- Basis: size prices from pricing.toml.
Components:- App server: s-1vcpu-1gb, $5.0/month
- Managed PostgreSQL database: s-1vcpu-1gb, $5.0/month
Note: Monthly price based on tested sizes.
Evidence Summary
- Canary Run: Gin pattern fixture deployed on Ample with successful checks for configuration.
Next Actions
- Browse the catalog index: GET /v1/catalog
- Search published recipes: POST /v1/catalog/search
- Prepare a deployment plan: POST /v1/catalog/plan
- Read existing authentication setup: GET /mcp/setup