Table

Table nodes provision key-value store database tables. In AWS, each Table node provisions a DynamoDB table. Tables are excellent for reading and writing non-relational data in a horizontally scalable fashion.

Key-value store tables partition data based on a Hash Key. The Hash Key is a value that all records must have, and is typically used to identify or segment records. Tables may optionally have a Range Key, which sorts records with the same Hash Key according to the Range Key value. See the DynamoDB Core Components documentation for a more complete discussion of keys, records, and attributes.

Stackery makes it easy to manipulate records in the table using messages sent to it from Function nodes. While the Stackery messages API enables general functionality, it is also possible to get the identifier for the underlying Table resource and interact with it using a full-featured SDK. For example, the Stackery messages API does not provide contains string conditions for select queries, but when deployed to AWS the DynamoDB Table ID (ARN) can be referenced by a Function node in order to use an AWS SDK which does support contains string conditions.

Message Formats

Transaction Events

Record transaction notification events are sent to Function nodes connected to the output of Table nodes. Events are generated for every record insertion, modification, or deletion, and events are batched together to ensure high throughput processing. Here is an overview of commonly used event properties:

Property Type Description
Records Array Array of transaction event records.
Records[*].eventName string Transaction name. Example: MODIFY
Records[*].dynamodb.Keys Object DynamoDB key values for record. Example: {"Id": {"N": "101}}
Records[*].dynamodb.OldImage Object DynamoDB original attribute values for record, where available. Example: {"Id": {"N": "101}, {"Message": {"S": "New item!"}}}
Records[*].dynamodb.NewImage Object DynamoDB original attribute values for record, where available. Example: {"Id": {"N": "101}, {"Message": {"S": "This item has changed"}}}


See https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_Record.html for further details on the transaction message format.

Settings

Name

A label used for the node in the canvas.

Hash Key

The name of the Hash Key attribute. Hash Key names may contain only letters, numbers, and underscores.

Note: The name of the Hash Key may not be changed after deployment.

Hash Key Type

The type of the Hash Key attribute.

Range Key

If a Range Key is used, the name of the Range Key attribute and its type. Range Key names may contain only letters, numbers, and underscores.

Note: The name of the Range Key may not be changed after deployment.

Expiration Key

If an Expiration Key is used, the name of the Expiration Key attribute. The attribute contains a timestamp indicating when the item should be deleted.

Stackery Port Data

When connecting a wire between the output of a Function node to the input of an Object Store node, the STACKERY_PORTS environment variable for the Function node will contain the following information in JSON form:

Property Type Description
type string The type of the connected resource. Always set to table.
id string The Stackery Stream node’s ID. Example: abcd1234.
name string The Stackery Stream node’s name. Example: Records.
tableName string The name of the AWS DynamoDB table. Example: stackery-98237489374-abcd1234
tableArn string The AWS ARN of the AWS DynamoDB table. Example: arn:aws:dynamodb:us-west-2:123456789012:table/stackery-98237489374-abcd1234


See Function Output Port Connections for more details on the STACKERY_PORTS environment variable.

Referenceable Properties

The following properties may be referenced by Function, Docker Service, and Docker Task nodes:

Property Value Example
id Cloud Service Identifier arn:aws:dynamodb:us-east-1:0123456789012:table/stackery-98237487423-a8s7d8e9

Try Stackery For Free

Gain control and visibility of your serverless operations from architecture design to application deployment and infrastructure monitoring.