Knowledge Center

102 - The Archive Database at a Glance

Updated on

The Archive Database at a Glance

The eight tables Archive adds, the columns it adds to existing tables, and how they join.

Archive uses the same SQL database as core DMSync and adds eight tables. It also adds columns to Documents, Workspaces and Folders.

The eight tables

Table
What it holds

ArchiveRules
Criteria that drive automated archives
RestoreArchiveRulesCriteria that drive automated restores
DeleteArchiveRulesCriteria that drive automated deletions
ArchiveRequestsOne row per archive, restore or delete operation, whatever raised it
ArchiveAuditOne row per document processed, for archives and restores
DeleteArchiveAuditThe equivalent audit trail for deletions
ArchiveLocationsRegistered archive destinations
ArchiveProcessPermissionsA single row holding three global on/off switches

Note ArchiveProcessPermissions and DeleteArchiveAudit do not appear in the Quick Reference Guide or the Workflow Guide. Both are real and both matter.

How requests join to content

Archive requests and the content they touch

Primary keys are UID everywhere except ArchiveProcessPermissions.Id and DeleteArchiveAudit.Id. Only one foreign key is enforced in the entire Archive schema — ArchiveRules.ArchiveLocationId to ArchiveLocations.UID. Every other relationship is logical, so the database will not stop you writing an orphan.

How rules join to requests

The rules tables and the requests they raise

The joins you will actually use

-- a request and its audit trail

ArchiveAudit.ArchiveRequestUID = ArchiveRequests.UID

-- a request and the content it touched

Documents.ArchiveRequestId = ArchiveRequests.UID

Documents.RestoreRequestId = ArchiveRequests.UID

Documents.DeleteArchiveRequestId = ArchiveRequests.UID

-- the rule that raised a request

ArchiveRules.RuleName = ArchiveRequests.RuleName

-- deletions audit separately

DeleteArchiveAudit.DeleteRequestId = ArchiveRequests.UID

DeleteArchiveAudit.DeleteRuleId = DeleteArchiveRules.UID

Workspaces and Folders carry the same three request columns as Documents and join the same way.

Previous Article 101 - What DMSync Archive Does
Next Article 103 - How a Request Flows Through the System