PostgreSQL Schema
The Insight Service connects to the shared FloatMe RDS PostgreSQL cluster (ebdb) via two connection pools: a primary (main) instance for writes and a read replica for queries. Both are accessed through pgxpool connections managed at Lambda startup.
Connection Configuration
| Pool | Usage |
|---|---|
|
Write operations: |
|
Read operations: |
Credentials are fetched from AWS Secrets Manager at Lambda startup:
-
Main:
{environment}/rds/main -
Replica:
{environment}/rds/replica
Two Lambdas connect to RDS: prod-insight-api and prod-insight-institution-change-handler. Both are placed inside the floatme VPC (private subnets floatme Private Subnet 1 and floatme Private Subnet 2) with the floatme PrivateSG security group.
Employment Table
Table Name
"FloatMeAPI_employmentinfomodel"
This is a Django-managed table in the shared ebdb database. The table name follows Django’s default {app}_{model} convention.
Columns
| Column | Go Field | Description |
|---|---|---|
|
|
Auto-incremented primary key (int). Used to select the most recent record when multiple employment rows exist for a user ( |
|
|
FloatMe user ID (string). Foreign key to the Django user model (hence the double |
|
|
Employer name string. Used by payday predictors for Jaro-Winkler matching against Pave income source names. |
|
|
Pay type descriptor (e.g., hourly, salary). Read but not heavily used in prediction logic. |
|
|
Pay frequency string (e.g., biweekly, weekly). Used by the FM Legacy payday predictor to calculate the next payday deterministically. |
|
|
Initial payday date string. Used as the anchor date for the FM Legacy predictor’s cadence calculation. |
Access Patterns
| Operation | Pool | Query |
|---|---|---|
|
Replica |
|
|
Replica |
|
|
Main |
|
|
Main |
|
Who Calls Each Operation
| Operation | Caller |
|---|---|
|
FM Legacy payday predictor (during float creation and |
|
Income detection methods that scan all employment records for a user |
|
Income verification flow (when a user submits or updates their employment info) |
|
Institution-change-handler (when a user connects a new bank institution) |
The Delete operation is idempotent — deleting a non-existent user_id returns no error.
Related Pages
-
Architecture — VPC configuration and external service dependencies
-
Forecasts & Payday — FM Legacy predictor that reads employment records
-
Institution Changes — Employment record deletion on bank account change
-
Infrastructure — RDS Secrets Manager references and VPC subnet configuration