Skip to main content

DynamoDB Schema

Amazon DynamoDB is a NoSQL database service designed for high-performance, scalable, and low-latency applications.

In a DynamoDB table, the primary key is a fundamental component of the database schema, used to uniquely identify and organize items within a table. The primary key consists of two attributes: the partition key (PK) and the sort key (SK). The partition key is the primary attribute used to distribute data across multiple partitions for scalability.

The table may also include Global Secondary Indexes named using the prefix (GSI) which can be employed to facilitate efficient querying of data based on different attributes.

Multi-Tenant

When an entity is stored for a specific SiteId other than the default site, the format of the PK is prefixed with SiteId/.

For example: When using a siteId of finance, the PK will store a document using finance/docx#.

Sites

The following are the entities related to Sites.

Sites

The Sites Entity

Entity Key Schema

AttributesFormat
PK"sites"
SK"sites#" + siteId
GSI1PK"sites"
GSI1SK"sites#" + status + "#" + siteId

Entity Attributes

AttributesDescription
siteIdSite Id
titleSite Title
statusSite Status (ACTIVE / INACTIVE)

Group Permissions

The Group to Sites permissions mapping.

Entity Key Schema

AttributesFormat
PK"sitegroups"
SK"group#" + groupName + "#site#" + siteId
GSI1PK"sitegroups"
GSI1SK"site#" + siteId + "#group#" + groupName

Entity Attributes

AttributesDescription
groupNameName of Group
siteIdSite Id
permissionsList of Group permissions for site

Documents

The following are the entities related to Documents.

Document

The Document Entity consists of attributes that capture essential information about a document.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"document"
GSI1PKShortDate(yyyy-MM-ddd)
GSI1SKFullDate("yyyy-MM-dd'T'HH:mm:ssZ") + "#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
inserteddateInserted Date
lastModifiedDateLast Modified Date
userIdCreate by user
pathDocument path
deepLinkPathDocument deep link path
metadataKey / Value with Key starting with "md#"
contentTypeMime Content Type
contentLengthContent Length
checksumDocument content checksum
checksumTypeDocument content checksum type
s3versionDocument Content S3 version

Child Document

A Child Document Entity includes attributes that capture details specific to the subsidiary document.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"document#" + childDocumentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
belongsToDocumentIdParent Id of document

Document (Soft Delete)

A "soft delete" Document is moved into a different PK namespace than all other documents.

Entity Key Schema

AttributesFormat
PK"softdelete#docs#"
SK"softdelete#document" + documentId
GSI1PKShortDate(yyyy-MM-ddd)
GSI1SKFullDate("yyyy-MM-dd'T'HH:mm:ssZ") + "#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
inserteddateInserted Date
lastModifiedDateLast Modified Date
userIdCreate by user
pathDocument path
deepLinkPathDocument deep link path
contentTypeMime Content Type
checksumDocument content checksum
tagSchemaIdTag Schema for document

Document OCR

Contains all information about any optical character recognition (OCR) data for the document.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"ocr#"

Entity Attributes

AttributesDescription
documentIdDocument Identifier
inserteddateInserted Date
userIdCreate by user
contentTypeMime Content Type
ocrEngineOcr Engine Used (textract, tesseract)
ocrStatusOcr Status (failed, requested, skipped, successful)
jobIdOcr Job Id
ocrOutputTypeOcr Output Type (CSV)

Document Actions

Schema for Document Actions.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"action#" + idx + "#" + type
GSI1PK"action#" + type + "#" + queueId
GSI1SK"action#" + documentId + "#" + yyyy-MM-dd'T'HH:mm:ssZ
GSI2PK"actions#" + status
GSI2SK"action#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
typeType of Action
statusStatus of Action
parametersParameters for Action
metadataMetadata for Action
userIdCreate by user
inserteddateInserted Date
startDateStart Date of action
completedDateCompleted Date
messageAction message
queueIdQueue Id
workflowIdWorkflow Id
workflowStepIdWorkflow Step Id
workflowLastStepWorkflow Last Step

Document Sync

Schema for Document Sync Events.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"syncs#" + yyyy-MM-dd'T'HH:mm:ssZ
GSI1PK"doc#syncs#" + service + "#" + status + "#"
GSI1SK"sync#" + type + "#" + yyyy-MM-dd'T'HH:mm:ssZ + "#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
serviceService synced to
syncDateSync Date
userIdCreate by user
statusStatus of Sync
typeType of data synced
messagesync message

Document Tag

Document Tag(s) entity.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"tags#" + tagKey
GSI1PK"tag#" + tagKey + "#" + tagValue
GSI1SK"yyyy-MM-dd'T'HH:mm:ssZ" + "#" + documentId
GSI2PK"tag#" + tagKey
GSI2SKtagValue + "#" + yyyy-MM-dd'T'HH:mm:ssZ + "#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
typeType of Tag
tagValueTag Value
userIdCreate by user
inserteddateInserted Date

Document Tag (Multi-Value)

Document Tag(s) entity with multiple values.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"tags#" + tagKey + "#idx" + index
GSI1PK"tag#" + tagKey + "#" + tagValue
GSI1SK"yyyy-MM-dd'T'HH:mm:ssZ" + "#" + documentId
GSI2PK"tag#" + tagKey
GSI2SKtagValue + "#" + yyyy-MM-dd'T'HH:mm:ssZ + "#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
typeType of Tag
tagValueTag Value
tagValuesTag Values
userIdCreate by user
inserteddateInserted Date

Document Attribute

Document Attribute entity.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"attr#" + key + "#" + value
GSI1PK"doc#attr#" + key
GSI1SKvalue
GSI2PK"docs#" + documentId
GSI2SK"attr#" + valueType + "#" + key

Entity Attributes

AttributesDescription
documentIdDocument Identifier
keyattribute key
indexattribute index
valueTypeType of Attribute (string, number, boolean, watermark (GSI2), publication)
stringValuestring value
numberValuenumber value
booleanValueboolean value

Document Publication

Document Publication entity.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"publication"

Entity Attributes

AttributesDescription
pathDocument Path
contentTypeDocument Content-Type
s3VersionDocument S3 Version Key
documentIdDocument Identifier
userIdCreate by user

Document User Activity

Document User Activities refers to the tracking and logging of actions performed on documents within a system.

These activities typically include operations such as CREATE, VIEW, DELETE, and MODIFY, allowing administrators or users to monitor the lifecycle and interactions with documents.

This tracking provides visibility into who accessed or altered a document, when the action occurred, and what changes were made. Document Activities are crucial for auditing, security, compliance, and overall document management, ensuring accountability and transparency in document usage.

note

These attributes are stored in the "versions" DynamoDB table.

Document Activity

The main document user activity tracking record. Depending on the type of document activity, the versionPk, versionSk refers to the record associated with the activity.

Entity Key Schema

AttributesFormat
PK"doc#" + documentId
SK"activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ
GSI1PK"activity#user#" + username
GSI1SK"activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + documentId
GSI2PK"activity#"
GSI2SK"activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
typeType of User Activity (view, add, change, delete)
userIdCreate by user
versionPkPK key for version table
versionSkSK key for version table
inserteddateInserted Date

Document Metadata

Document Metadata refers to the metadata information attached to the document.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"doc#" + yyyy-MM-dd'T'HH:mm:ss

Entity Attributes

AttributesDescription
documentIdDocument Identifier
pathDocument path
inserteddateInserted Date
lastModifiedDateLast Modified Date
deepLinkPathDocument deep link path
metadataKey / Value with Key starting with "md#"

Document Version

Document Version Tracking refers to the process of recording and managing changes made to the content of a document over time. Each time a document is edited or updated, a new version is created, allowing users to track and compare previous iterations of the document.

Entity Key Schema

AttributesFormat
PK"docs#" + documentId
SK"document#" + yyyy-MM-dd'T'HH:mm:ss

Entity Attributes

AttributesDescription
contentTypeMime Content Type
contentLengthMime Content Type
checksumDocument content checksum
checksumTypeDocument content checksum type
s3versionDocument Content S3 version

Document Attribute Version

Document Attribute Tracking refers to the monitoring and recording of changes made to the metadata or properties associated with a document.

Entity Key Schema

AttributesFormat
PK"doc#" + documentId
SK"attr#" + key + "#" + yyyy-MM-dd'T'HH:mm:ss + "#" + value

Entity Attributes

AttributesDescription
archive#SK"attr#" + key + "#" + value
documentIdDocument Identifier
keyattribute key
indexattribute index
valueTypeType of Attribute (string, number, boolean, publication)
stringValuestring value
numberValuenumber value
booleanValueboolean value

Attributes

The Attributes Entity consists of attributes that capture essential information about a document.

Entity Key Schema

AttributesFormat
PK"attr#" + key
SK"attribute"
GSI1PK"attr#"
GSI1SK"attr#" + key
GSI2PK"attr#"
GSI2SK"attr#" + dataType

Entity Attributes

AttributesDescription
documentIdAttribute Key
typeAttribute Type (IE: OPA)
dataTypeData Type (STRING, NUMBER, BOOLEAN, KEY_ONLY, WATERMARK, PUBLICATION )
keyAttribute key
isInUseIs Attribute in use
watermarkTextWatermark Text

Schema

The Schema Entity consists of attributes configurations.

Site Entity Schema

Entity Key Schema

AttributesFormat
PK"schemas"
SK"site#" + entity

Entity Attributes

AttributesDescription
nameName of Schema
schemaSchema JSON document

Site Composite Key

Entity Key Schema

AttributesFormat
PK"schemas"
SK"compositeKey#" + UUID
GSI1PK"schemas#compositeKey"
GSI1SK"key#" + keys

Entity Attributes

AttributesDescription
keysList of Keys

Site Attribute Key

Entity Key Schema

AttributesFormat
PK"schemas"
SK"attr#" + key
GSI1PK"attr#" + key
GSI1SK"true"

Attribute Allowed Values

A searchable key for an attributes allowed values in a Site Schema.

Entity Key Schema

AttributesFormat
PK"schemas"
SK"attr#" + key + "#allowedvalue#" + value
GSI1PK"attr#" + key + "#allowedvalue"
GSI1SK"val#" + value

Classification

The Classification Entity attributes.

Classification Entity

Entity Key Schema

AttributesFormat
PK"schemas#" + documentId
SK"class#" + entity
GSI1PK"class#" + entity
GSI1SK"attr#" + name

Entity Attributes

AttributesDescription
nameName of Classification
documentIdClassification Identifier
schemaSchema JSON document

Classification Composite Key

Entity Key Schema

AttributesFormat
PK"schemas#" + documentId
SK"compositeKey#" + UUID
GSI1PK"schemas#compositeKey"
GSI1SK"key#" + keys

Entity Attributes

AttributesDescription
documentIdClassification Identifier
keysList of Keys

Site Attribute Key

Entity Key Schema

AttributesFormat
PK"schemas#" + documentId
SK"attr#" + key
GSI1PK"attr#" + key
GSI1SK"true"

Attribute Allowed Values

A searchable key for an attributes allowed values in a Classification

Entity Key Schema

AttributesFormat
PK"schemas#" + documentId
SK"attr#" + key + "#allowedvalue#" + value
GSI1PK"attr#" + key + "#allowedvalue"
GSI1SK"val#" + value

Document Shares

The following are the entities related to sharing of Documents.

Shares

A list of shares for a particular user role.

Entity Key Schema

AttributesFormat
PK"shares#" + (group/user) + "#" + name
SK"share#" + siteId + "#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
typeType of Share (File or Directory)
inserteddateInserted Date
userIdCreate by user
pathFolder path
nameName of share
siteIdSiteId share is part of
permissionTypeType of permission
permissionsList of permissions

Document Share

A list of shares for a particular user role.

Entity Key Schema

AttributesFormat
PK"shares#" + documentId
SK"share"
GSI1PK"share#" + name
GSI1SK"share#" + path + "#" + documentId

Entity Attributes

AttributesDescription
documentIdShare Identifier
sharedDocumentIdShared Document Id
nameName of share
typeType of Share (File or Directory)
inserteddateInserted Date
userIdCreate by user
pathFolder path
siteIdSiteId share is part of
permissionTypeType of permission
permissionsList of permissions

Document Folder

Document folder / file listing index.

Entity Key Schema

AttributesFormat
PK"global#folders#" + parentDocumentId
SK"ff#" + path OR "fi#" + path
GSI1PK (folder only)"folder#" + documentId
GSI1SK (folder only)"folder"

Entity Attributes

AttributesDescription
documentIdShare Identifier
pathFolder path
typeType of Share (File or Directory)
parentDocumentIdParent Document Id
inserteddateInserted Date
lastModifiedDateLast Modified Date
userIdCreate by user

Queue

Queue entity object.

Entity Key Schema

AttributesFormat
PK"queues#" + documentId
SK"queue"
GSI1PK"queues#"
GSI1SK"queue#" + name + "#" + documentId

Entity Attributes

AttributesDescription
documentIdShare Identifier
nameName of Queue

Workflows

The following are the entities related to Workflows.

Workflow

The workflow entity consists of attributes that capture essential information about a workflow.

Entity Key Schema

AttributesFormat
PK"workflows#" + documentId
SK"workflow"
GSI1PK"workflows#"
GSI1SK"workflow#" + name + "#" + documentId
GSI2PK"workflows#"
GSI2SK"workflow#" + status + "#" + name + "#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
nameName of Workflow
inUseWhether Workflow is in use
statusWorkflow status
descriptionWorkflow description
userIdCreate by user
jsonWorkflow JSON blob

Document Workflow

The document workflow entity consists of attributes that capture essential information about a document in a workflow.

Entity Key Schema

AttributesFormat
PK"wfdoc#" + documentId
SK"wf#" + workflowId
GSI1PK"wfdoc#" + documentId
GSI1SK"wf#" + workflowName + "#" + workflowId
GSI2PK"wf#" + workflowId
GSI2SK"wfdoc#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
workflowIdWorkflow identifier
workflowNameWorkflow name
statusWorkflow status
actionPkAction PK
actionSkAction SK
currentStepIdCurrent Workflow step Id

Case Management

The following are the entities related to Case Management.

Case

The Case Entity consists of attributes that capture essential information about a case.

Entity Key Schema

AttributesFormat
PK"case#" + caseId
SK"case"
GSI1PK"case#"
GSI1SK"case#" + caseId

Entity Attributes

AttributesDescription
documentIdCase Identifier
nameCase Name
descriptionCase Description
statusCase Status
caseNumberCase Number
documentNumberDocument Number
metadataCase Metadata
inserteddateInserted Date
startDateStart Date
endDateEnd Date

Task

The Case Entity consists of attributes that capture essential information about a task.

Entity Key Schema

AttributesFormat
PK"case#" + caseId
SK"task#" + taskId

Entity Attributes

AttributesDescription
documentIdTask Identifier
caseIdCase Identifier
nameTask Name
descriptionTask description
statusTask Status
metadataTask Metadata
inserteddateInserted Date
startDateStart Date
endDateEnd Date

Nigo

The Case Entity consists of attributes that capture essential information about a nigo.

Entity Key Schema

AttributesFormat
PK"case#" + caseId
SK"nigo#" + nigoId

Entity Attributes

AttributesDescription
documentIdNigo Identifier
caseIdCase Identifier
nameNigo name
descriptionNigo description
statusNigo Status
metadataNigo Metadata
inserteddateInserted Date
startDateStart Date
endDateEnd Date

Document

The Document Entity consists of attributes that capture essential information about a document attached to a Case / Task / Nigo.

Entity Key Schema

AttributesFormat
PK"case#" + caseId
SK"doc#" + type + "#" + objectId + "#" + documentId

Entity Attributes

AttributesDescription
documentIdDocument Identifier
caseIdCase Identifier
objectIdCase / Task / Nigo Identifier
typeDocument Type (Case / Task / Nigo)
inserteddateInserted Date

Rulesets

The following are the entities related to Rulesets.

Ruleset

The Ruleset Entity consists of attributes that capture essential information about a ruleset.

Entity Key Schema

AttributesFormat
PK"rulesets"
SK"ruleset#" + status + "#" + priority + "#" + rulesetId
GSI1PK"ruleset#"
GSI1SK"ruleset#" + rulesetId

Entity Attributes

AttributesDescription
documentIdRuleset Identifier
descriptionRuleset description
versionRuleset version
priorityRuleset priority
statusRuleset status

Rule

The Rule Entity consists of attributes that capture essential information about a rule.

Entity Key Schema

AttributesFormat
PK"ruleset#" + rulesetId
SK"rule#" + ruleId
GSI1PK"ruleset#" + rulesetId
GSI1SK"rule#" + priority + "#" + ruleId
AttributesFormat
PK"ruleset#"
SK"rule#" + status + "#" + rulesetId + "#" + priority + "#" + ruleId
GSI1PK"ruleset#" + rulesetId
GSI1SK"rule#" + ruleId

Entity Attributes

AttributesDescription
rulesetIdRuleset Identifier
documentIdRule Identifier
descriptionRule description
priorityRule priority
workflowIdWorkflow to run on match
conditionsRule conditions
statusRules status

Mappings

The following are the entities related to Mappings.

Mapping

The Mapping Entity consists of attributes that capture essential information about a mapping.

Entity Key Schema

AttributesFormat
PK"mappings#" + documentId
SK"mapping"
GSI1PK"mappings#"
GSI1SK"mapping#" + name

Entity Attributes

AttributesDescription
documentIdMapping Identifier
nameMapping name
descriptionMapping description
attributesMapping attributes

API Keys

Api Key(s) allow access to API.

Entity Key Schema

AttributesFormat
PK"apikeys#"
SK"apikey#" + apiKey
GSI1PKsiteId + "/apikeys#"
GSI1SK"apikey#" + name + apiKey
GSI2PKsiteId/"apikeys#"
GSI2SK"apikey#" + apiKey (mask)

Entity Attributes

AttributesDescription
apiKeyAPI Key
nameAPI Key Name
userIdCreate by user
siteIdSite Identifier
permissionsList of API Key permissions (read/write/delete)
inserteddateInserted Date

Entity Event Sourcing

Storage of entity events

Entity Event Sourcing Key Schema

AttributesFormat
PK"entityevent#" + entityType + "#" entityId
SK"ev#" + Timestamp
GSI1PK"entityevent#" + entityType + "#" entityId
GSI1SK"ev#" + Type + "#" + Timestamp
GSI2PK"entityevent#userId" + userId
GSI2SK"ev# + Timestamp

Entity Event Sourcing Attributes

AttributesDescription
entityTypeType of Entity
entityIdEntity Identifier
typeEvent Type (HTTP_GET, HTTP_PUT, HTTP_PATCH, HTTP_POST, HTTP_DELETE)
payloadRequest Payload
metadataRequest Metadata
inserteddateInserted Date
userIdRequested User
TimeToLiveRecord Time to Live

Entities Types

Storage of entity types

Entity Key Schema

AttributesFormat
PK"entityType#" + documentId
SK"entityType"
GSI1PK"entityType#"
GSI1SK"entityType#" + namespace + "#" + name + "#"

Entity Attributes

AttributesDescription
documentIdEntity Type Identifier
namespaceEntity Type Namespace
nameEntity Type Name
inserteddateInserted Date

Entity

Storage of entity

Entity Key Schema

AttributesFormat
PK"entity#" + entityTypeId + "#" documentId
SK"entity"
GSI1PK"entity#" + entityTypeId
GSI1SK"entity#" + name + "#" + documentId

Entity Attributes

AttributesDescription
documentIdEntity Identifier
entityTypeIdEntity Type Identifier
nameEntity Name
inserteddateInserted Date
note

Entity attributes metadata are stored with the prefix of attr#

Locale

The storing of Locale information.

Locale List

The listing of all locale setup.

Entity Key Schema

AttributesFormat
PK"locale#"
SK"locale# + locale

Entity Attributes

AttributesDescription
localeLocale

Locale Type

Locale schema for the managing of Locale for Interface, Schema, Classification:

Fetch patterns include:

  • Get ALL values for a specific locale
  • Get Locale using
    • locale, interfaceKey
    • locale, schema, attributeKey
    • locale, classification, attributeKey

Entity Key Schema

AttributesFormat
PK"locale#type"
SKlocale + "#" + type + "#" + interfaceKey
locale + "#" + type + "#" + attributeKey + "#" + allowedValue
locale + "#" + type + "#" + classificationId + "#" + attributeKey + "#" + allowedValue

Entity Attributes

AttributesDescription
itemTypeType of Locale Resource
interfaceKeyInterface Key
attributeKeyAttribute Key
allowedValueAllowed Value
classificationIdClassification Id
localeLocale
localizedValueLocalized Value

Open Policy (OPA)

Open Policy Agent configuration.

Entity Key Schema

AttributesFormat
PK"controlpolicy#opa"
SK (FULL)"opa#full#" + siteId + "#policy"
SK (POLICY_ITEM)"opa#item#" + siteId + "#policy#" + index

Entity Attributes

AttributesDescription
siteIdSite Identifier
policyOPA Policy
typeOPA Policy Type
indexIndex