Home / Work

Data-Citizen

Context. NYC Open Data publishes thousands of datasets through Socrata. Each app built on the portal solves the same three problems again: catalog, quality and relationships. Data-Citizen solves them once and stores the answers. It is a DataBlock product, designed, built and run by Edward Plata.

The problem

Find the right dataset, know if it is any good, and know what it joins to, without opening each one.

Approach

  • Pushdown instead of a bronze layer. The usual design copies rows and queries the copy. Edward measured the other option first: Socrata filters and aggregates on its own servers, and returns a small answer. So the silver layer stores facts about datasets and never source rows.
  • A rule for what goes in the layer. A fact belongs there only if it is expensive to derive, stable, and wanted by more than one consumer.
  • A nightly worker crawls the catalog, profiles columns, scores quality and embeds changed datasets. Batches choose datasets by staleness, not popularity, so coverage grows each night.
  • Safe queries. The planner allows only known columns and quotes every value. The agent's SQL runs as a login whose only role is read-only, with a time limit and a row limit.
  • Failures that say what they are. A missing table returns an error that names the fix. A down database returns an error that says the database is down.

Result

The app is live. The silver layer covers the full catalog and refreshes nightly. CI runs unit, replay, database, end-to-end and worker suites on every pull request, and an agent evaluation suite runs nightly.

Lessons a client can use

  • A job that reports "ok" can still do nothing. Count what it changed.
  • The paths that move rows are where the cost is. Quality scoring moved from a serverless function billed by the second to a server billed by the month.
  • A fallback you have not tested is not a fallback.

The full write-up is on edwardplata.com: A silver layer and an agent over NYC Open Data.

Stack

Next.js, TypeScript, Supabase Postgres, Socrata SODA, Python, Docker, DuckDB, Vercel.

Need a catalog, quality scores or a safe agent over your data?

Book a 30-minute call

Ask a question