jpisaac commented on code in PR #13: URL: https://github.com/apache/phoenix-site/pull/13#discussion_r3162924547
########## app/pages/_docs/docs/_mdx/(multi-page)/features/view-ttl.mdx: ########## @@ -0,0 +1,102 @@ +--- +title: "View TTL" +description: "Per-view retention on top of a shared base table — different views can age data out on different schedules without splitting the table." +--- + +A Phoenix [view](/docs/features/views) is a logical table that shares a single physical +HBase table with its sibling views. **View TTL** lets each view define its **own** data +retention policy on top of that shared table. Rows that have outlived their view's TTL +disappear from queries against that view and are eventually removed in the background — +without affecting any other view (or the base table). Available in Phoenix 5.3.0 +([PHOENIX-6978](https://issues.apache.org/jira/browse/PHOENIX-6978)). + +## When to use it [#view-ttl-when] + +The classic case is **multi-tenant retention**: one shared base table, many tenant +views, each tenant gets a different retention window driven by its plan, region, or +contract. + +| Scenario | View TTL fit | +| ---------------------------------------------------------------- | ----------------------------------------------------- | +| Per-tenant retention windows on one shared base table | Yes | +| Per-use-case retention (e.g., "raw events 7 days, audit 1 year") | Yes | +| Same retention for the entire physical table | Use a regular table-level `TTL` instead | +| Retention based on row content rather than age | Use [Conditional TTL](/docs/features/conditional-ttl) | +| Different schemas per tenant | Use separate tables, not views | Review Comment: Different schemas per tenant - is also applicable for views, views allow extending the base table schema and defining their own columns. Separate tables are needed when the base table schema needs to be different. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
