Deep-dive into Entities: The Building Blocks of Houseware
In data analytics, entities refer to distinct items or objects you want to analyze. They help us categorize and organize data into meaningful groups, making it easier to analyze and derive insights. These entities also contain attributes that help describe their properties and relationships with other entities.
Defining and analyzing entities, such as transaction entities, can help us answer questions like - which products are most popular, which customers are the most loyal, or what times of year have the highest sales, using the transaction data.
Entities are fundamental components in Houseware that represent distinct objects within your business. Houseware enables a more holistic analysis by surfacing these entities for analysis, allowing product managers to understand user behavior in the larger business context. Events rarely contain all the information PMs might need to analyze user behavior. Entities provide an easy way of marrying event data with other business data already in the data warehouse.
Use Cases
Entities combined with events data are powerful tools that help product managers gain valuable insights and make informed decisions. Houseware empowers product managers to filter and break down their analysis by granular entity properties.
Let's understand this better with a real-life example. Consider a digital fitness app where users can purchase subscription plans of various values based on their needs. As a product manager of this application, you want to know how many users started their plan at a subscription value of $30.
The data for the subscription value is stored separately from the event data for the "join plan clicked" event - the event representing users who started a plan. The event data only contains the transaction ID, not the actual value of the transaction. Given that transaction and events data are available in your data warehouse, Houseware can configure an entity called "transaction" containing attributes like product, category, transaction value, etc.
This allows product managers, using Houseware, to filter and break down their event analysis using the entity attributes. Consequently, you can analyze the "join plan clicked" event with a $30 transaction value filter, as illustrated in the image below.
This capability allows a PM to analyze their event data using any transaction filter, such as product category, subscription plan type, and more.
How to Configure Entities on Houseware
Configuring an entity on Houseware can be done in the following 2 steps.
Step 1: Define entities on Houseware
Provide the following details on Houseware to define an entity:
- Name: Name of the entity; this will be exposed to the users on Houseware charts.
- Description: A description of what business concept this entity represents with any additional information about when and how to use it.
- Database: The name of the database containing the entity table/view.
- Schema: The schema containing the entity table/view.
- Table: The name of the table/view to be used on Houseware.
- Unique key: A column representing each row in the entity table uniquely. This key is used to enrich event data with entity attributes. More details on the same are mentioned below.
Step 2: Select the entity attributes
- Select the columns from the entity table: These columns should be available on Houseware as "entity attributes." These entity attributes will be available on Houseware for users to filter or break down their data.
- Map the entity to your product events: Define how the entity maps to your event data. To do this, you can define a unique key, as elaborated below.
- Define Unique Key: List the event properties containing the entity table's unique key.
- For example, to create an entity transaction for a subscription-based product, transaction_id can be an event property for the event join plan clicked, which maps to the unique column id in the transaction entity table.
Notes
- Users can list one or more event properties while defining a mapping with the entity's unique key.
- Events containing any of the above-listed event properties will automatically inherit all the attributes related to the entity.
Entity Model Requirements
All entities defined on Houseware must meet the following requirements:
Primary Key Requirement
Every entity should have a primary key. This unique identifier facilitates and ensures data integrity. The primary key must be clearly specified while defining the data model.
Attribute Data Types
Entity attributes (used for filters or breakdowns on the Houseware app) should have one of the following data types: string, bool, integer, float, datetime
.
Chained Entities
In some scenarios, you may have entities in your data linked to each other by a common key. For example, transactions and invoices. Houseware supports such entities in the following ways:
- Defined all chained entities individually on Houseware, as explained above.
- If one or more chained entities do not have a unique key present as an event property on Houseware, we recommend applying denormalization and maintaining a compound entity.
- This entitiy must have a unique key that is also present as an event property on Houseware.
- This compound entity should integrate attributes from all the interlinked entities, ensuring faster and more efficient querying.
Combining entity and event data plays a pivotal role in performing cross-functional analytics, where you want to assess user behaviour against some entity attribute, such as marketing campaigns, support tickets, etc.
I would love to hear your feedback, thoughts, and questions. Feel free to reach out to me at ankita@houseware.io.