Back to all work

Linc Global, Inc.

Analytics and Reporting Pipeline

Linc's analytics pipeline turned 30M+ shopper events a day into client metrics, scheduled reports, and usage billing. I maintained and extended it, carried its largest change through every layer, then designed and prototyped its replacement, from scheduling to the dashboard.

Software Engineer, Analytics team202250+ franchisesHourly and daily batch jobs

The pipeline I maintained

Simplified reconstruction
Events move from Elasticsearch to event tables to metrics tables, then to Power BI, reports, and billing. Each step runs on its own cron schedule.Elasticsearch30M+ events a dayhourly cronEvent tablesabout two weeks kepthourly cronMetrics tablesone row per slicecronPower BIvia Azure SQLcronScheduled reportsemail, SFTPcronUsage billingdaily, monthlyS3 archiveolder eventsEvents move from Elasticsearch to event tables to metrics tables, then to Power BI, reports, and billing. Each step runs on its own cron schedule.Elasticsearch30M+ events a dayhourly cronEvent tablesabout two weeks keptS3 archiveolder eventshourly cronMetrics tablesone row per slicecronPower BIvia Azure SQLcronScheduled reportsemail, SFTPcronUsage billingdaily, monthly
Scheduled by the clockEach job starts at its time. None waits for its inputs.
Backfill by handPast events had to be restored from S3 before any rerun.
One row per sliceA new dimension changes the grouping key of every metric query.
  1. Shopper events land in Elasticsearch, over 30M a day.
  2. An hourly cron job copies them into event tables.
  3. Another cron job turns events into metrics rows.
  4. Dashboards, reports, and billing each run on their own cron.
  5. No job checks that the one before it finished.
  6. Older events sit in S3. A backfill restores them by hand.
  7. Independent cron jobs feed every report. Each new slice adds rows and a new key to each query.
1 / 7Shopper events land in Elasticsearch, over 30M a day.

I maintained and extended these Python and SQL jobs, with freshness checks that raised an alert when a stage fell behind. I also added a report rerun worker that claimed each report with a conditional update, so two workers could not both claim the same report.

What one new dimension cost

Reconstruction with example data
A business tier above merchants is carried through Elasticsearch, event tables, metrics tables, Azure SQL, and Power BI. The all-business total is counted from events because unique shoppers do not add up.New tierOne businessgroups merchantsAmerchantBmerchantCmerchantExisting tierEvery layer changesElasticsearchevents carry a businessEvent tablesnormalized, any letter caseMetrics tableskeyed by business, user typeAzure SQLsynced with the new keysPower BIeach business beside the totalhistory backfilled by handUnique shoppers, one dayMerchant A120Merchant B90Merchant C60Sum of the rowsshared shoppers twice270All businessescounted from events230rollups read this rowA business tier above merchants is carried through every layer.One businessgroups merchantsMerchant AMerchant BMerchant CEvery layer changesbackfilled by handElasticsearchbusiness attributeEvent tablesnormalizedMetrics tablesnew keysAzure SQLsyncedPower BIbeside the totalThe all-business total is counted from events because unique shoppers do not add up.Metrics tablesnew keysUnique shoppers, one dayMerchant A120Merchant B90Merchant C60Sum of the rows270All businesses230rollups read this row
  1. The new requirement: group several merchants under one business.
  2. Events in Elasticsearch now carry a business attribute.
  3. Event tables store it, normalized so letter case does not matter.
  4. Metrics rows now key on business and user type.
  5. Unique shoppers do not add up. Some bought from two merchants.
  6. So the all-business row is counted from events, never summed.
  7. Rollups above it skip the business rows, so nothing counts twice.
  8. Azure SQL and Power BI show each merchant beside the total.
  9. One new dimension touched every layer, and past months were backfilled by hand.
1 / 9The new requirement: group several merchants under one business.

Metrics were stored one row per slice, so one new dimension meant new event attributes, new keys in nearly every metric query, new Azure sync and Power BI views, and a backfill written by hand. The next slice would cost the same again, and the redesign below is built to remove that cost.

The redesign I proposed and prototyped

Prototype design, simplified
The redesign. Airflow DAGs with explicit task dependencies replace cron. Columnar BigQuery tables replace metric rows. One Looker Studio dashboard serves every client through a connector that checks the Client Portal token.ScheduleStoreServeAirflow on Amazon MWAAHourly DAGDaily DAGLoad eventsHourly metricsWait on hourlyDaily metricsrerun past daysBigQuerycolumnar tablesdateclientbusinessmetricnew columnClient Portalthe client is already signed inLooker Studio dashboardone, embedded in the portalCommunity connectorchecks the token with Linc's serverclient tokenclient tokenGoogle login eachA sees AB sees BC sees C
Schedule: Airflow DAGs with explicit task dependencies replace cron.ScheduleAirflow on Amazon MWAAHourly DAGDaily DAGLoad eventsHourly metricsWait on hourlyDaily metricsrerun past daysStore: metrics move to columnar BigQuery tables. A new slice is a new column.StoreBigQuerycolumnar tablesdateclientbusinessmetricnew columnServe: one Looker Studio dashboard serves every client through a connector that checks the Client Portal token.ServeClient Portalthe client is already signed inLooker Studio dashboardone, embedded in the portalCommunity connectorchecks the token with Linc's serverclient tokenclient tokenGoogle login eachA sees AB sees BC sees C
Task dependenciesWas: each cron job on its own clock.Now: a task waits for its inputs.
Reruns, not scriptsWas: restore archives, then rerun by hand.Now: past days rerun through the same DAG.
Columns, not rowsWas: a new slice changed every grouping key.Now: a new slice is one more column.
One dashboard for allWas: a Google login for every client.Now: the portal token, checked by Linc's server.
  1. Cron jobs become Airflow DAGs, one per cadence.
  2. A task starts only after the task before it succeeds.
  3. The daily DAG waits for the hourly loads it needs.
  4. A backfill reruns past days through the same tasks.
  5. Metrics move to columnar tables in BigQuery.
  6. A new slice is a new column. Queries read only what they need.
  7. Native BigQuery access needs a Google login for every client.
  8. Instead, the dashboard passes the Client Portal token.
  9. The connector checks that token with Linc's server first.
  10. Airflow coordinates loads and backfills. BigQuery serves each client only its rows.
1 / 10Cron jobs become Airflow DAGs, one per cadence.

This was a prototype that ran one metric end to end, from Airflow DAGs through BigQuery to a tenant-scoped Looker Studio dashboard.

At BigObject I later built this tenant-aware reporting path for a new cloud product, with tenant scope enforced in our own API.

More on the prototype

Analytics modernization proof of concept

Prototyped managed Airflow orchestration and designed a tenant-aware Looker Studio path around the Client Portal identity boundary before changing production.

Problem
The production pipeline relied on many independently scheduled cron jobs, while native BigQuery access required another Google login and made URL-based tenant isolation unsafe.
Implementation
Connected an Amazon MWAA environment to the existing data services, separated migration and metric workloads into DAGs with different cadences, evaluated cross-DAG coordination mechanisms, demonstrated connector-based row isolation over BigQuery, and defined how Client Portal tokens would replace direct client authentication.
Reasoning
The primary modernization need was orchestration and access control, not replacing SQL computation with a distributed engine. A bounded proof of concept tested those assumptions without destabilizing the operating pipeline.
Outcome
The proof of concept ran one metric end to end on Airflow and BigQuery, with columnar metric definitions as the next step.

The system and its stack

Python, PostgreSQL, MySQL, Elasticsearch, Django, Auth0, SQL, Azure SQL, Power BI, AWS S3, Apache Airflow / Amazon MWAA (POC), BigQuery (POC), Looker Studio (POC)

System map

Product systems

Product servicespost-purchase pages, order tracking, messaging and chatbot
Elasticsearchbusiness events, daily indices
MySQLorders, shoppers

Analytics pipeline

Cronhourly, daily
Python ETLnormalize, enrich
PostgreSQLevent partitions, reference data, metric tables
Metric jobsscheduled aggregates, business and user-type keys

Data products

Portal APItenant scoped
Client Portalsingle sign-on
Azure SQLcurated BI tables
Power BIembedded dashboards
Scheduled reportsemail, SFTP, safe reruns
Usage billingSMS, WhatsApp, tax

Prototype

Amazon MWAAAirflow DAGs per cadence
BigQuerycolumnar metrics
Connectorchecks the portal token
Looker Studioembedded in the portal

Simplified reconstruction of the system while I was at Linc. Highlighted parts are where I made my largest changes, and the dashed lane is the prototype, which ran one metric end to end on Airflow and BigQuery.

Linc Global was acquired by Capacity.