Jon Skeet’s election site: a hobby project built for a longer game

An immutable data model and content-addressed snapshots keep a read-only election site simple, while years of runway leave room to learn.

JSJon Skeet연사
채널
GOTO Conferences
게시일
2026년 12월 2일
영상
39:47
읽기
8분
슬라이드
4
원문
영어
YouTube에서 열기
스크롤하면 영상이 오른쪽 아래로 작아져 계속 재생됩니다. 자막은 읽기 언어를 따릅니다.
읽기 언어2개 언어로 읽을 수 있음
이 글은 아직 한국어 번역이 없어 영어 원문으로 표시합니다.
요약

30초 요약

Jon Skeet’s election site serves a complete, read-only snapshot of UK polling and results, then changes snapshots atomically using a manifest of content hashes. A health check notices updates without making visitors wait for storage to reload. The site began as a three-week experiment during the 2024 election; a longer horizon lets him explore cloud deployment, immutable C# records and data design without having to make every decision now. His reason for building it is straightforward: learning and writing code are enjoyable.

  1. 1Election data is small enough to keep in memorySkeet says aggregating projections and results makes scattered data more accessible while keeping the implementation manageable.
  2. 2The site reads shared storage; local tools are its writersCloud Build and Cloud Run serve a web app backed by Firestore, while Skeet experiments with alternate storage and deployment.
  3. 3Immutable records and two layers keep data manageableIndependent core objects load separately; polls and projections refer to those objects, with lookup maps and view models kept apart.
  4. 4A health check notices updates without blocking visitorsSkeet uses a periodic health check to look for a new storage version rather than making each page request wait for a reload.
  5. 5A manifest makes a multi-file update appear atomicData is written under its SHA-256 hash, then the manifest is published last. A reader with an older manifest can still use its matching documents.
  6. 6A record copy can retain stale computed propertiesThe C# with expression shallow-copies an existing record before replacing properties; a value computed during construction is not automatically recomputed.

핵심 정리

  1. Publish a manifest after its referenced data so readers can load a consistent snapshot and reuse unchanged content.
  2. Separate stored identifiers from the richer objects and lookup maps used by the application.
  3. Use a stable data source locally and separate staging from production to experiment safely.
  4. A C# record’s with expression makes a shallow copy; constructor-computed properties can therefore retain stale values.
  5. A hobby project can be scoped around learning and enjoyment rather than a fixed business deadline.
전문

챕터별로 다듬은 전문 읽기

원본 자막만 보기
01

An election-night experiment becomes a longer project

A 2024 election site inspired Skeet to build for the next UK election. His goals are usefulness, learning and fun.

On 4 July 2024, the UK held a general election. In the weeks before it, I built a small website comparing seat projections with results as they arrived, and enjoyed the spare-time coding enough to want to do it again.

On election day I registered election2029.uk, assuming the next election’s likely date, and put up a holding page using Google Cloud. I later acquired election.uk too, in case an earlier election makes the year-specific name less useful.

Election data is a satisfying size: large enough to present in different ways and help people find their constituency, candidates and history, yet small enough to fit easily in memory. The information exists in many places, so collecting it consistently adds value.

On election night I want to show the latest results without requiring readers to navigate extra commentary. The primary goal, though, is to have fun; usefulness matters, but the world will not mourn if my site is not indispensable.

I have imposed some constraints. Beyond ASP.NET Core, I am avoiding front-end frameworks such as Bootstrap and Tailwind; the site uses plain HTML and CSS with some JavaScript. I have also chosen not to use AI for the code.

By 2029 I may regret writing everything by hand or be glad I did; for now it is a one-person longitudinal experiment. I also want to keep costs low and learn about infrastructure, monitoring and OpenTelemetry.

New polls arrive every day or two, so tooling must make adding them less tedious. A hobby project should remain enjoyable rather than becoming a source of unnecessary toil.

I hope the talk encourages someone to start a project, return to one left aside, or contribute to someone else’s. My enthusiasm is not a claim that every design choice here is exemplary.

02

Exploring constituencies, polls and projections

The read-only site presents constituency lookup, graphs, maps and flows of seats. It does not track visitors.

The site is data-heavy. Readers can hide explanatory text after seeing it once, search for a constituency by UK postcode or name, and inspect projections and previous election results.

Poll pages offer graphs and selectable timelines. Maps show projections and results, while Sankey diagrams show how seats moved between parties; I use Plotly for graphics I would not know how to draw myself.

A public diagnostics page exposes the revision and commit because making it public is simpler than adding access control. The read-only site sets no cookies and does not track visitors.

03

A small architecture with multiple environments

A web application reads storage while tools write it. Skeet uses staging, production and local files, and experiments with another cloud.

The logical architecture is simple: the web application reads storage, while tools I run from my laptop write it. The source repository is private because it includes copies of polling data, even though providers have given permission to use the data.

Read-only web app and storage
슬라이드 1 / 4Read-only web app and storageThe web application reads shared storage while local tools maintain the data.

Google Cloud Build builds containers for Cloud Run, with Firestore as storage. The app’s only Firestore query asks for the latest manifest; the data does not really require a full-featured database.

After rehearsing the talk at work, I tried another provider. I had no AWS account that Tuesday morning, could read and write S3 by evening, and had deployed on AWS by Friday evening.

The change to enable AWS Lambda took about four lines, including a package and service registration. I credit the evolution of the industry, rather than my own cleverness, for making that kind of experiment practical.

The front end is mostly HTML, CSS and JavaScript. I like static typing and might convert to TypeScript, but a long-running personal project gives me the freedom to defer that decision for a year or two.

Staging deploys automatically when I commit to main; production deploys when I tag a release. Staging has a banner and fake results so I can see what the site might look like on election night.

For local development I want to work quickly without a live database. Production and staging use Firestore, whereas locally I use JSON files; until recently those were stable files such as parties.json and constituencies.json.

04

Immutable election data and view models

Core objects load independently and other data refers to them. Immutable view models separate presentation logic from stored data.

The site’s value depends on constituency, poll, projection, map and result data. Nearly all of it fits in memory; postcode data is the awkward exception.

Immutable data model
슬라이드 2 / 4Immutable data modelIndependent core types form the base for non-core records and derived contexts.

The basic data types are mostly immutable C# records. I try to keep computed lookups out of those records, even though the app needs maps from constituency codes to objects and from constituencies to results.

I distinguish “core” data, such as parties, constituencies and postcodes, from other data. Core objects do not refer directly to one another, so they can load independently.

Polls and projections refer to those core objects, but non-core objects do not cross-reference one another. Two levels have sufficed so far; if the model eventually needs more, I will have to revisit the design.

Lookup maps augment the underlying data rather than living in it. I also distinguish the storage representation from the logical model: a stored poll contains a party ID, while the logical model can refer to the party object.

I put an MVVM-style layer over the immutable data, borrowing from an application I wrote for my church’s audiovisual system. An expert might disagree with where I have placed responsibilities; I do not claim expertise in the pattern.

A Razor page receives a constituencies view model through dependency injection and picks the item it needs. The page contains only simple presentation logic, while the view model lives in a separate project and can be tested.

I add tests where they are useful rather than writing tests I expect to rewrite for every unimportant change. The view models are further-processed versions of the data and remain immutable.

Because the site is read-only and data changes infrequently, everything is cached. Without caching, a request would have to process the Razor page again, but immutable data would still simplify the rest.

I expect the site to handle large traffic if it happens, though it might produce a larger cloud bill. The harder question is how to update data atomically while requests are using cached objects.

05

Refreshing cached data without slowing requests

The storage interface supports loading and writing snapshots. A periodic health check can trigger a storage refresh.

A small storage interface stores and loads an election context, flushes caches, describes its backend and can prune or delete data. Deleting everything can be simpler after a schema change than trying to read incompatible old files.

There are two problems: make related data change together, and notice updates promptly without blocking visitors. Checking storage on every request could make a user wait a second or two while caches are populated.

Individual pages can be cached for about ten seconds, but I do not want the request that detects expiration to perform a slow storage load. A separate scheduled task and a restricted API would add infrastructure I would rather avoid.

There is a public reload endpoint for diagnostics, although I may disable it for the election to avoid abuse or unexpected costs. It is not my preferred mechanism for routine refreshes.

The application already has internal and external health checks. A check can take up to ten seconds, so roughly once a minute it also sees whether storage has a new version and reloads if necessary.

I am not asserting that this is a universally good pattern. It is a pragmatic, somewhat hacky answer to my own problem, and it has worked without needing further attention.

06

A manifest ties each snapshot together

Content-addressed documents are written before their manifest. Old readers remain consistent and unchanged documents can be reused.

Atomicity matters because I do not want a snapshot to combine old parties with new constituencies. During local development a conflicting simultaneous update would be my own mistake, but a deployed reader needs consistency.

I thought of a solution around 1:30 in the morning and was interested enough to implement it before going back to sleep. One document, called a manifest, points to all the other documents that make up a snapshot.

Production, staging and tests have separate Firestore databases. A manifest stores SHA-256 hashes identifying the latest document for each data domain, such as by-elections.

A Firestore manifest of hashes
슬라이드 3 / 4A Firestore manifest of hashesEach data domain points to a content-addressed document; a manifest ties them into one snapshot.

The reader loads the manifest and finds a document named by each hash. I write the data first and the manifest last, so a reader following a manifest can find the corresponding documents.

An older site instance can keep loading its old manifest because the old content-addressed documents remain separate. When a new manifest retains a hash, the instance can reuse the data it already has.

Polls and manifests change frequently, while much of the rest stays the same. When the health check notices a new manifest, the loader can retrieve only changed documents rather than replacing everything.

My initial S3 implementation copied the Firestore code and changed provider-specific pieces, which was useful to prove the approach but duplicated logic. After the rehearsal I spent the weekend refactoring instead of polishing the talk.

07

Refactoring storage across providers

Skeet first copied the Firestore implementation for S3, then extracted the shared manifest approach and added other backends.

I extracted a shared manifest-based storage abstraction and added a file-based implementation. Stable JSON files remain useful in source control for diffs; the frequently changing manifest files are kept outside it.

Once the abstraction existed, adding Google Cloud Storage took about 20 minutes. I already knew that service well, however: I had written its client library, unlike S3, which was new to me.

08

A surprising corner of C# records

A with expression shallow-copies a record, which can leave properties computed during construction stale. Skeet wrote an analyzer to flag the pattern.

The main lesson I want to convey is that writing code can be fun. If work changes leave you missing coding, a personal project can offer a place to do it, provided you have time and the circumstances to do so.

Even a language I know well can surprise me. I work on the C# standardization committee, yet encountered a record bug I did not understand until I examined how the with expression works.

I thought a with expression called the constructor again with changed properties. Instead it shallow-copies the existing record and then replaces the specified properties before returning the result.

A C# record copied with changed values
슬라이드 4 / 4A C# record copied with changed valuesThe cached Even property is copied from the original rather than recomputed when Value changes.

That matters when a property was computed during construction. In my example a record for an even number is copied with a different number; the copied “even” value remains true because the constructor did not recalculate it.

I wrote a Roslyn analyzer to flag constructor parameters used in property initializers and warn when a marked property is changed with a with expression. The sharp corner is useful for other .NET developers to know.

More broadly, I found an important detail in a language I thought I knew because I was playing with it. Hobby projects let us investigate things we might otherwise never explore.

같은 채널의 다른 글

슬라이드 3장56:46EN
GOTO Conferences· 2026년 12월 1일Tim Berglund: AI History Calls for Small Bets, Not CertaintyTim Berglund · StarTreeAfter decades of ambitious promises and stalled progress, the developer advocate urges engineers to experiment and share what works.AI research모델과 학습Software engineering+1
슬라이드 4장38:45EN
GOTO Conferences· 2026년 11월 30일Barry O'Reilly: Architects Learn by Walking Around a ProblemBarry O'Reilly · Black Tulip TechnologyA model can hide the people and changes a system must serve. O'Reilly suggests using several methods to see different sides of the problem.Software engineering
39:37EN
GOTO Conferences· 2026년 11월 26일Charles Humble: Make Sustainability an AI Architecture DecisionCharles HumbleStart by asking whether the model is necessary, then choose efficient hardware and run flexible jobs when electricity is cleaner.EnergyAI cost & performance모델과 학습+2
슬라이드 4장44:38EN
GOTO Conferences· 2026년 11월 25일Kasper Borg Nissen: Make Observability a Platform ProductKasper Borg Nissen · Dash0Give developers connected telemetry and useful defaults, not another tool they must configure and correlate by hand.관측 가능성과 안정성인프라와 배포Developer productivity+1
슬라이드 4장54:47EN
GOTO Conferences· 2026년 11월 24일Lu Wilson: What happens when everyone can change the codeLu WilsonA music-coding community lets anyone edit, delete or deploy. Its experiments reveal both the power and the strain of giving up control.Coding CultureCommunity building오픈소스와 커뮤니티
45:41EN
GOTO Conferences· 2026년 11월 23일AI made code cheaper, but good products are still hard to buildEvan Ratliff, Tim BerglundTim Berglund and Evan Ratliff weigh cheaper coding, unreliable AI forecasts and why conversational machines can feel like people.AI AdoptionSoftware engineeringConsciousness+2