---
title: "Apache Spark"
description: "25 posts about Apache Spark, summarised, each linking to the original."
---

# Apache Spark
> 25 posts about Apache Spark, summarised, each linking to the original.

## Articles

### [Enabling Multi-Region Data Systems at Notion](https://yomu.fyi/post/enabling-multi-region-data-systems-at-notion.md)
- Company: [Notion](https://yomu.fyi/company/notion.md)
- Author: Justin Lee, Adam Hudson
- Published: Apr 9, 2026
- Type: Explainer

Notion’s data residency work keeps customer data processed and stored in the region where it was generated, supporting EU requirements across Search, analytics, scheduled events, and AI. To make this possible, Notion modularized infrastructure around isolated private networks and workspace IDs, then deployed regional data lakes, Kafka clusters, Spark jobs, Elasticsearch, and vector databases. Debezium captures Postgres changes into regional Kafka, while Airflow remains a centralized orchestration layer that routes jobs to regional EMR clusters; event logging similarly routes traffic by workspace and sanitizes data before Snowflake. Centralized mapping tables, shared region helpers, Terraform, and localized sanitization let teams retain a unified Snowflake environment without exporting customer data. The work took months, and Notion says it is applying these patterns to Japan and South Korea while aiming to provision future regional data stacks within days rather than months.


### [Two years of vector search at Notion: 10x scale, 1/10th cost](https://yomu.fyi/post/two-years-of-vector-search-at-notion-10x-scale-1-10th-cost.md)
- Company: [Notion](https://yomu.fyi/company/notion.md)
- Author: Preeti Gondi, Mickey Liu, Nathan Louie, Calder Lund, Jacob Sager
- Published: Feb 19, 2026
- Type: Explainer

Notion describes two years of scaling vector search for AI Q&A, where semantic embeddings retrieve workspace and connected-tool content by meaning rather than exact keywords. The initial system combined Apache Spark batch indexing with Kafka-driven real-time updates, workspace-based sharding, and generation routing; rapid demand drove a 600x increase in daily onboarding capacity and cleared a waitlist of millions of workspaces by April 2024. A serverless migration cut vector database costs 50 percent from peak usage, while a later move to turbopuffer reduced search-engine spend 60 percent, lowered AWS EMR costs 35 percent, and improved p50 query latency from 70–100ms to 50–70ms. Further work uses xxHash-based page-state caching in DynamoDB to reprocess only changed spans and shifts embeddings generation from Spark and query embeddings away from a third-party API to Ray on Anyscale, with early rollout results pointing to a projected 90+ percent reduction in embeddings infrastructure costs.


### [Shopify's Data Science & Engineering Foundations](https://yomu.fyi/post/shopify-s-data-science-engineering-foundations.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Jun 18, 2020
- Type: Explainer

Shopify’s Data Science & Engineering team describes the foundations it uses to provide daily insights to internal teams, merchants, and partners across a rapidly changing commerce ecosystem. Its data warehouse follows a shared dimensional-modelling philosophy, with modelled data built on Spark in a single GitHub repository and made broadly queryable through Presto, while ETL jobs are unit tested and prevented from failing silently. Centralized dashboards, reproducible vetted data points, peer review, product-aligned sub-teams, accessible communication, and cross-team collaboration extend those foundations into analysis and decision-making. Together, these practices let team members reuse existing work, produce trusted and understandable metrics, address the specialist gap through collaboration, and derive new metrics with fewer than 50 lines of SQL.


### [The Evolution of Kit: Automating Marketing Using Machine Learning](https://yomu.fyi/post/the-evolution-of-kit-automating-marketing-using-machine-learning.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Mar 4, 2020
- Type: Explainer

Kit began as a heuristic, rules-based virtual employee that simplified Facebook advertising for Shopify merchants by selecting products and budgets while defaulting other settings to best practices. The post describes its evolution into an artificially intelligent assistant that uses merchant spending behavior and store signals such as traffic and sales to recommend marketing actions. Kit's machine-learning design combines regression to predict likely spending with classification to estimate whether a budget and store state are likely to generate sales; training uses feature engineering, Apache Spark, Google Cloud ML Engine, and monitored model metrics. For real-time predictions, Bigtable stores engineered features, while a Tornado web container delegates model computation to TensorFlow Serving. The resulting system powered one third of Kit's marketing campaigns.


### [How Shopify Merchants can Measure Retention](https://yomu.fyi/post/how-shopify-merchants-can-measure-retention.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: Cam Davidson-Pilon
- Published: Nov 14, 2017
- Type: Explainer

Shopify addresses customer retention for merchants operating non-contractual businesses, where churn is not directly observable. Common rules that label customers inactive after N days create arbitrary binary states, so the post proposes probabilistic modeling with the BG/NBD (Beta Geometric / Negative Binomial Distribution) model. It represents each customer with a purchase rate and churn probability, estimates their population distributions, and uses age, recency, and repeat-purchase frequency as sufficient statistics. Shopify fits a modified implementation in lifetimes using Apache Spark DataFrames, subsampling up to 50k customers per shop for performance, and produces activity probabilities and expected future purchases for more than 500 million historical merchant customers. The model is interpretable and supports customer ranking and targeted campaigns, but it handles seasonality poorly and does not easily incorporate additional variables such as country or products purchased.


[Newer posts](https://yomu.fyi/topic/apache-spark.md)
