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
Evolution of a Real-Time Web Analytics Platform
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Geoff Wagstaff
October 18, 2013
Technology
1
370
Evolution of a Real-Time Web Analytics Platform
Talk about data stores in use at GoSquared at the AllYourBase conference.
Geoff Wagstaff
October 18, 2013
Tweet
Share
More Decks by Geoff Wagstaff
See All by Geoff Wagstaff
GoSquared Presentation at AWS for Startups
thedeveloper
1
670
Other Decks in Technology
See All in Technology
AI が Approve する開発フロー / How AI Reviewers Accelerate Our Development
zaimy
1
250
1 年間の育休から時短勤務で復帰した私が、 AI を駆使して立ち上がりを早めた話
lycorptech_jp
PRO
0
200
WBCの解説は生成AIにやらせよう - 生成AIで野球解説者AI Agentを実現する / Baseball Commentator AI Agent for Gemini
shinyorke
PRO
0
310
Snowflakeデータ基盤で挑むAI活用 〜4年間のDataOpsの基礎をもとに〜
kaz3284
1
300
どこで打鍵するのが良い? IaCの実行基盤選定について
nrinetcom
PRO
2
100
Databricks (と気合い)で頑張るAI Agent 運用
kameitomohiro
0
340
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
95k
Lookerの最新バージョンv26.2がやばい話
waiwai2111
1
140
Interop Tokyo 2025 ShowNet Team Memberで学んだSRv6を基礎から丁寧に
miyukichi_ospf
0
260
Claude Codeと駆け抜ける 情報収集と実践録
sontixyou
2
1.3k
AWS CDK の目玉新機能「Mixins」とは / cdk-mixins
gotok365
2
300
なぜAIは組織を速くしないのか 令和の腑分け
sugino
80
52k
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The browser strikes back
jonoalderson
0
740
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Odyssey Design
rkendrick25
PRO
2
530
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
250
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
For a Future-Friendly Web
brad_frost
183
10k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
150
Marketing to machines
jonoalderson
1
5k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
210
Building the Perfect Custom Keyboard
takai
2
700
Transcript
The Evolution of a Real-Time Analytics Platform Geoff Wagstaff @TheDeveloper
The Now dashboard
The Trends dashboard
Building Real-Time Analytics Behind the “Now” dashboard
Back in 2009 1 server LAMP stack Conventional hosting
LiveStats v1
None
Meltdown!
Problem? First taste of scale WRITES
Reads are easy to scale Primary Writes Replica 1 Replica
2 Replica 3 Reads Reads Reads
Writes? Not so much. Primary MANY WRITES! Replica 1 Replica
2 Replica 3 Reads Reads Reads :(
Scale Horizontally
Node Node Node Requests Requests Requests NginX -> PHP-FPM <-->
Memcache
Problems
Stupidly high data transfer: several TB per day DB ->
app -> DB round trips High latency on DB ops Race conditions
Redis to the rescue! “Advanced in-memory key-value store”
Rich Data types
Rich Data types Keys Hashes Lists Sets Sorted Sets GET
SET HGET HSET HMSET LPUSH LPOP BLPOP SADD SREM SRANGE ZADD ZREM ZRANGE ZINTERSTORE
Distributed locks Service Service Service Fast counters Fan-out Pub/Sub broadcast
Message queues redis-1 redis-2 Solved concurrency problems
ACID
A C I D tomic onsistent solated urable MySQL MongoDB
Other ACID DBs:
Fast
Fast Redis 2.6.16 on 2.4GHz i7 MBP
Single-process, one per core Run on m1.medium - 1 core,
3.5GB memory Redis cluster is coming! Now on Elasticache Redis deployment
Behind the “Trends” dashboard Building Historical Analytics
Trends v1
Sharded MySQL from outset Aging Unreliable Trends v1
The Trends dashboard
MongoDB vs Cassandra
MongoDB Document store: no schema, flexible Compelling replication & sharding
features Fast in-place field updates similar to Redis
Attempt #1: Store & aggregate Document for each list item,
timestamp and site Aggregation framework: match, group, sort Collection per list type Flexible Made app simpler Huge number of documents Slow aggregate queries: ~1s+ ✔ ✔ X X
Attempt #2 Document per list, timestamp and site Collection per
list type Faster lookups (no aggregation) Fewer documents Smaller _id Document size limit Unordered High data transfer ✔ ✔ ✔ X X X
MongoStat
Downsides High random I/O Document size & relocation Fragmentation Database
lock
K.O. MongoDB
Cassandra Distributed hash ring: masterless Linear scalability Built for scale
+ write throughput
CQL
CQL SELECT sql AS cql FROM mysql WHERE query_language =
“good” Not as scary as Column Families + Thrift SQL Schemas + Querying
CQL CREATE TABLE d_aggregate_day ( sid int, ts int, s
text, v counter PRIMARY KEY (sid, ts, s)) partition key cluster key Distributed counters!
B ASE
B A S E asically vailable oft-state ventually consistent
Eventual consistency isn’t a problem More efficient with the disk
Low maintenance Cheap
Redis + Cassandra = win Redis as a speed layer
+ aggregator for lists Cassandra as timeseries counter storage Collector Redis Cassandra Periodic flushes to Cassandra
Exploit DBs strengths Build an indestructible service Use the best
tools for the job
Thanks! Geoff Wagstaff @TheDeveloper engineering.gosquared.com