Try it on your own data
Every report in this article is in the free plan. One snippet for web and apps, up to 10 sites.
Start freeThe main data modeling techniques for analytics are entity-relationship, star schema, event stream and wide table, and they differ in where the cost lands: writes, queries or definition changes. On one 1,000-visitor sample all four answer the same question with the same number (277 of 893, 31.0%), so choose by how often your definitions change and who queries the data.
What you will learn
- Same sample, same question, four builds, one answer: 277 of 893 pricing-page viewers signed up within 7 days (31.0%)
- Land behavior as an event stream first; add a star schema or views for shared reports and a wide table only for hot dashboards
- A wide table reads about one-seventh of the rows (1,000 vs 6,988) but must be rebuilt when a definition changes
The four models at a glance
Four data modeling techniques cover almost every product and web analytics setup. They differ in one thing above all: where the cost of a question is paid, at write time, at query time, or when the definition changes.
| Technique | Shape | Built for | Weak spot |
|---|---|---|---|
| Entity-relationship (normalized) | Many small tables, one fact stored once, joined by keys | Operational systems that write often and must stay consistent | Analytics questions need many joins |
| Star schema (dimensional) | One fact table of events or measurements, surrounded by descriptive dimension tables | Repeated reporting by many people on shared definitions | Needs design work up front; a new question may need a new dimension |
| Event stream | One append-only table, one row per thing that happened, with a name, a time, a subject and properties | Product and web analytics where new events appear every sprint | Every question re-derives sessions, funnels and first-times from raw rows |
| Wide table | One row per user, session or user-day with dozens of precomputed columns | Dashboards and models that ask the same few questions all day | The columns are frozen answers; a new definition means a rebuild |
Relational design goes back to Codd's 1970 paper on a relational model of data, and entity-relationship modeling to Chen's 1976 paper (both in Sources). Dimensional modeling is catalogued in Kimball Group's list of techniques, which names four kinds of fact table: transaction, periodic snapshot, accumulating snapshot and factless. The event stream is the shape Google Analytics 4 uses for its BigQuery export: a daily table named events_YYYYMMDD with one row per event and nested repeated fields for event_params, user_properties and items.
None of these is "the right one". The rest of the article builds the same small dataset four ways, asks one question of each, and then gives rules for choosing.
One sample dataset and one question
Sample data: 1,000 visitors and 6,988 events over the week of 2 November 2026. The events are 6,425 page views (/, /pricing, /docs) and 563 signups with a plan of free or pro. The dataset was generated with a fixed random seed, so every number below can be reproduced.
The question every model has to answer:
Of the visitors who viewed
/pricingduring the week, what share signed up within 7 days of their first pricing view?
It looks simple, but it needs three things analytics always needs: a filter on an event and a property (page), a "first time" per person, and a time window between two different events.
Answer, identical in all four models: 893 visitors viewed the pricing page, 277 of them signed up within 7 days, so the rate is 277 ÷ 893 = 31.0%. Getting the same number from four shapes is the check that each build is correct; the differences are in how much work each one made us do.
Entity-relationship model: one fact in one place
An entity-relationship (ER) model splits data so that each fact is stored once. Our sample becomes three tables: er_user (1,000 rows), er_pageview (6,425 rows) and er_signup (563 rows). A signup has a user_id, a time and a plan; a page view has a user_id, a path and a time. Nothing is repeated, so changing a plan name means updating one place.
WITH fp AS (
SELECT user_id, MIN(viewed_at) AS t
FROM er_pageview
WHERE page = '/pricing' AND viewed_at >= '2026-11-02' AND viewed_at < '2026-11-09'
GROUP BY user_id)
SELECT COUNT(*) AS viewers,
SUM(EXISTS (SELECT 1 FROM er_signup s
WHERE s.user_id = fp.user_id
AND s.signed_at >= fp.t
AND s.signed_at < fp.t + INTERVAL '7 days')) AS signed_up
FROM fp;
Strengths: consistent, small, and easy to keep correct when applications write to it. Cost: every new kind of event is a new table, and every cross-event question joins them. With 25 event types you maintain 25 tables, and a funnel across five of them is a five-way join. That is why ER shapes are the right home for the application database and a poor home for the analytics copy.
Star schema: facts in the middle, context around them
A star schema keeps one fact table of measurable things and joins out to dimension tables that describe them. Ours is fact_event (6,988 rows: event id, user key, page key, event key, time) with dim_user (1,000 rows), dim_page (4 rows) and dim_event (2 rows).
The design discipline comes from Kimball's method: pick the business process, declare the grain (here: one row per event), then choose the dimensions and the facts. Declaring the grain is the step people skip, and the damage is silent: if some rows are per event and others per session, every count is wrong in a different direction.
WITH fp AS (
SELECT f.user_key, MIN(f.ts) AS t
FROM fact_event f
JOIN dim_page p ON p.page_key = f.page_key
JOIN dim_event e ON e.event_key = f.event_key
WHERE e.name = 'page_view' AND p.path = '/pricing'
AND f.ts >= '2026-11-02' AND f.ts < '2026-11-09'
GROUP BY f.user_key)
SELECT COUNT(*) AS viewers,
SUM(EXISTS (SELECT 1 FROM fact_event s
JOIN dim_event e ON e.event_key = s.event_key
WHERE s.user_key = fp.user_key AND e.name = 'signup'
AND s.ts >= fp.t AND s.ts < fp.t + INTERVAL '7 days')) AS signed_up
FROM fp;
Strengths: BI tools understand it, many people can slice by the same dimensions, and the dimension tables are tiny so the joins are cheap. Cost: someone has to decide the dimensions. A new property such as plan means altering a dimension or adding a column to the fact, and old rows need a backfill decision.
Event stream: one row per thing that happened
The event stream is the simplest shape and the one product analytics tools use. One table, events, with an id, a subject, an event name, a time and a few properties. In our sample it is 6,988 rows and the query needs no joins at all:
WITH fp AS (
SELECT user_id, MIN(ts) AS t
FROM events
WHERE event_name = 'page_view' AND page = '/pricing'
AND ts >= '2026-11-02' AND ts < '2026-11-09'
GROUP BY user_id)
SELECT COUNT(*) AS viewers,
SUM(EXISTS (SELECT 1 FROM events s
WHERE s.user_id = fp.user_id AND s.event_name = 'signup'
AND s.ts >= fp.t AND s.ts < fp.t + INTERVAL '7 days')) AS signed_up
FROM fp;
Strengths: a new event is just a new event_name value, with no migration; old data keeps its meaning; any question about order, timing or frequency can be asked later. Cost: sessions, funnels and "first time" are not stored anywhere, so each query rebuilds them from raw rows, and a typo in an event name creates a separate event for good. Properties that vary by event are usually stored as key-value pairs: GA4's export holds each parameter as a repeated record with key and typed values (string_value, int_value, double_value), which keeps the table narrow but makes every property access an unnest.
The two things that keep an event stream healthy are a naming convention (see data taxonomy) and a short list of properties per event that the team agreed to keep.
Wide table: precomputed answers, one row per subject
A wide table collapses events into one row per user (or session, or user-day) and adds a column for each thing you want to count or time. Our user_wide has 1,000 rows, one per visitor, with columns such as first_pricing_ts, first_signup_ts and events_total. The same question becomes a filter:
SELECT COUNT(first_pricing_ts) AS viewers,
SUM(first_signup_ts >= first_pricing_ts
AND first_signup_ts < first_pricing_ts + INTERVAL '7 days') AS signed_up
FROM user_wide
WHERE first_pricing_ts IS NOT NULL;
Strengths: fast, cheap, and trivial for analysts and machine-learning models, because the logic is already inside the column. Cost: the question is baked into the build. In our sample first_pricing_ts only looks at the week of 2 November. Ask the same thing for another week, or ask "signed up within 3 days", and the table has to be rebuilt from the event stream. A wide table is a cache of answers, so it needs the event stream (or a fact table) underneath it to rebuild from.
The same question across the four builds
Sample data, same 1,000 visitors, same result (893 viewers, 277 signups, 31.0%):
| Build | Tables the query touches | Rows in those tables | Joins | Rebuild if the definition changes |
|---|---|---|---|---|
| ER | er_pageview, er_signup | 6,988 (6,425 + 563) | 0 in the query, many for other questions | No, the query changes |
| Star | fact_event plus two dimensions | 6,994 (6,988 + 4 + 2) | 2 per branch | No, the query changes |
| Event stream | events | 6,988 | 0 | No, the query changes |
| Wide | user_wide | 1,000 | 0 | Yes, the column is rebuilt |
Two readings. First, the wide table reads about one-seventh of the rows (1,000 against 6,988), and that gap grows with traffic because events grow faster than users. Second, only the wide table pays for a changed definition with a rebuild; the other three just get a new query. This is the trade the opening table described: wide tables move cost from query time to change time.
Rows the same question reads
sample data, rows in the tables touchedHow to choose: five rules
- If the data is written by an application and must stay consistent, use ER there. Do not ask analysts to query it directly; copy it to the analytics side.
- If you track behavior and new events appear often, land the data as an event stream first. It is the only shape that never forces a decision you will regret.
- If many people report from the same definitions every week, add a star schema or views on top of the stream. Name the grain in one sentence and put it in the table description.
- If one dashboard or model asks the same question thousands of times a day, build a wide table from the stream. Keep the build script, so a changed definition is a rerun.
- If you are unsure, do not skip layers: stream first, then model above it. Going from a stream to a star or a wide table is a query; going from a wide table back to events is impossible.
A common stack is therefore all four at once: ER in the application, an event stream landing in the warehouse, a star or views for shared reporting, and a wide user-day table for the dashboards that need speed. For where the warehouse sits and how data gets there, see ETL vs ELT; for the definition of the term itself, see data model.
| Your situation | Use | Why |
|---|---|---|
| An application writes the data and must stay consistent | Entity-relationship | Each fact is stored once |
| New events appear every sprint | Event stream | A new event is a new name, not a migration |
| Many people report from shared definitions | Star schema or views | Shared grain and dimension names |
| One dashboard asks the same question all day | Wide table | Answers precomputed per user or day |
| You are not sure yet | Event stream first | Star and wide tables can be derived from it later |
Going from an event stream to a star schema or wide table is a query; going back from a wide table to events is not possible.
Pitfalls that break any of the four
- Mixed grain. One table where some rows are events and others are daily totals. Declare the grain in a sentence and test it: the row count must equal the number of things you said each row is.
- Unstable event names.
signup,sign_upandSignupare three events. Fix the naming rule before the second developer starts sending events. - No stable subject. The same person has an anonymous id before login and a user id after. If the model has no mapping, funnel counts are inflated; decide where identity is resolved and record it.
- Properties without a type. A
pricethat is sometimes"19.9"and sometimes19.9becomes two columns downstream. Keep one type per property. - Time zone drift. Store timestamps in UTC and convert at report time, or the "week" in this article's question moves by a day for some users.
How this looks in TapCub
TapCub stores behavior as an event stream: every pageview and custom event is a row with a name, a time, a visitor or person, and up to 20 properties. If you wanted to run the sample question on it, the steps are:
- Send the events with
tapcub.track(name, props)and keep names in snake_case; the All-platform analytics › Data › Tracking plan page records the events you intend to collect, with property types and owners. - Build the question as a funnel in All-platform analytics › Behavior › Behavior analysis: step 1 the pricing page view, step 2 the signup event, window 7 days. The funnel handles "first time per person" and the time window for you.
- For a cross-tab the built-in models do not give you, open the SQL tab in All-platform analytics › Behavior › Metrics & SQL. It exposes four views (
v_events,v_sessions,v_persons,v_autocapture) scoped to your project; oneSELECTorWITH, at most 50,000 rows, 30-second timeout. - To keep your own warehouse, use All-platform analytics › Data › Data export, which makes an asynchronous raw export you can load as the stream layer.
TapCub does not build star schemas or wide tables for you; those are modeling choices on your side of the export. What it does is keep the event layer clean, which is the layer every other model depends on.
FAQ
What are the main data modeling techniques?
The common ones are entity-relationship (normalized) modeling, dimensional modeling with star and snowflake schemas, the event stream, and denormalized wide tables. Hierarchical, network and graph models also exist but are rarely used for analytics. Pick by where you want to pay the cost: writes, queries or changes.
Is a star schema still needed with a modern warehouse?
Often yes, for shared reporting. A warehouse can scan an event stream quickly, but a star schema gives everyone the same definitions and the same dimension names. It matters less for a team of two analysts and more for twenty report readers.
What is the difference between a wide table and an event stream?
An event stream has one row per thing that happened and keeps every detail. A wide table has one row per user, session or day and holds precomputed answers. The stream is flexible and slower to query; the wide table is fast and fixed.
Which model should a startup begin with?
Begin with the event stream. It needs no migration when you add an event, and you can derive a star schema or a wide table from it later with a query. Starting from a wide table loses the detail you will want for the next question.
Sources
- Codd, E. F. (1970), "A relational model of data for large shared data banks", Communications of the ACM 13(6): doi.org/10.1145/362384.362685
- Chen, P. P. (1976), "The entity-relationship model: toward a unified view of data", ACM Transactions on Database Systems 1(1): doi.org/10.1145/320434.320440
- Kimball Group, Dimensional modeling techniques (fact table types, grain, four-step design process), checked 22 November 2026
- Google Analytics Help, BigQuery Export schema (
events_YYYYMMDD,event_params,user_properties,items), checked 22 November 2026
Was this article helpful?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Product Experience Specialist
Writes about product experience, practical workflows, and growth, turning complex processes into clear steps for everyday decisions.
