Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Etsy on Migrating to Kafka (in three short years)
Search
Hakka Labs
January 22, 2015
Programming
4
6k
Etsy on Migrating to Kafka (in three short years)
Full post with video here:
Hakka Labs
January 22, 2015
Tweet
Share
More Decks by Hakka Labs
See All by Hakka Labs
New Workflows for Building Data Pipelines
hakka_labs
0
2.9k
Collaborative Topic Models for Users and Texts
hakka_labs
0
2.8k
Groupcache with Evan Owen
hakka_labs
2
5.4k
Testing Android at Spotify
hakka_labs
1
4.5k
It's Not a Bug, It's a Feature!
hakka_labs
0
3.2k
K-means Clustering to Understand Your Users
hakka_labs
0
2k
Building Amy: The Email-based Virtual Assistant by x.ai
hakka_labs
0
5k
Deep Learning and NLP Applications
hakka_labs
3
13k
Go and the Gophers
hakka_labs
2
11k
Other Decks in Programming
See All in Programming
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
350
人には人それぞれのサービス層がある
shimabox
3
670
從零到一:搭建你的第一個 Observability 平台
blueswen
1
900
実践ArchUnit ~実例による検証パターンの紹介~
ogiwarat
2
250
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
220
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfold' relates to 'iterate'"
philipschwarz
PRO
0
190
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
130
Rails産でないDBを Railsに引っ越すHACK - Omotesando.rb #110
lnit
1
160
Passkeys for Java Developers
ynojima
3
850
Go Modules: From Basics to Beyond / Go Modulesの基本とその先へ
kuro_kurorrr
0
110
技術懸念に立ち向かい 法改正を穏便に乗り切った話
pop_cashew
0
1.4k
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
760
Featured
See All Featured
Unsuck your backbone
ammeep
671
58k
The Language of Interfaces
destraynor
158
25k
Designing for humans not robots
tammielis
253
25k
Statistics for Hackers
jakevdp
799
220k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
780
Docker and Python
trallard
44
3.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.3k
Facilitating Awesome Meetings
lara
54
6.4k
A designer walks into a library…
pauljervisheath
206
24k
Transcript
Migrating to Kafka in Three Short Years A look at
the choices that defined the Etsy analytics stack
None
Path Dependence
Decisions made in the past limit options in the present,
even if the circumstances under which those past decisions were made are no longer relevant.
In other words, we can’t upgrade the Hadoop cluster until
we port all of the Cascading.jruby jobs to Scalding.
Sneak Preview ! 1. How Etsy built its original analytics
stack 2. Handling changes prepared us to rebuild our data pipeline 3. Kafka!
Starting from scratch
Choice #1 ! Acquire Adtuitive
None
None
Before you can work on search, you need real analytics
Choice #2 ! Build a zero-impact analytics stack
Etsy is not a cloud company but the first analytics
stack was cloud-based
(illustration here) browser CDN EMR S3 mysql FTP
Legacy effects: ! 24 hour latency on events 48 hour
latency on visits
Choice #3 ! Cascading.jruby
Hadoop Cascading Cascading.jruby
Choice #4 ! Use GA _utma cookie to define visits
Benefits: ! •Simpler ETL •Visits computed on the client side
•Easy to reconcile against Google Analytics
Choice #5 ! Using existing feature library for A/B tests
Leveraged existing experience with operational ramp-ups
Low impact: just required a logging change
Choice #6 ! Build analytics stack around visit-level metrics
Great for search and ads, less great for measuring engagement
Changing the tires without stopping the car
How do we instrument the iOS app? Summer 2012
1. Native app visits should have the same structure as
Web visits
2. Native app events should use the existing data pipeline
3. The native app should buffer events and send them
when convenient
Solution: ! 1. App uploads bundles of events to API
endpoint 2. Backend event logger curls the beacon for every event
Side effect: ! We have a backend event logger that
is now used all over the place
CDN diversification project Fall 2012
None
Migrated to our own beacon infrastructure
Data pipeline based on Apache, PHP, logrotate, and cron
We built our own Hadoop cluster: Etsydoop Fall 2012
We hired the Scalding guy Fall 2012
Hadoop Cascading Cascading.jruby Scalding
None
Uh oh, the Google Analytics JS hurts performance Fall 2012
The event logger’s GA dependency precluded async loading, hurting performance
First idea: duplicate the _utma functionality in our own code
The trouble with backend events
Visit Time Logger Event Type 1 12:01 frontend home 1
12:03 backend login 1 12:03 frontend view listing 1 1:31 backend logout 2 1:31 frontend view listing 2 1:32 frontend search 2 1:33 frontend view listing wrong visit
Complete rewrite of our ETL jobs Spring/Summer 2013
None
Backend page-view events Fall 2013
None
2014: the next phase
EventPipe goals
Use POST rather than multiple GET requests to prevent data
loss
Use JSON rather than query strings for comprehensibility
Validate beacon data before it enters the data pipeline
Use a binary serialization format for long-term storage
Use Kafka for data transfer to escape the batch paradigm
Eliminate individual beacon servers as points of failure
How do we handle the impedance mismatch between Apache/PHP and
Kafka?
Wrote a server in Go to serialize beacons in Thrift
and send them to Kafka
Use Apache for SSL termination
Still to come
Real-ish time ETL
Streaming infrastructure
Offline processing for more products
Other Kafka applications
Takeaways
Every choice you make has long-term implications
Fixing stuff creates new opportunities
@rafeco http://rc3.org