Document Archival
- RavenDB documents can be archived;
archiving, and other features' usage of it, can ramp up database performance.
Most notably, the default behavior of indexing and of data subscriptions is to skip the processing of archived documents, so the number of indexed and transferred documents can be significantly reduced. - An archived document is marked as such by a metadata property,
@archived: true
, so database features, clients, and users would be able to recognize its status and handle it accordingly. Another important metadata property,@archive-at
, is added a time signature as a value and schedules the document for future archival. - In this page, we explain how to configure document archival using Studio.
Archival View: Enable Archival
Data Archival View
-
Click to open the settings view.
-
Click to open the Data Archival view.
-
Toggle to enable archiving on this ("sampleDB") database.
-
Toggle (available only when option #3 above is enabled) to provide the frequency by which RavenDB's archiving task scans the database for documents that need to be archived.
Default frequency: 60 seconds
-
Click to apply your settings.
-
Click for help using this view.
-
Click for Licensing info.
Document View: Archiving Properties
To schedule a document's archival time open the document view and edit the document you want to archive.
Document View: @archive-at Property
- Add this property to the document's metadata.
- Provide the archival time (
UTC
time) as a value (see an example here). - After adding the
@archive-at
property, the time that remains until the document is archived is displayed here.
Document View: @archived Property
-
The document is archived.
RavenDB replaced the@archive-at
flag with an@archived
flag, indicating that the document is now archived. -
Studio recognizes that the document is archived.
Documents List: Archived Icon
An icon was added to the icons list so archived documents can be recognized at a glance.
Database Settings: Archival Configuration Options
Open the Database Settings
view to set feature-specific archiving settings.
This is where different features, currently indexing and data subscriptions,
are taught how to handle archived documents.
Database Settings: Feature-Specific Archival Configuration
-
Click to enter text
Type "Archive" to list configuration options related to archiving.
The three related options are:
Auto Indexing Handling of Archived Documents
Static Indexing Handling of Archived Documents
Data Subscriptions Handling of Archived Documents -
Click to configure
Please edit configuration options only if you're sure you understand them.
Database Settings: Edit Configuration
- Click a feature-specific configuration option to edit its settings.
- Toggle to override the current configuration.
-
Select one of the three options.
ExcludeArchived
DO not process archived documentsIncludeArchived
Process archived documentsArchivedOnly
Process ONLY archived documents
- Save your configuration.
Index-Specific Archival Configuration
To set the way a specific index handles archived documents (overriding default server/database configuration), open the Index List view and select the index whose behavior you want to set, scroll down for the index properties and open the Archived Data tab.
Index Definition Archived Data Tab
- Click to open the Archived Data tab.
-
Click to determine how this index would handle archived documents.
Archived Docs Handling Options
Select how this index handles archived documents.
Default - Do not change the policy set by higher (database/server) configuration levels.
Exclude Archived - Do not process archived documents (this is the default configuration).
Include Archived - Process archived documents.
Archived Only - Process only archived documents.
Subscription-Specific Archival Configuration
To set the way a specific data subscription task handles archived documents (overriding default server/database configuration), open the Subscription Task view and create a new subscription.
Subscription Archived Data Processing Behavior
-
Click to select how this subscription handles archived documents.
Archived Docs Handling Options
Default - Do not change the policy set by higher (database/server) configuration levels.
Exclude Archived - Do not process archived documents (this is the default configuration).
Include Archived - Process archived documents.
Archived Only - Process only archived documents.
Data Export/Import Archival Configuration
To determine whether a data-export task would export archived documents, enter the task's configuration (by creating a new task or editing an existing one) and toggle the Include Archived Documents option as preferred.
Data Export Option
To determine whether a data-import task would import archived documents, enter the task's configuration (by creating a new task or editing an existing one) and toggle the Include Archived Documents option as you prefer.
Data Import Option