DynamoDB Data Models
The service uses a single DynamoDB table (Single Table Design) to store multiple entity types. The generic PK/SK patterns allow for efficient querying by User or by Time.
Table Overview
-
Partition Key (PK): String (Generic)
-
Sort Key (SK): String (Generic)
-
Global Secondary Index 1 (GSI1):
GSI1PK,GSI1SK
Document Types
Float Profile
Stores user-specific settings for floats and loans, including limits and enabled status. Profiles are versioned by creation date, allowing history tracking.
-
PK:
USER#<user_id> -
SK:
PROFILE#<created_on>(RFC3339 Timestamp)
| Field | Type | Description |
|---|---|---|
|
String |
The generic FloatMe user ID. |
|
Boolean |
Global toggle for float eligibility. |
|
Boolean |
Global toggle for loan eligibility. |
|
List |
List of float settings (Amount, Enabled/Disabled). |
|
List |
List of loan settings (Amount, Enabled/Disabled). |
|
String |
Timestamp of profile creation. |
|
String |
Reason for the current settings. |
|
String |
Administrative notes. |
Temporary Float Profile
Stores temporary overrides for a user’s float profile. These have an expiration time and take precedence over the standard Float Profile while active.
-
PK:
USER#<user_id> -
SK:
TEMP_FLOAT_PROFILE#EXPIRES#<expires_on>(RFC3339 Timestamp)
| Field | Type | Description |
|---|---|---|
|
String |
The generic FloatMe user ID. |
|
String |
RFC3339 timestamp when this temporary profile becomes invalid. |
|
String |
Timestamp of creation. |
|
String |
Reason for the temporary override. |
|
Boolean |
(Inherited) Float eligibility override. |
|
List |
(Inherited) List of float settings overrides. |
Rule Outcome
Represents the result of a single rule execution within a rulebook. These are transient records used to calculate the final evaluation.
-
PK:
USER#<user_id> -
SK:
RULE_OUTCOME#<rule_name>
| Field | Type | Description |
|---|---|---|
|
String |
Name of the rule executed. |
|
Number |
-1 for Approval, 0 for Denial, >0 for specific amount. |
|
Boolean |
True if the rule execution encountered an error. |
|
Map |
Input features or intermediate values used by the rule. |
|
String |
Timestamp of update. |
|
Number |
Time-to-live timestamp for automatic cleanup. |
Evaluation Result
Represents the aggregated final decision for a user at a specific point in time. This is the "answer" to a float-check.
-
PK:
USER#<user_id> -
SK:
EVAL_RESULTS#<item_id>#<account_id>#<created_date> -
GSI1PK:
USER#<user_id> -
GSI1SK:
EVAL_RESULTS#<result_id>
| Field | Type | Description |
|---|---|---|
|
String |
Unique ID for the evaluation. |
|
String |
The Plaid Item ID related to the check. |
|
String |
The Plaid Account ID related to the check. |
|
Map |
Final decision for Float products (Approved, Amount, etc.). |
|
Map |
Final decision for Loan products. |
|
Map |
Snapshot of CFI (Cash Flow Insight) data used. |
|
String |
RFC3339 timestamp. |
|
Number |
Time-to-live timestamp. |
Historical Evaluation
A permanent record of an evaluation that resulted in a Float or Loan being taken. This snapshots the state of the world when the credit was extended.
-
PK:
USER#<user_id> -
SK:
HISTORICAL_EVALUATION#<result_id>
| Field | Type | Description |
|---|---|---|
|
String |
ID of the original evaluation. |
|
Number |
The amount taken. |
|
String |
ID of the float created (if applicable). |
|
String |
ID of the loan created (if applicable). |
|
Map |
Snapshot of float evaluation. |
|
Map |
Snapshot of loan evaluation. |
|
String |
RFC3339 timestamp. |
Rulebook
Stores configuration for a set of rules (a Rulebook). Rulebooks define the logic applied during underwriting.
-
PK:
RULEBOOK -
SK:
RULEBOOK#<rulebook_id> -
GSI1PK:
RULEBOOK_TYPE#<type> -
GSI1SK:
RULEBOOK#<rulebook_id>
| Field | Type | Description |
|---|---|---|
|
String |
Unique identifier for the rulebook (e.g., |
|
String |
Human-readable name. |
|
String |
Type of rulebook (e.g., |
|
List |
List of Rule objects defining the logic to run. |
|
Number |
Percentage of users this applies to (for A/B testing or rollouts). |
|
Number |
Evaluation priority (higher runs first). |
|
Boolean |
If true, stops evaluation of lower priority rulebooks if this one matches. |
|
String |
Timestamp of last update. |
Query Patterns
-
Get All Rulebooks: Query PK=
RULEBOOK. -
Get Rulebooks by Type: Query GSI1PK=
RULEBOOK_TYPE#<type>. -
Get Specific Rulebook: GetItem PK=
RULEBOOK, SK=RULEBOOK#<id>.
Note on Caching:
To optimize performance, Rulebooks are often cached in-memory by the CachedRulebooks component in the lambda functions. This cache is refreshed periodically (e.g., every 5-10 minutes) or on demand, reducing the load on DynamoDB for static configuration data.