Skip to content

Commit 4cb5e51

Browse files
authored
Merge pull request #203117 from Rodrigossz/main
Sync on Bkp and resilience
2 parents 29125a1 + e3839b1 commit 4cb5e51

File tree

1 file changed

+46
-7
lines changed

1 file changed

+46
-7
lines changed

articles/cosmos-db/analytical-store-introduction.md

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -386,21 +386,60 @@ To learn more, see [how to configure analytical TTL on a container](configure-sy
386386

387387
Data tiering refers to the separation of data between storage infrastructures optimized for different scenarios. Thereby improving the overall performance and cost-effectiveness of the end-to-end data stack. With analytical store, Azure Cosmos DB now supports automatic tiering of data from the transactional store to analytical store with different data layouts. With analytical store optimized in terms of storage cost compared to the transactional store, allows you to retain much longer horizons of operational data for historical analysis.
388388

389-
After the analytical store is enabled, based on the data retention needs of the transactional workloads, you can configure the transactional store Time-to-Live (TTTL) property to have records automatically deleted from the transactional store after a certain time period. Similarly, the analytical store Time-to-Live (ATTL) allows you to manage the lifecycle of data retained in the analytical store independent from the transactional store. By enabling analytical store and configuring TTL properties, you can seamlessly tier and define the data retention period for the two stores.
389+
After the analytical store is enabled, based on the data retention needs of the transactional workloads, you can configure `transactional TTL` property to have records automatically deleted from the transactional store after a certain time period. Similarly, the `analytical TTL` allows you to manage the lifecycle of data retained in the analytical store, independent from the transactional store. By enabling analytical store and configuring transactional and analytical `TTL` properties, you can seamlessly tier and define the data retention period for the two stores.
390+
391+
> [!NOTE]
392+
> When `analytical TTL` is bigger than `transactional TTL`, your container will have data that only exists in analytical store. This data is read only and currently we don't support document level `TTL` in analytical store. If your container data may need an update or a delete at some point in time in the future, don't use `analytical TTL` bigger than `transactional TTL`. This capability is recommended for data that won't need updates or deletes in the future.
393+
394+
> [!NOTE]
395+
> If your scenario doen't demand physical deletes, you can adopt a logical delete/update approach. Insert in transactional store another version of the same document that only exists in analytical store but needs a logical delete/update. Maybe with a flag indicating that it's a delete or an update of an expired document. Both versions of the same document will co-exist in analytical store, and your application should only consider the last one.
396+
397+
398+
## Resilience
399+
400+
Analytical store relies on Azure Storage and offers the following protection against physical failure:
401+
402+
* Single region Azure Cosmos DB database accounts allocate analytical store in Locally Redundant Storage (LRS) Azure Storage accounts.
403+
* If any geo-region replication is configured for the Azure Cosmos DB database account, analytical store is allocated in Zone-Redundant Storage (ZRS) Azure storage accounts.
390404

391405
## Backup
392406

393-
Currently analytical store doesn't support backup and restore, and your backup policy can't be planned relying on that. For more information, check the limitations section of [this](synapse-link.md#limitations) document. While continuous backup mode isn't supported in database accounts with Synapse Link enabled, periodic backup mode is.
407+
Although analytical store has built-in protection against physical failures, backup can be necessary for accidental deletes or updates in transactional store. In those cases, you can restore a container and use the restored container to backfill the data in the original container, or fully rebuild analytical store if necessary.
394408

395-
With periodic backup mode and existing containers, you can:
409+
> [!NOTE]
410+
> Currently analytical store isn't backuped and can't be restored, and your backup policy can't be planned relying on that.
411+
412+
Synapse Link, and analytical store by consequence, has different compatibility level with Azure Cosmos DB backup modes:
413+
414+
* Periodic backup mode is fully compatible with Synapse Link and these 2 features can be used in the same database account without any restriction.
415+
* Currently continuous backup mode isn't supported in database accounts with Synapse Link enabled.
416+
* Currently database accounts with continuous backup mode enabled can enable Synapse Link through a support case.
417+
* Currently new database accounts can be created with continous backup mode and Synapse Link enabled, using Azure CLI or PowerShell. Those two features must be turned on at the same time, in the exact same command that creates the database account.
418+
419+
### Backup Polices
396420

397-
### Fully rebuild analytical store when TTTL >= ATTL
421+
There two possible backup polices and to understand how it works, two details about Cosmos DB backups are very important:
422+
423+
* The original container is restored without analytical store in both backup modes.
424+
* Cosmos DB doesn't support containers overwrite from a restore.
425+
426+
Now let's see how to use backup and restores from the analytical store perspective.
427+
428+
#### Restoring a container with TTTL >= ATTL
398429

399-
The original container is restored without analytical store. But you can enable it and it will be rebuild with all data that existing in the container.
430+
When `transactional TTL` is equal or bigger than `analytical TTL`, all data in analytical store still exists in transactional store. In case of a restore, you have two possible situations:
431+
* To use the restored container as a replacement for the original container. To rebuild analytical store, just enable Synapse Link at account level and container level.
432+
* To use the restored container as a data source to backfill or update the data in the original container. In this case, analytical store will automatically reflect the data operations.
400433

401-
### Partially rebuild analytical store when TTTL < ATTL
434+
#### Restoring a container with TTTL < ATTL
402435

403-
The data that was only in analytical store isn't restored, but it will be kept available for queries as long as you keep the original container. Analytical store is only deleted when you delete the container. Your analytical queries in Azure Synapse Analytics can read data from both original and restored container's analytical stores. Example:
436+
When `transactional TTL` is smaller than `analytical TTL`, some data only exists in analytical store and won't be in the restored container. Again your have two possible situations:
437+
* To use the restored container as a replacement for the original container. In this case, when you enable Synapse Link at container level, only the data that was in transactional store will be included in the new analytical store. But please note that the analytical store of the original container remains available for queries as long as the original container exists. You may want to change your application to query both.
438+
* To use the restored container as a data source to backfill or update the data in the original container:
439+
* Analytical store will automatically reflect the data operations for the data that is in transactional store.
440+
* If you re-insert data that was previously removed from transactional store due to `transactional TTL`, this data will be duplicated in analytical store.
441+
442+
Example:
404443

405444
* Container `OnlineOrders` has TTTL set to one month and ATTL set for one year.
406445
* When you restore it to `OnlineOrdersNew` and turn on analytical store to rebuild it, there will be only one month of data in both transactional and analytical store.

0 commit comments

Comments
 (0)