---
title: "From 2,500 requests to 24: Rebuilding star history without the stargazers"
description: "GitHub replaced identity-bearing stargazer pagination with an aggregate star-history endpoint that returns up to 30 weeks of daily star counts per request, with no usernames attached."
url: "https://swe.quest/articles/from-2-500-requests-to-24-rebuilding-star-history-without-the-stargazers-7995b4a68a7c537d"
canonical: "https://github.blog/engineering/architecture-optimization/from-2500-requests-to-24-rebuilding-star-history-without-the-stargazers/"
source: "GitHub Engineering"
published: "2026-10-14"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["api-design","sql","databases","performance","privacy"]
---

# From 2,500 requests to 24: Rebuilding star history without the stargazers

A post on [GitHub Engineering](https://swe.quest/sources/github.md), published 2026-10-14, 7 min read, Case study. Original: [https://github.blog/engineering/architecture-optimization/from-2500-requests-to-24-rebuilding-star-history-without-the-stargazers/](https://github.blog/engineering/architecture-optimization/from-2500-requests-to-24-rebuilding-star-history-without-the-stargazers/)

## Summary

GitHub replaced identity-bearing stargazer pagination with an aggregate star-history endpoint that returns up to 30 weeks of daily star counts per request, with no usernames attached. Aggregating stars and then paginating with LIMIT/OFFSET still forced the database to scan and group every star on each call, so the shipped design converts page parameters into an indexed created\_at range and filters by time before grouping. Building react/react's full history drops from about 2,511 requests to 24, with each star examined roughly once. Unusually dense weeks remain a scaling limit, and the same audit moved the stargazers page to cached counts, eliminating its slow queries.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [SQL](https://swe.quest/tags/sql.md) (Languages)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Privacy](https://swe.quest/tags/privacy.md) (Security)

## Prerequisites

- SQL GROUP BY and LIMIT/OFFSET ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- database indexes ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))
- REST API pagination ([easy posts on API design](https://swe.quest/tags/api-design.md?difficulty=easy))

## Keywords

GitHub REST API, stargazers endpoint, Star History, react/react

## Related posts

- [How we scaled the GitHub API with a sharded, replicated rate limiter in Redis](https://swe.quest/articles/how-we-scaled-the-github-api-with-a-sharded-replicated-rate-limiter-in-redis-c2f9366d9d874889.md): GitHub Engineering · 2021-04-05 · Medium · 9 min read · Caching, Replication, API design, Scaling, Ruby
  GitHub replaced a Memcached-based API rate limiter, which suffered evictions and could not survive a move to per-datacenter caches, with application-sharded Redis clusters (one primary, several read replicas) and atomic Lua scripts, rolled out behind a feature flag.
- [How a broken release name overloaded our symbolication database](https://swe.quest/articles/how-a-broken-release-name-overloaded-our-symbolication-database-a58ed5f9f475f6d7.md): Sentry · 2026-11-09 · Medium · 7 min read · PostgreSQL, Performance engineering, Incidents & postmortems, Resilience, Debugging
  A handful of customer releases with unexpanded names like \`VERCEL\_GIT\_COMMIT\_SHA\` accumulated tens of millions of URL index rows in Sentry's Postgres 14 files database, and an unbounded source-map URL lookup kept scanning them, timing out and being retried.
- [Rebuilding Guardian: How Pinterest Upgraded Its Real-Time Abuse Platform to Modern Infrastructure…](https://swe.quest/articles/rebuilding-guardian-how-pinterest-upgraded-its-real-time-abuse-platform-to-dda792e38f97dd45.md): Pinterest Engineering · 2026-11-16 · Medium · 12 min read · Stream processing, Analytics & OLAP, Threat detection, System design, Data pipelines
  Pinterest rebuilt Guardian, its real-time abuse detection platform, from a monolithic in-house system into a modular V2 that separates interactive analytics, continuous action evaluation and historical replay.
- [The technology behind GitHub’s new code search](https://swe.quest/articles/the-technology-behind-github-s-new-code-search-7c9e939ab132b5db.md): GitHub Engineering · 2023-02-06 · Medium · 13 min read · Search, Rust, System design, Scaling, Data structures
  GitHub built Blackbird, a Rust code search engine, because general text search engines handled punctuation, regex, and GitHub's scale poorly, and brute-force grep would yield about 0.01 QPS.
- [Implementing "seen by" functionality with Postgres](https://swe.quest/articles/implementing-seen-by-functionality-with-postgres-42ef1db52a88742a.md): Supabase · 2022-07-18 · Medium · 21 min read · PostgreSQL, Data structures, Performance engineering, Databases
  Four ways to track post views in Postgres are benchmarked: a naive counter column, an hstore of viewer IDs per post, an association table, and the HyperLogLog extension.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
