HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

Breakout Session Presented by Dan Robinson of Heap at PGConf Silicon Valley 2015

Citus Data4 HN recommenders · recommended in 5 months, 2016-2020
YouTube
14K views · 10 years ago · talk · dated

Dan Robinson, then CTO of Heap, explains how Heap runs its product analytics backend on PostgreSQL and CitusDB. It covers conversion funnels, retention and cohort queries across tens of billions of events and 50 TB of data, plus Postgres and Kafka together and the indexing strategy.

HN commenters point to it as a first-hand overview of Heap's Postgres/Citus architecture and its distinctive indexing approach.

Databases & storageDistributed systemsData science & statistics#postgresql#citus#eventanalytics#indexing#kafka#sharding

8 comments from Hacker News

@malisper2020 · in “Launch HN: PostHog (YC W20) – open-source product analytics”

I'm curious as to how you plan to scale PostHog to larger users. As the person who scaled Heap, here is my honest opinion of this. I think there is going to be a huge challenge ahead in scaling query performance. This was perpetually a challenge at Heap and was for a long time the main limitation on Heap's growth. The challenge was tough enough for Heap and PostHog is going to be at a huge disadvantage due to the lack of multi-tenancy. When you use Heap, your data is stored across Heap's entire cluster of machines. When you run a query, that query is ran simultaneously against every single machine in Heap's cluster. Even though your data may be taking up something like .1% of the total disk space, when you run a query, 100% of the disk throughput of Heap's cluster will go to processing your query. It's not an overstatement to say this alone results in a >50x improvement to query performance. I honestly think Heap wouldn't be possible without multi-tenancy. It's hard enough as is to get queries that process multiple terabytes of data to return in seconds when you have a fleet of dozens of i3s available. I'm not sure how you would do that with a fleet a tiny fraction of that size. If you're curious about Heap's infrastructure, Heap's CTO, Dan Robinson, has given a number of talks on how it works[0][1]. That's not to say that PostHog won't work for anyone. I previously tried (and failed) to start a company based on optimizing people's Postgres instances. One of the big takeaways

CitesView on HN
@macobo2017 · in “Running 10M PostgreSQL Indexes in Production”

You need a queue in front of your database irregardless of write latency. Otherwise you tie your availability to database availability as downtime (even for upgrades) is often unavoidable and network problems are common. Dan gave a pretty good talk about the high-level details of how/why postgres a couple of years back: ▶ this video . One reason of why pg is that SQL is really powerful for building complex queries.

RecommendsView on HN
@macobo2017 · in “How Discord Stores Billions of Messages Using Cassandra”

Regarding a), a sharded postgresql (i.e. with citus data) can easily accomodate that workflow with just a tiny bit of extra overhead. Re c) this strongly depends on the usecase, I've seen companies use a) to avoid split-brain problems and having to manage two data pipelines to great success at similar scales. You might find ▶ this video interesting.

RecommendsView on HN
@malisper2016 · in “When to Avoid JSONB in a PostgreSQL Schema”

That get's into our indexing strategy which Dan talks about in this talk[0]. Currently our tables aren't completely insert only, so a BRIN index wouldn't work for us, as one row in the wrong place can cause a huge amount of extra reads. [0] ▶ this video

CitesView on HN
@malisper2016 · in “When to Avoid JSONB in a PostgreSQL Schema”

As of right now, our schema is literally: user_id | event_id | time | data where data is a JSONB blob that contains every other piece of information about an event. Currently, we get a row estimate of one for pretty much every query. We've been able to work around the lack of statistics by using a very specific indexing strategy (discussed about in a talk Dan gave[0]) that gives the planner very few options in terms of planning and additionally by turning off nested loop joins. We are planning on pulling out the most common properties that we store in the data column, which will give us proper statistics on all of those fields. I am currently experimenting with what new indexing strategies we will be able to use thanks to better statistics. [0] ▶ this video

CitesView on HN
@simiano2016 · in “When to Avoid JSONB in a PostgreSQL Schema”

Keep in mind that Heap collects a huge amount of data and has a huge dataset. I like this[1] talk, it gives you an overview of their architecture. Great post though, thank you for sharing. [1] ▶ this video

RecommendsView on HN
@devbug2016 · in “Building a Scalable Postgres Metrics Backend Using the Citus Extension”

If you haven't already seen it, Dan from Heap Analytics has a great talk about how they use Postgres and Citus. ▶ this video

RecommendsView on HN
@Judson2016 · in “TrailDB – An Efficient Library for Storing and Processing Event Data”

I was just watching this[0] excellent talk from one of the Heap Analytics engineers on their use of CitusDB + Postgres to do event processing. What use-case would TrailDB be the obvious, hands-down way to go (vs maybe Postgres + Citus)? [0]: ▶ this video

Strongly recommendsView on HN
Rich Hickey: Deconstructing the Database1:06:24

Rich Hickey: Deconstructing the Database

InfoQ
106K views • 14 years ago
"Turning the database inside out with Apache Samza" by Martin Kleppmann47:43

"Turning the database inside out with Apache Samza" by Martin Kleppmann

Strange Loop Conference
205K views • 12 years ago
Escape from the Heap: Low-Level Programming in Common Lisp56:49

Escape from the Heap: Low-Level Programming in Common Lisp

Arthur Gleckler
17K views • 10 years ago
Lucas Cavalcanti & Edward Wible - Exploring four hidden superpowers of Datomic40:42

Lucas Cavalcanti & Edward Wible - Exploring four hidden superpowers of Datomic

ClojureTV
29K views • 11 years ago
How We've Scaled Dropbox1:08:17

How We've Scaled Dropbox

Stanford
372K views • 14 years ago
Rust at speed — building a fast concurrent database52:54

Rust at speed — building a fast concurrent database

Jon Gjengset
225K views • 7 years ago
CppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures"1:13:41

CppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures"

CppCon
235K views • 12 years ago
Event Sourcing • Greg Young • GOTO 201454:25

Event Sourcing • Greg Young • GOTO 2014

GOTO Conferences
102K views • 11 years ago
Introduction to NoSQL • Martin Fowler • GOTO 201254:52

Introduction to NoSQL • Martin Fowler • GOTO 2012

GOTO Conferences
1M views • 13 years ago
Greg Young — A Decade of DDD, CQRS, Event Sourcing48:04

Greg Young — A Decade of DDD, CQRS, Event Sourcing

Domain-Driven Design Europe
190K views • 10 years ago
CppCon 2018: G. Nishanov “Nano-coroutines to the Rescue! (Using Coroutines TS, of Course)”1:04:26

CppCon 2018: G. Nishanov “Nano-coroutines to the Rescue! (Using Coroutines TS, of Course)”

CppCon
40K views • 8 years ago
CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.”1:39:25

CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.”

CppCon
149K views • 10 years ago
"I See What You Mean" by Peter Alvaro52:29

"I See What You Mean" by Peter Alvaro

Strange Loop Conference
59K views • 11 years ago
How Modern SQL Databases Come up with Algorithms that You Would Have Never Dreamed Of by Lukas Eder50:31

How Modern SQL Databases Come up with Algorithms that You Would Have Never Dreamed Of by Lukas Eder

Devoxx
55K views • 9 years ago
Advanced Topics in Programming Languages: A Lock-Free Hash Table58:36

Advanced Topics in Programming Languages: A Lock-Free Hash Table

GoogleTalksArchive
29K views • 14 years ago
Andrew Kelley: A Practical Guide to Applying Data Oriented Design (DoD)46:40

Andrew Kelley: A Practical Guide to Applying Data Oriented Design (DoD)

ChimiChanga
415K views • 2 years ago
Greg Young - CQRS and Event Sourcing - Code on the Beach 20141:03:48

Greg Young - CQRS and Event Sourcing - Code on the Beach 2014

Code on the Beach
170K views • 12 years ago
C++ and Beyond 2012: Herb Sutter - atomic Weapons 2 of 21:32:33

C++ and Beyond 2012: Herb Sutter - atomic Weapons 2 of 2

alexsmail
29K views • 9 years ago
Google I/O 2012 - Go Concurrency Patterns51:27

Google I/O 2012 - Go Concurrency Patterns

Google for Developers
894K views • 14 years ago
C++Now 2018: You Can Do Better than std::unordered_map: New Improvements to Hash Table Performance1:30:53

C++Now 2018: You Can Do Better than std::unordered_map: New Improvements to Hash Table Performance

CppNow
63K views • 8 years ago