OKR.ai Cloud on AWS

OKR.ai Cloud is a serverless data store for workspaces that would rather not run a database. The stack is in the repository, so you can deploy it to your own AWS account and keep it under your control.

The version hosted by OKR.ai is in private preview. Self-hosting needs none of this page: every other database works without it.

What it deploys

infra/aws is an AWS SAM stack, deployed once per region a workspace can choose:

  • one REST endpoint, POST /rpc, protected by an API-key usage plan;
  • a Node 22 Lambda;
  • a DynamoDB table with point-in-time recovery;
  • a private S3 bucket for large files.

Each region is an independent copy with its own table and bucket, so a workspace’s data stays in the region its admin picked. Before it connects, the app checks that the region the endpoint reports matches the one chosen, so a mis-pasted URL can’t put data in the wrong place.

Regions

RegionCode
N. Virginiaus-east-1
Oregonus-west-2
Irelandeu-west-1
Frankfurteu-central-1
Mumbaiap-south-1
Singaporeap-southeast-1
Sydneyap-southeast-2

Regions you haven’t deployed show as “not set up” on the region map in the Database panel.

Deploy

You need the AWS and SAM CLIs, signed in.

# Every region, one shared API key
$ infra/aws/deploy-regions.sh

# Only some regions; set OKRAI_CLOUD_KEY first to reuse an existing key
$ OKRAI_CLOUD_KEY=... infra/aws/deploy-regions.sh eu-central-1 ap-south-1

The script prints, and writes to the git-ignored infra/aws/cloud.env, the lines to add to the app’s environment:

OKRAI_CLOUD_URL_EU_CENTRAL_1=https://xxxx.execute-api.eu-central-1.amazonaws.com/prod
OKRAI_CLOUD_KEY=...

One region by hand

$ cd infra/aws/lambda && npm ci && npm run build && cd ..
$ sam deploy --guided --region eu-central-1

Pass the same ApiKeyValue to each region, or leave it empty and read the generated key with aws apigateway get-api-key --api-key <ApiKeyId output> --include-value.

Moving regions

Moving a workspace to another region copies its data across. The old copy stays until you delete it.

The 15-person free tier

The Lambda enforces unique emails and a limit of 15 people per workspace. Adding a 16th returns HTTP 402, and the app shows the pricing screen. A workspace can move to its own database at any time, where there is no limit.

Key design

The DynamoDB key design is documented in schema/dynamodb.md in the repository.

Report a bug

What would you like to send?

Sent privately to the OKR.ai team, with this page’s address.