
Designing the Subscriber Model for a SaaS Product
One of the most foundational parts of Hatchgrid is the subscriber model. From tagging to segmentation to automation — everything starts with how we store and manage subscribers.
Goals of the Model
- Support multi-tenancy (1 org, many subscribers)
- Enable tagging and segmentation
- Enforce row-level security for data isolation
- Track metadata (status, custom attributes)
Enum and RLS by Default
We use PostgreSQL with enums for subscriber_status (ENABLED, DISABLED, BLOCKLISTED) and RLS policies based on current_setting('hatchgrid.current_workspace') to isolate each creator’s data.
Tagging and Attributes
Subscribers are associated with tags via a many-to-many table. Attributes are stored as JSON to allow flexibility in extending without schema changes.
This structure allows us to ship fast while keeping things secure, scalable, and adaptable.
Share this article
Get more insights delivered to your inbox
Join the discussion
Comments coming soon...