In Rayven.io, the Primary and Secondary data table in the MySQL database serves as the organized view of your data, connecting to the raw, unstructured data stored in the Cassandra database through a Unique ID
Overview
Rayven.io uses two core database types to manage your solution's data:
-
Primary Data Table (MySQL): Structured records (e.g., customers, assets, orders)
-
Unstructured Data (Cassandra): Real-time or event-based data (e.g., logs, sensor values, API payloads)
These systems work together using Unique IDs to enable accurate, fast, and contextualized data processing across your workflows and dashboards.
What Is a Primary Data Table?
A Primary Data Table is a structured table in MySQL that stores your core business entities.
Key Features:
-
Contains records such as devices, customers, or inventory items
-
Each row has a Unique ID used to reference it across workflows
-
Can define labels for filtering, grouping, and dashboard use
Examples:
Entity Type | Table Name | Key Fields |
---|---|---|
Customers | Customers |
Customer ID, Name, Region, Tier |
Orders | SalesOrders |
Order ID, Customer ID, Status |
Machines | Devices |
Device ID, Location, Type |
Users | AppUsers |
User ID, Role, Email |
What Is a Secondary Table?
A Secondary Table extends a Primary Table with additional or historical data. It is often used to capture 1-to-many relationships.
Key Features:
-
Includes a foreign key linking to a Primary Table
-
Ideal for time-series or log data
-
Keeps Primary Table lean and performant
Examples:
Use Case | Secondary Table | Linked Primary Table | Example Fields |
---|---|---|---|
Customer Feedback | FeedbackEntries |
Customers |
Feedback ID, Customer ID, Rating, Timestamp |
Order Line Items | OrderDetails |
SalesOrders |
Order ID, Product ID, Quantity, Unit Price |
User Login History | LoginAudit |
AppUsers |
Login ID, User ID, Timestamp, IP Address |
Equipment Maintenance | MaintenanceLogs |
Devices |
Device ID, Issue, Action Taken, Date |
How Are Data Tables Linked to Workflows?
Rayven workflows ingest data from external systems and match it to structured records using a Unique ID.
Example:
-
API sends unstructured log:
{device_id: 123, temperature: 45}
-
Workflow maps
device_id
to a record inDevices
(Primary Table) -
This allows you to:
-
Filter logs by
Location
from the primary table -
Group data by
Device Type
-
Display the log in a dashboard alongside structured attributes
-
Business Use Case Examples (Non-IoT)
Inventory Management
-
Primary Table:
InventoryItems
-
Secondary Table:
StockMovements
-
Workflow logs each stock change into
StockMovements
, tied byItem ID
. -
Enables reporting like: "Total items restocked this week by supplier."
Invoice Processing
-
Primary Table:
Invoices
-
Secondary Table:
Payments
-
Workflow receives a payment, links it to the correct invoice by
Invoice ID
, and updates payment status.
Education Platform
-
Primary Table:
Students
-
Secondary Table:
CourseCompletions
-
Real-time assessment data ingested and linked to each student record to measure performance.
E-commerce
-
Primary Table:
Customers
,Products
-
Secondary Table:
PurchaseHistory
-
Workflow updates dashboards showing top-selling products by customer segment.
Q&A: Primary Data Table & Workflow Integration
Q: What is the main purpose of a Primary Data Table?
A: To store and organize your core structured data (e.g., assets, customers) in a consistent format.
Q: How does Rayven connect raw data to structured records?
A: It uses a Unique ID to match unstructured input (from Cassandra) to structured entries in MySQL.
Q: Why use a Secondary Table?
A: To store related or historical data (e.g., logs, transactions) without cluttering the Primary Table.
Q: Can I filter workflows using values in Primary Tables?
A: Yes, attributes like Building Name
or Customer Tier
can be used to filter or group workflow data.
Q: What happens if a UID is missing or mismatched?
A: The incoming data won't be linked to a primary record, which may break labeling or filtering logic in workflows.