Loading…
How Reblogs Work
engineering
Summary
Tumblr reblog trees expand from an original root post into branching reblog trails as users reshare and comment on content. Storing these trails traditionally using relational database joins would require numerous queries per post on trails that extend thousands of levels deep. To maintain a constant query load of one query per post, Tumblr copies reblog trail content on every reblog rather than fetching intermediate posts at runtime. Older posts stored this copied content within deeply nested HTML blockquotes relying solely on permalink URLs, which caused trails to break whenever blogs changed their names. With the Neue Post Format, Tumblr moved to a JSON array structure that embeds trail content alongside immutable references to each blog and post, reducing broken trails while preserving single-query post loading.
Context
Tumblr needed to serve deeply nested reblog trails efficiently at scale without issuing variable numbers of database queries for trails containing thousands of posts, while avoiding broken links caused by blog renames in legacy nested HTML blockquotes.
Approach / What changed
Tumblr denormalizes reblog trails by copying trail content onto each reblog to keep loading queries constant at one per post, migrating from nested HTML blockquotes to Neue Post Format JSON arrays containing immutable post and blog identifiers.
Takeaways
- Denormalizing reblog trail content on every reblog allows Tumblr to render posts in a single query rather than executing expensive relational joins on trails thousands of posts long.
- Relying purely on permalink URLs inside legacy nested HTML blockquotes caused broken trails whenever users changed their blog names or usernames were reclaimed.
- The Neue Post Format replaces HTML blockquotes with a JSON array that stores both trail content and immutable post and blog identifiers to survive renames while still permitting fallback lookups.
Related reading
engineering.tumblr.com ·
Hey there 👀 @jubs here…
Tumblr engineering addressed user questions regarding reblog trail architecture, post storage semantics, and upcoming product experiments in Labs. Engineers explained that reblogging captures an independent copy of post content at that moment in time, meaning subsequent edits to the original post do not propagate to prior reblogs. Older non-NPF reblog trails lack globally unique post identifiers and rely on blog names and post IDs, causing broken references when usernames change. Repairing these historical records via a backfill would require scanning billions of post records and traversing reblog trees, which could demand over a year of processing time at current capacity. Alongside architecture discussions, Tumblr introduced Labs features including full-screen web messaging, message requests, and an Android settings redesign.
engineeringengineering.tumblr.com ·
Now testing: Best comments first
Tumblr has introduced an experimental comment sorting option called Best comments first for users browsing content on the web platform. This new sorting capability functions directly alongside standard chronological options within the comments view on any individual post. The engineering team designed this feature to help readers discover interesting conversations much more easily while actively demoting spammy comments. The implementation is currently undergoing active live testing and fine-tuning exclusively on web, with engineers soliciting community feedback to improve how it operates. Accompanying engineering records highlight various Hack Day prototypes, including LibreTranslate post translation, keyboard command palettes, and dense multi-column feed views.