DashboardsentryOrganizationOption as lightweight key-v…

OrganizationOption as lightweight key-value store for idempotency caching

Category: pattern
Confidence: 1.00
ID: 019d79a0-1b09-7e8b-91e2-d0b57ec2bd3d
Project ID: 702228c8-56bc-4694-8d5a-174ac2f29105
Cross-project: No
Recalled in other projects: 2
Source session: (none)
Created: 2026-07-30 15:46:04
Updated: 2026-07-30 15:46:04

Cross-Project Recalls

ProjectHitsLast recalled
opencode 1 8d ago
opencode-lore 1 2026-08-05

Content

Sentry's OrganizationOption (sentry.models.options.organization_option) provides org-scoped JSON key-value storage with built-in caching and no migration needed. Keys are limited to 64 characters. For idempotency keys (which can be arbitrarily long), hash them: stripe-projects:idem:<sha256[:16]> fits in ~40 chars. Lookup: OrganizationOption.objects.get_value(org, key, default=None). Write: OrganizationOption.objects.set_value(org, key, dict_value). Values persist as long as the org exists. This pattern avoids new models, Redis TTL concerns, and migrations. ProjectOption provides the same for project-scoped storage.

Move to: