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
Attributes | Format |
---|
PK | "sites" |
SK | "sites#" + siteId |
GSI1PK | "sites" |
GSI1SK | "sites#" + status + "#" + siteId |
Entity Attributes
Attributes | Description |
---|
siteId | Site Id |
title | Site Title |
status | Site Status (ACTIVE / INACTIVE) |
Group Permissions
The Group to Sites permissions mapping.
Entity Key Schema
Attributes | Format |
---|
PK | "sitegroups" |
SK | "group#" + groupName + "#site#" + siteId |
GSI1PK | "sitegroups" |
GSI1SK | "site#" + siteId + "#group#" + groupName |
Entity Attributes
Attributes | Description |
---|
groupName | Name of Group |
siteId | Site Id |
permissions | List 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
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "document" |
GSI1PK | ShortDate(yyyy-MM-ddd) |
GSI1SK | FullDate("yyyy-MM-dd'T'HH:mm:ssZ") + "#" + documentId |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
inserteddate | Inserted Date |
lastModifiedDate | Last Modified Date |
userId | Create by user |
path | Document path |
deepLinkPath | Document deep link path |
metadata | Key / Value with Key starting with "md#" |
contentType | Mime Content Type |
contentLength | Content Length |
checksum | Document content checksum |
checksumType | Document content checksum type |
s3version | Document Content S3 version |
Child Document
A Child Document Entity includes attributes that capture details specific to the subsidiary document.
Entity Key Schema
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "document#" + childDocumentId |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
belongsToDocumentId | Parent Id of document |
Document (Soft Delete)
A "soft delete" Document is moved into a different PK namespace than all other documents.
Entity Key Schema
Attributes | Format |
---|
PK | "softdelete#docs#" |
SK | "softdelete#document" + documentId |
GSI1PK | ShortDate(yyyy-MM-ddd) |
GSI1SK | FullDate("yyyy-MM-dd'T'HH:mm:ssZ") + "#" + documentId |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
inserteddate | Inserted Date |
lastModifiedDate | Last Modified Date |
userId | Create by user |
path | Document path |
deepLinkPath | Document deep link path |
contentType | Mime Content Type |
checksum | Document content checksum |
tagSchemaId | Tag Schema for document |
Document OCR
Contains all information about any optical character recognition (OCR) data for the document.
Entity Key Schema
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "ocr#" |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
inserteddate | Inserted Date |
userId | Create by user |
contentType | Mime Content Type |
ocrEngine | Ocr Engine Used (textract, tesseract) |
ocrStatus | Ocr Status (failed, requested, skipped, successful) |
jobId | Ocr Job Id |
ocrOutputType | Ocr Output Type (CSV) |
Document Actions
Schema for Document Actions.
Entity Key Schema
Attributes | Format |
---|
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
Attributes | Description |
---|
documentId | Document Identifier |
type | Type of Action |
status | Status of Action |
parameters | Parameters for Action |
metadata | Metadata for Action |
userId | Create by user |
inserteddate | Inserted Date |
startDate | Start Date of action |
completedDate | Completed Date |
message | Action message |
queueId | Queue Id |
workflowId | Workflow Id |
workflowStepId | Workflow Step Id |
workflowLastStep | Workflow Last Step |
Document Sync
Schema for Document Sync Events.
Entity Key Schema
Attributes | Format |
---|
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
Attributes | Description |
---|
documentId | Document Identifier |
service | Service synced to |
syncDate | Sync Date |
userId | Create by user |
status | Status of Sync |
type | Type of data synced |
message | sync message |
Document Tag
Document Tag(s) entity.
Entity Key Schema
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "tags#" + tagKey |
GSI1PK | "tag#" + tagKey + "#" + tagValue |
GSI1SK | "yyyy-MM-dd'T'HH:mm:ssZ" + "#" + documentId |
GSI2PK | "tag#" + tagKey |
GSI2SK | tagValue + "#" + yyyy-MM-dd'T'HH:mm:ssZ + "#" + documentId |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
type | Type of Tag |
tagValue | Tag Value |
userId | Create by user |
inserteddate | Inserted Date |
Document Tag (Multi-Value)
Document Tag(s) entity with multiple values.
Entity Key Schema
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "tags#" + tagKey + "#idx" + index |
GSI1PK | "tag#" + tagKey + "#" + tagValue |
GSI1SK | "yyyy-MM-dd'T'HH:mm:ssZ" + "#" + documentId |
GSI2PK | "tag#" + tagKey |
GSI2SK | tagValue + "#" + yyyy-MM-dd'T'HH:mm:ssZ + "#" + documentId |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
type | Type of Tag |
tagValue | Tag Value |
tagValues | Tag Values |
userId | Create by user |
inserteddate | Inserted Date |
Document Attribute
Document Attribute entity.
Entity Key Schema
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "attr#" + key + "#" + value |
GSI1PK | "doc#attr#" + key |
GSI1SK | value |
GSI2PK | "docs#" + documentId |
GSI2SK | "attr#" + valueType + "#" + key |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
key | attribute key |
index | attribute index |
valueType | Type of Attribute (string, number, boolean, watermark (GSI2), publication) |
stringValue | string value |
numberValue | number value |
booleanValue | boolean value |
Document Data Classification Result
Contains all information about Data Classification Result for the document.
Entity Key Schema
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "llmresult#" + TIMESTAMP + "#" + llmPromptEntityName |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
llmPromptEntityName | LLM Prompt Entity Name |
content | Result from the LLM Prompt |
attributes | List of Attributes found in the LLM prompt result |
inserteddate | Inserted Date |
userId | Create by user |
Document MalwareScan Result
Contains all information about Malware Scan Result for the document.
Entity Key Schema
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "malware#result#" + TIMESTAMP + "#" + ID |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
scanStatus | MALICIOUS, ERROR, CLEAN |
engine | Malware Scan Engine |
s3version | S3 version id |
inserteddate | Inserted Date |
Document Publication
Document Publication entity.
Entity Key Schema
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "publication" |
Entity Attributes
Attributes | Description |
---|
path | Document Path |
contentType | Document Content-Type |
s3Version | Document S3 Version Key |
documentId | Document Identifier |
userId | Create by user |
Resource User Activity
User Activities refers to the tracking and logging of actions performed on document/entities 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.
These attributes are stored in the "audit" DynamoDB table.
EntityType Activity Key Schema
Attributes | Format |
---|
PK | "entityType#" + entityTypeId |
SK | "activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + entityTypeId |
GSI1PK | "activity#user#" + username |
GSI1SK | "activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + entityTypeId |
GSI2PK | "activity#" + yyyy-MM-dd |
GSI2SK | "activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + entityTypeId |
Entities Activity Key Schema
Attributes | Format |
---|
PK | "entity#" + entityTypeId + "#" documentId |
SK | "activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + entityId |
GSI1PK | "activity#user#" + username |
GSI1SK | "activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + entityId |
GSI2PK | "activity#" + yyyy-MM-dd |
GSI2SK | "activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + entityId |
Document Activity Key Schema
Attributes | Format |
---|
PK | "doc#" + documentId |
SK | "activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + documentId |
GSI1PK | "activity#user#" + username |
GSI1SK | "activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + documentId |
GSI2PK | "activity#" + yyyy-MM-dd |
GSI2SK | "activity#" + yyyy-MM-dd'T'HH:mm:ss.ffffffZ + "#" + documentId |
Activity Attributes
Attributes | Description |
---|
siteId | Site Identifier |
resource | Activity Resource (document, entity, entityType, etc) |
type | Type of User Activity (view, add, change, delete) |
status | Activity Status (COMPLETE, FAILED, UNAUTHORIZED) |
sourceIpAddress | Source Ip Address for activity request |
source | Source of activity request |
userId | Create by user |
documentId | Document Identifier |
attributeKey | Document Attribute Key |
entityTypeId | EntityType Identifier |
entityId | Entity Identifier |
changeSet | Map of new / old value by key |
inserteddate | Inserted Date |
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.
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
Attributes | Format |
---|
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
Attributes | Description |
---|
documentId | Document Identifier |
type | Type of User Activity (view, add, change, delete) |
userId | Create by user |
versionPk | PK key for version table |
versionSk | SK key for version table |
inserteddate | Inserted Date |
Document Metadata refers to the metadata information attached to the document.
Entity Key Schema
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "doc#" + yyyy-MM-dd'T'HH:mm:ss |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
path | Document path |
inserteddate | Inserted Date |
lastModifiedDate | Last Modified Date |
deepLinkPath | Document deep link path |
metadata | Key / 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
Attributes | Format |
---|
PK | "docs#" + documentId |
SK | "document#" + yyyy-MM-dd'T'HH:mm:ss |
Entity Attributes
Attributes | Description |
---|
contentType | Mime Content Type |
contentLength | Mime Content Type |
checksum | Document content checksum |
checksumType | Document content checksum type |
s3version | Document 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
Attributes | Format |
---|
PK | "doc#" + documentId |
SK | "attr#" + key + "#" + yyyy-MM-dd'T'HH:mm:ss + "#" + value |
Entity Attributes
Attributes | Description |
---|
archive#SK | "attr#" + key + "#" + value |
documentId | Document Identifier |
key | attribute key |
index | attribute index |
valueType | Type of Attribute (string, number, boolean, publication) |
stringValue | string value |
numberValue | number value |
booleanValue | boolean value |
Attributes
The Attributes Entity consists of attributes that capture essential information about a document.
Entity Key Schema
Attributes | Format |
---|
PK | "attr#" + key |
SK | "attribute" |
GSI1PK | "attr#" |
GSI1SK | "attr#" + key |
GSI2PK | "attr#" |
GSI2SK | "attr#" + dataType |
Entity Attributes
Attributes | Description |
---|
documentId | Attribute Key |
type | Attribute Type (IE: OPA) |
dataType | Data Type (STRING, NUMBER, BOOLEAN, KEY_ONLY, WATERMARK, PUBLICATION ) |
key | Attribute key |
isInUse | Is Attribute in use |
watermarkText | Watermark Text |
Schema
The Schema Entity consists of attributes configurations.
Site Entity Schema
Entity Key Schema
Attributes | Format |
---|
PK | "schemas" |
SK | "site#" + entity |
Entity Attributes
Attributes | Description |
---|
name | Name of Schema |
schema | Schema JSON document |
Site Composite Key
Entity Key Schema
Attributes | Format |
---|
PK | "schemas" |
SK | "compositeKey#" + UUID |
GSI1PK | "schemas#compositeKey" |
GSI1SK | "key#" + keys |
Entity Attributes
Attributes | Description |
---|
keys | List of Keys |
Site Attribute Key
Entity Key Schema
Attributes | Format |
---|
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
Attributes | Format |
---|
PK | "schemas" |
SK | "attr#" + key + "#allowedvalue#" + value |
GSI1PK | "attr#" + key + "#allowedvalue" |
GSI1SK | "val#" + value |
Classification
The Classification Entity attributes.
Classification Entity
Entity Key Schema
Attributes | Format |
---|
PK | "schemas#" + documentId |
SK | "class#" + entity |
GSI1PK | "class#" + entity |
GSI1SK | "attr#" + name |
Entity Attributes
Attributes | Description |
---|
name | Name of Classification |
documentId | Classification Identifier |
schema | Schema JSON document |
Classification Composite Key
Entity Key Schema
Attributes | Format |
---|
PK | "schemas#" + documentId |
SK | "compositeKey#" + UUID |
GSI1PK | "schemas#compositeKey" |
GSI1SK | "key#" + keys |
Entity Attributes
Attributes | Description |
---|
documentId | Classification Identifier |
keys | List of Keys |
Site Attribute Key
Entity Key Schema
Attributes | Format |
---|
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
Attributes | Format |
---|
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
Attributes | Format |
---|
PK | "shares#" + (group/user) + "#" + name |
SK | "share#" + siteId + "#" + documentId |
Entity Attributes
Attributes | Description |
---|
documentId | Document Identifier |
type | Type of Share (File or Directory) |
inserteddate | Inserted Date |
userId | Create by user |
path | Folder path |
name | Name of share |
siteId | SiteId share is part of |
permissionType | Type of permission |
permissions | List of permissions |
Document Share
A list of shares for a particular user role.
Entity Key Schema
Attributes | Format |
---|
PK | "shares#" + documentId |
SK | "share" |
GSI1PK | "share#" + name |
GSI1SK | "share#" + path + "#" + documentId |
Entity Attributes