Design a Governed Catalog and Access Layer for Vendor Price Data
System DesignModel answerLast updated
Design a metadata-driven service that lets quants and PMs find, trust and query licensed vendor market data, with lineage, entitlements, freshness alerts and point-in-time reads.
Scenario
An investment firm buys market data from several external vendors. Each vendor delivers many daily feeds covering thousands of securities. Researchers and portfolio managers currently reach into raw vendor drops in inconsistent ways. You are asked to design a governed data access layer that sits between the vendor feeds and the people who consume them.
Requirements
- Discovery. Users can search for securities, financial fields (for example, prices or earnings estimates) and the vendor that supplies them.
- Provenance. For every value, the system can say which vendor supplied it, when it arrived, and what transformations touched it. Backtests must be exactly reproducible.
- Licensing and access control. Some datasets are restricted by vendor contract. Access must depend on the user's role and on the terms of the relevant license.
- Reliability monitoring. Users are warned when a feed is late, missing, or when a value deviates sharply from its recent moving average.
Scale and interfaces
- Thousands of symbols and hundreds of feeds per day.
- The layer acts as middleware. A Python-based quant and an Excel-based portfolio manager must both be able to use it, and SQL access should also be supported.
What to cover in your answer
- The metadata schema: what do you record about a dataset?
- A high-level architecture: services, storage and APIs.
- The path of data from vendor delivery to the end user.
- How you prevent look-ahead bias when someone requests data as it was known at a past date.
- Briefly, how you would handle identifier changes, multiple vendors for the same field, and diagnosing a backtest whose results suddenly change.
Hints
Hint 1
Treat the catalog as the single front door: users never touch raw vendor storage, and every access path (Python, SQL, Excel) goes through one query service that applies the same rules.
Hint 2
One time axis is not enough for point-in-time correctness. Separate the period a fact describes from the moment your firm learned it, and make corrections append new rows instead of overwriting old ones.
Hint 3
Tag every stored value with the ingestion run that produced it. That single key links the value to the raw vendor file, lineage edges, quality results and license, which makes both audits and 'why did my backtest change?' investigations tractable.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Framing
This is a system design problem. A strong answer centers on three ideas:
- The catalog is the source of truth for what exists, who may see it and where it came from. Raw storage is never exposed directly.
- Point-in-time correctness is built into the storage model and the default query behavior.
- Entitlements are enforced on every access path, not just in one client.
1. Assumptions and scale
- About 10k securities, about 300 daily feeds, about 500 fields per security, so roughly 5M data points per day.
- Twenty years of history is on the order of 25B points. That calls for a columnar or time-series store (Parquet/Iceberg, ClickHouse, kdb+), not a row-oriented OLTP database.
- The catalog itself is small (around 10^5 entries), so Postgres plus a search index is plenty.
- Reads dominate: bulk historical pulls for backtests and small latest-value lookups from Excel.
- Non-functional goals: reproducible queries, auditable access, and freshness alerts within minutes of a missed delivery.
2. Metadata schema
| Entity | Key fields |
|---|---|
| Dataset | id, name, vendor, owner, frequency, expected arrival (schedule + tolerance), schema version, storage location, license id, tags |
| Field | dataset id, name, type, unit, currency, valid range, nullable |
| Security master | internal id, FIGI/ISIN/CUSIP, vendor tickers, valid_from / valid_to |
| License | vendor, scope, redistribution and derived-data rules, permitted roles or desks |
| LineageEdge | upstream, downstream, transform name, code version, run id |
| IngestionRun | run id, dataset, file hash, received_at, row count, status |
| QualityEvent | dataset, run id, check, severity, observed vs expected |
Two details matter. Ticker-to-internal-ID mapping must be time-versioned, since tickers get reused. And every stored value carries a run_id, which ties it to the raw file, lineage and quality results.
3. Architecture and data flow
Vendor APIs/SFTP -> Connectors -> Immutable raw landing (hashed files)
-> Normalize + symbology mapping -> Quality gate (publish | quarantine)
-> Bitemporal append-only store + Catalog/Lineage DB + Monitoring
Query service <- Entitlement service (policy engine + audit log)
-> Python SDK | SQL governed views | Excel add-in (REST)
- Connectors are scheduled from each dataset's expected arrival in the catalog and write vendor files unchanged to raw storage. This allows replay and proves what was received.
- Normalization maps vendor identifiers to internal IDs and standardizes units and currencies.
- Quality gate runs checks. Failing batches are quarantined and raise a
QualityEvent; passing batches are published. - Query service is the only read path. It resolves names via the catalog, asks the entitlement service for a decision, rewrites the request to point-in-time form, executes it and logs usage.
- Interfaces: a Python SDK (
get(fields, ids, start, end, as_of)andsearch(...)), SQL through governed views on a engine such as Trino, and an Excel add-in that calls the same REST API with SSO tokens and local caching. All three share one policy, so there is no second rulebook.
4. Point-in-time reads and look-ahead bias
Use a bitemporal model with two axes:
- Effective time: the period the fact describes (Q1 EPS, a closing price on a date).
- Knowledge time:
known_fromandknown_to, when the firm learned the value.
known_from is the vendor publication or ingestion time, not the period end. Q1 earnings published on April 25 must be invisible to a backtest as of April 1.
For a backtest date T, select rows where the effective date is at or before T and known_from <= T < known_to (with open-ended known_to treated as infinity), then take the latest effective row per security and field.
Corrections never overwrite. Close the old row by setting known_to = now and append a new row with known_from = now. History of what was believed stays intact.
Defaults. The SDK requires an explicit as_of for time-series calls; the backtest default is point-in-time, not "latest."
Other look-ahead sources to cover: survivorship bias (use point-in-time index membership and include delisted names), symbology (point-in-time ticker mapping), and unreliable vendor timestamps (apply a conservative publication lag).
5. Entitlements and licensing
- Use attribute-based access control: user attributes (role, desk, region from SSO) combined with data attributes (vendor, license id, field tags) in a policy engine such as OPA.
- Enforce at the query service: deny or drop unlicensed columns, apply row filters for restricted data, and compile the same policy into SQL views.
- Derived data: lineage edges propagate license restrictions. A factor built from a restricted vendor field inherits that restriction unless the contract allows redistribution.
- Audit: log user, fields, vendor and row counts. This supports vendor usage reports and investigations.
6. Reliability monitoring
- Staleness and missing data: a scheduler compares each dataset's expected arrival plus tolerance with the latest ingestion run. A miss marks the dataset stale in the catalog and alerts the owner and subscribed users. Row-count drops against the previous run flag partial deliveries.
- Outliers: compare each value with a rolling mean and standard deviation (or median and MAD, which is more robust to spikes). Flag values beyond a threshold, such as 4 sigma, but account for legitimate jumps like splits and earnings. Cross-check against a second vendor where available.
- Surface status in search results and in SDK warnings so users see data health before using it.
7. Vendor choice, backfill and debugging
- Multiple vendors: define a per-field priority list in the catalog, store each vendor's values separately, and build a "golden" view that picks by priority and falls back when quality checks fail. Record which source filled each value.
- Backfill: run it as a new ingestion run so lineage and knowledge time stay honest; never silently rewrite history.
- Backtest suddenly changed? Rerun with the same
as_of. If results match the old ones, the cause is a late-knowledge change you intended. If not, diff in order: code version, parameters, then data (comparerun_ids and values for the inputs). The lineage and run ids make this a query rather than guesswork.
Trade-offs and common mistakes
- Bitemporal storage costs more space and query complexity, but it is the only reliable way to reproduce history.
- Centralizing access adds a hop and a potential bottleneck; mitigate with caching and horizontal scaling of the stateless query service.
- Common mistakes: using ingestion date as effective date, updating rows in place on corrections, enforcing entitlements only in the Python client, ignoring ticker reuse, and alerting on every outlier without handling corporate actions.