Real-Time Market Data Engineering: From Ingestion to Push

    This article walks through a practical, vendor-neutral pipeline for building a real-time market data system, using a typical quote record as the running example. It covers how to model quotes with fixed-point integers and UTC timestamps, how to balance freshness, correctness, and cost in the ingestion layer, how to validate derived metrics such as price change and percent change, and how to distribute data with low latency through two-tier caching and throttled server push. It also addresses multi-source failover and cross-checking, observability and alerting, security and compliance, a cloud deployment reference, and a troubleshooting guide. The goal is a system that stays accurate, low-latency, and traceable through market-open spikes and volatile swings, and the same approach applies to any scenario that needs real-time, precise, and auditable time-series data.

    1. Introduction: The Data Engineering Behind a Single Quote

    In financial information systems, quotes are both the most fundamental and the most demanding kind of data. A typical quote record carries only about a dozen fields:

    • Name: Anthropic, PBC
    • Symbol: ANT
    • Market: NASDAQ
    • Currency: USD
    • Last price: 87.64
    • Change: -1.27
    • Percent change: -1.43%
    • Updated: 2026-11-24 05:00:00

    Few as they are, these fields carry four kinds of meaning at once: “what it is” (name and symbol), “where it trades” (market and currency), “what it costs now” (price and change), and “when the data is from” (timestamp). Mishandling any one of them can produce wrong downstream metrics, broken client rendering, or user confusion.

    Using this kind of record as a sample, this article strips away product- and source-specific details and abstracts a general, deployable set of real-time market data engineering practices. It focuses on five questions:

    1. How to model data consistently;
    2. How to ingest it accurately;
    3. How to compute and validate it;
    4. How to distribute it with low latency;
    5. How to stay available under failure.

    1.1 Core Characteristics of Quote Data

    To understand quote data, start with its four defining characteristics. Together they set the basic direction for architecture choices.

    • Time-sensitive: A quote’s value decays quickly over time. Every extra hop in the transport path lowers its freshness.
    • Precision-sensitive: Prices and percent changes must be exact to the cent and the last digit. Floating-point error or the wrong rounding rule shows up directly as “off by a cent” or “off by a couple of basis points” display problems.
    • Strong consistency: Within a single quote, the price, price change, percent change, and timestamp are interrelated. You must never see some fields updated while others still hold old values.
    • Bursty traffic: At the open, the close, major announcements, and violent price swings, both the update rate and the query volume can multiply within a short window.

    1.2 Common Engineering Pitfalls

    Given these characteristics, quote systems tend to fall into five traps in practice.

    1. The precision trap: Using binary floating point directly for price arithmetic and rounding.
    2. The semantics trap: Leaving timestamps without an explicit time zone, producing offsets when parsing across markets and time zones.
    3. The consistency trap: Taking the live price and the previous close from sources that update at different rates, so the change calculation goes out of alignment.
    4. The traffic trap: Forwarding data unconditionally at its raw rate, saturating client rendering and network bandwidth with redundant updates.
    5. The availability trap: A single source failure breaking the entire chain or returning dirty data.

    The sections below address each of these in turn.

    2. Overall Architecture: A Four-Stage Pipeline

    A practical quote system can be abstracted into a four-stage pipeline — ingest → normalize and compute → distribute → consume — with an observability layer running across the whole flow.

    1. [Ingestion] polling / long-lived subscription / file snapshots
    2. │ raw data (multi-source, heterogeneous, varying precision)
    3. ▼
    4. [Normalization] field mapping → unit normalization (fixed-point) → time zone unification (UTC)
    5. │ price-change and percent-change computation → quality validation → quote events
    6. ▼
    7. [Cache & Distribution] centralized cache + local cache + incremental push / batch query
    8. │
    9. ▼
    10. [Consumption] Web / mobile / dashboards / downstream compute jobs
    11. Observability: ingestion latency, source availability, validation failure rate, push latency, cache hit rate → monitoring & alerting

    The point of layering is to decouple responsibilities:

    • Changes to upstream sources affect only the ingestion stage;
    • Changes to computation and validation rules affect only the normalization stage;
    • Adding a new consumer requires no changes to the first two stages.

    3. A Unified Data Model: Define It First, Then Write Code

    3.1 Two Core Principles

    The modeling stage should hold to two principles:

    • Separate raw data from display data. Keep the full set of source fields in the raw layer for traceability and recomputation. Keep the display layer lean and fixed in format, serving only APIs and UIs. Mixing the two is the main cause of later “change one field, break a batch of pages” incidents.
    • Represent all numeric fields as fixed-point. Store prices and changes as integers in the smallest currency unit (for example, cents), never as floating point. This applies to any scenario where data is denominated in currency.

    Why is this necessary? The illustrative code below shows a typical binary floating-point problem:

    1. a, b = 87.64, 88.91
    2. # Floating-point error: prints -1.2700000000000102
    3. print(f"change = {a - b:.16f}")
    4. # The two rounding approaches disagree: round() prints 87.63, Decimal prints 87.64
    5. print("round(87.635, 2) =", round(87.635, 2))
    6. print("Decimal rounding =", Decimal("87.635").quantize(Decimal("0.01"),
    7. rounding=ROUND_HALF_UP))
    8. # Decimal must also be built "from a string", or floating-point error leaks in
    9. c = Decimal(str(0.1)) + Decimal(str(0.2))
    10. print(c == Decimal("0.3")) # True

    The reason is that decimal fractions such as 0.1 cannot be represented exactly in binary floating point, so error accumulates over repeated arithmetic. The standard practice in finance is to do integer arithmetic in the smallest currency unit, convert to a fixed-point decimal only at the display layer, and consistently apply round-half-up (ROUND_HALF_UP).

    3.2 Model Fields and Constraints

    Field Meaning Key constraint
    symbol Ticker symbol Globally unique; a “market + symbol” composite key is recommended
    name Display name Display only; not used in computation or joins
    market Exchange / market Determines trading hours, time zone, and price precision
    currency Currency Required for cross-border business; never compare across currencies directly
    last Last price Integer in cents; must be positive
    prev_close Previous close Basis for the change calculation; updated once per day
    change Price change Derived from last and prev_close; in cents
    change_pct Percent change Derived from change and prev_close; two decimals
    timestamp Quote time Stored in UTC; converted to a time zone only for display
    source Data source Used for multi-source comparison and problem triage
    seq Sequence number Used for out-of-order detection and deduplication when the source provides it

    3.3 Core Model Implementation

    The illustrative code below implements a unified quote model. It stores prices as fixed-point integers and funnels all price-change and percent-change logic through a single entry point, so every business line produces identical results without reimplementing the math:

    1. import time
    2. from dataclasses import dataclass
    3. from datetime import datetime, timezone
    4. from decimal import Decimal, ROUND_HALF_UP
    5. CENT = Decimal("0.01")
    6. @dataclass(frozen=True)
    7. class Quote:
    8. symbol: str # ticker symbol, e.g. "ANT"
    9. name: str # display name, e.g. "Anthropic, PBC"
    10. market: str # exchange/market, e.g. "NASDAQ"
    11. currency: str # currency, e.g. "USD"
    12. last: int # last price: integer in the smallest currency unit (cents)
    13. prev_close: int # previous close: integer, same unit
    14. timestamp: int # quote time: UTC timestamp in milliseconds
    15. source: str = "" # data source identifier
    16. @property
    17. def change(self) -> int:
    18. """Price change (in cents), derived from last price and previous close"""
    19. return self.last - self.prev_close
    20. @property
    21. def change_pct(self) -> Decimal:
    22. """Percent change (two decimals); returns 0 when the previous close is invalid"""
    23. if self.prev_close <= 0:
    24. return Decimal("0")
    25. pct = Decimal(self.change) / Decimal(self.prev_close) * 100
    26. return pct.quantize(CENT, rounding=ROUND_HALF_UP)
    27. @property
    28. def stale(self) -> bool:
    29. """Whether the quote has not updated for more than 1 minute"""
    30. return time.time() * 1000 - self.timestamp > 60_000
    31. def to_display(self) -> dict:
    32. """Convert to the display structure consumed by the frontend"""
    33. utc_time = datetime.fromtimestamp(self.timestamp / 1000, tz=timezone.utc)
    34. return {
    35. "symbol": self.symbol,
    36. "name": self.name,
    37. "market": self.market,
    38. "currency": self.currency,
    39. "price": f"{self.last / 100:.2f}",
    40. "change": f"{self.change / 100:.2f}",
    41. "change_pct": f"{self.change_pct}%",
    42. "time": utc_time.strftime("%Y-%m-%d %H:%M:%S UTC"),
    43. "stale": self.stale,
    44. }
    45. # Build from the sample data: last price 87.64 USD, previous close 88.91 USD
    46. # (derived from 87.64 - (-1.27)); quote time in UTC
    47. quote = Quote(
    48. symbol="ANT", name="Anthropic, PBC", market="NASDAQ", currency="USD",
    49. last=8764, prev_close=8891,
    50. timestamp=int(datetime(2026, 11, 24, 5, 0, tzinfo=timezone.utc).timestamp() * 1000),
    51. source="feed-a",
    52. )
    53. print(quote.to_display())
    54. # {'symbol': 'ANT', 'name': 'Anthropic, PBC', 'market': 'NASDAQ', 'currency': 'USD',
    55. # 'price': '87.64', 'change': '-1.27', 'change_pct': '-1.43%',
    56. # 'time': '2026-11-24 05:00:00 UTC', 'stale': True}

    This code reflects two design decisions:

    1. Price change and percent change are derived only from the last price and the previous close, guaranteeing that the same instrument computes identically across every channel.
    2. “Whether the quote is stale” is modeled as an inherent property of the model, not something the UI judges on its own. In the sample, the quote time is more than a minute old, so stale is True, and the frontend can use that to warn the user that the data may be delayed.

    4. Ingestion: Balancing Timeliness, Correctness, and Cost

    4.1 Three Signals to Read From the Sample Record

    Before building ingestion, you can read three notable signals straight off the sample record.

    Signal one: the quote time falls outside normal trading hours. 05:00 is earlier than the regular U.S. session (9:30 a.m. to 4:00 p.m. Eastern Time), which suggests this record most likely comes from pre-market trading or a pre-market snapshot. Prices here can swing sharply on thin liquidity, and the change basis (previous close) is not unique — there may be two versions, a regular-session close and a pre-market close. The ingestion layer must label the basis explicitly rather than letting consumers guess.

    Signal two: the timestamp must carry its own time-zone semantics. Read as different time zones, the same string “05:00:00” can differ by more than 12 hours. The consistent approach is:

    • Convert everything to UTC at ingestion and store it that way;
    • Emit an explicit time-zone marker in API output, for example 2026-11-24T05:00:00Z;
    • Let the frontend convert to the user’s local time zone for display only.

    Signal three: price precision varies by market. Some markets (most A-share instruments, for example) quote with a minimum tick of 0.01 CNY; others (many U.S. instruments) support prices down to 0.0001 USD. The “smallest unit” in the model should depend on the market — U.S. equities, for instance, can use one ten-thousandth of a cent — with the precision conversion driven by the market field. Never hard-code “two decimals” globally.

    4.2 Three Ingestion Methods

    Ingestion methods fall into two families: snapshot pulls and streaming subscriptions.

    • Snapshot polling: Actively request data at a fixed interval, returning the full or incremental state at that moment. It is simple to implement and easy to retry and backfill, but timeliness depends on the polling frequency, and cost grows linearly with it.
    • Streaming subscription: Hold a long-lived connection to the source, which pushes data as it is produced. Latency is low and overhead is small, but you must handle heartbeats, reconnection, and out-of-order messages.
    • Batch file snapshots: Some sources publish full data as periodic files, suitable for baseline calibration and offline replay, and useful as a cross-check against the other two methods.

    The guiding principle is “stream by default, poll as a fallback”:

    • Prefer streaming subscription for sources that support long-lived connections;
    • Configure low-frequency polling for key instruments as a cross-check;
    • When the quote time is more than a set threshold (for example, 30 seconds) behind now, actively trigger a fallback pull.

    4.3 Polling Frequency and Dynamic Backoff

    Polling frequency is a trade-off between timeliness and cost. Configure it by liquidity tier: one poll every 1–3 seconds for actively traded instruments, and one every 5–10 seconds for instruments with ordinary liquidity. To keep all tasks from firing at the same instant, add random jitter on top of the fixed interval.

    When the source returns rate-limit errors or the error rate climbs, use exponential backoff with jitter so a retry storm does not overwhelm the source:

    1. import random
    2. def next_interval(current: float, base: float, max_interval: float, failure: bool) -> float:
    3. """Adjust the next polling interval (seconds) based on ingestion results"""
    4. if not failure:
    5. return max(base, current * 0.8) # after success, converge gradually toward the base interval
    6. backoff = min(current * 2, max_interval)
    7. return backoff * random.uniform(0.8, 1.0) # add jitter so tasks don't retry in lockstep

    5. Computation and Validation: Making Every Number Defensible

    5.1 Computation Rules

    Price change and percent change have the strongest derived relationships in a quote. Defined as follows (taking change as the example):

    • Price change = last price − previous close
    • Percent change = price change ÷ previous close × 100%, to two decimals
    • When the previous close is 0 or missing, set percent change to 0 and mark the field unusable

    Plugging in the sample data:

    • Price change = 87.64 − 88.91 = −1.27 (USD), matching the original record;
    • Percent change = −1.27 ÷ 88.91 × 100% ≈ −1.4284%, which rounds to −1.43%, again matching.

    5.2 Quality Validation Based on Error Analysis

    “Being able to compute a number” is far from enough — it must also be computed correctly. The validation function below turns common data-quality problems into executable rules:

    1. from decimal import InvalidOperation
    2. def validate_quote(q: Quote, now_ms: int) -> list[str]:
    3. """Validate a quote; returns a list of issues (an empty list means it passed)"""
    4. errors = []
    5. if q.last <= 0 or q.prev_close <= 0:
    6. return ["prices must be positive"]
    7. if q.timestamp > now_ms + 5_000:
    8. errors.append("quote time is ahead of the current time")
    9. # Intraday data not updated for over an hour is stale (switch to an overnight threshold after the close)
    10. if now_ms - q.timestamp > 3600_000:
    11. errors.append("quote is stale")
    12. # Not a zero division, NaN, or infinity
    13. if q.change_pct == 0 and q.last != q.prev_close:
    14. errors.append("percent change computed incorrectly")
    15. # Intraday percent change normally stays within 20%; beyond that, check the previous-close basis first
    16. if abs(q.change_pct) > 20:
    17. errors.append("percent change outside the normal range; possible previous-close basis error")
    18. # If the source provides seq, it can be used to detect out-of-order and duplicate messages
    19. return errors
    20. now = int(time.time() * 1000)
    21. for err in validate_quote(quote, now):
    22. print("validation failed:", err) # Output: validation failed: quote is stale

    The “percent change beyond 20%” rule is especially important. Apart from special cases such as a stock’s first days after listing, most mature-market instruments rarely move more than 20% in a single day on the main board. An anomalous percent change usually points to a wrong previous-close basis, for example:

    • Treating yesterday’s pre-market price as the previous close;
    • An adjusted previous close caused by a rights issue, dividend, or stock split;
    • Inconsistent definitions of the previous close across data sources.

    Once such problems flow downstream, every analysis that depends on change metrics becomes distorted.

    5.3 Out-of-Order and Deduplication

    Streaming sources cannot guarantee strictly ordered delivery, especially when multiple nodes ingest in parallel. There are two strategies for handling out-of-order messages:

    • When the source provides a sequence number, record the highest processed sequence per “sequence + instrument” and discard duplicate or stale messages;
    • When the source provides no sequence number, compare by quote time and accept an update only when the new timestamp is greater than or equal to the current value.

    The illustrative code below implements the latter:

    1. def accept_quote(state: dict, incoming: Quote) -> bool:
    2. """Out-of-order guard: accept a quote only if its timestamp is newer"""
    3. key = f"{incoming.market}:{incoming.symbol}"
    4. prev_ts = state.get(key, 0)
    5. if incoming.timestamp < prev_ts:
    6. return False
    7. state[key] = incoming.timestamp
    8. return True

    5.4 Handling Market States

    During call auctions, trading halts, or no-trade periods, the last price can stay unchanged for a long time. In that case, “quote time” has two possible meanings:

    • The time of the most recent trade;
    • The time of the most recent state change.

    It is best to keep both fields: trade time drives the quote’s “freshness,” and state time explains “why there is no new price.” If you keep only one timestamp, the client easily mistakes “no trades for a long time” for “the feed has stopped.”

    6. Caching and Distribution: Delivering Data With Low Latency and Low Cost

    6.1 Two-Tier Caching

    Normalized quotes need caching to be distributed efficiently. A two-tier structure of “centralized cache + local cache” is recommended:

    • Centralized cache: The full set of quotes lives in an in-memory cache shared by all service instances. It is the system’s single source of truth and the data source a new instance uses to warm up quickly after a cold start.
    • Local cache: Each service instance keeps a local snapshot of hot instruments. Reads avoid a network round trip and go stale only when the instance’s node fails.

    The two tiers sync through a publish/subscribe mechanism: after an update, the writer publishes a notification, and each instance refreshes the corresponding instrument’s local cache on receipt.

    6.2 Transport: Polling or Push

    How data reaches the client sets the ceiling on the real-time experience.

    Dimension Short/long polling Server push
    Timeliness Bounded by the polling interval Near real-time
    Network cost Many wasted requests and response headers Transmits increments only
    Implementation complexity Low; naturally fits request/response Requires managing connection lifecycle
    Fit Low-frequency refresh, simple dashboards Order book, intraday ticks, other high-frequency cases

    Choose a push method by scenario:

    • For scenarios that only need one-way server-to-client quote delivery, Server-Sent Events (SSE) work well — simple to implement with automatic reconnection;
    • For scenarios needing two-way communication (subscribe, unsubscribe, heartbeat), use WebSocket;
    • Either way, you must implement heartbeats and timeout detection to avoid a false “online” state where the connection is open but the data has stopped.

    6.3 Throttling and Coalescing

    Forwarding high-frequency quotes as-is pushes a flood of intermediate states to the client, wasting bandwidth and slowing frontend rendering. The recommended approach is latest-value coalescing: within a fixed window (for example, 500 ms), push only the last update for that instrument and drop the intermediate values:

    1. import asyncio
    2. import json
    3. async def push_loop(conn, queue, interval=0.5):
    4. """Push quotes to a single connection at a fixed interval; keep only the latest value in each window"""
    5. latest = None
    6. while True:
    7. try:
    8. latest = await asyncio.wait_for(queue.get(), timeout=interval)
    9. except asyncio.TimeoutError:
    10. pass
    11. if latest is not None and conn.open:
    12. try:
    13. await conn.send(json.dumps(latest, ensure_ascii=False))
    14. latest = None
    15. except Exception:
    16. break # connection dropped; exit the push loop and wait for reconnection

    Beyond time-based throttling, you can add a minimum price-move filter: push only when the price changes by at least a set amount. During violent swings, throttling protects bandwidth; during quiet periods, the filter keeps the stream from feeling laggy.

    6.4 Rate Limiting, Circuit Breaking, and Degradation

    For untrusted external callers, the distribution layer needs several lines of defense:

    1. Per-caller rate limiting: Use token bucket or sliding window algorithms to cap requests per unit time and concurrent connections separately.
    2. Batch interfaces: Let a single request carry multiple instruments to reduce round trips.
    3. Circuit breaking: When the error rate of a downstream cache or source exceeds a threshold, reject requests for a short window to contain the fault.
    4. Tiered degradation: When a source is unavailable, fall back in order to a backup source, then the last valid snapshot, and clearly mark in the response that the data is stale. When all channels are down, return an explicit message with an error code — never empty data or fabricated data.

    7. Multi-Source Fusion and Consistency

    Production environments usually connect several data sources at once. Each has its own strengths and weaknesses in latency, coverage, precision, and stability, so multi-source is not simple redundancy — it is a data-quality strategy.

    • Primary/backup switching: Score each source by health (latency, error rate, validation failure rate) and pick the primary dynamically; when the primary fails consecutively past a threshold, switch to the backup automatically.
    • Cross-checking: For the same instrument, compare price and quote time across sources. When the deviation exceeds a threshold, prefer the data with the newer quote time and trigger an alert.
    • Baseline alignment: Never mix data timestamped before the regular session with intraday data. The previous close must be based on exchange-published data, aligned periodically with batch snapshots.

    The illustrative code below shows primary/backup selection based on health score and quote time:

    1. def choose_best_feed(candidates: dict[str, Quote]) -> tuple[str, Quote] | None:
    2. """Pick the highest-quality quote from multiple sources; keys of candidates are source identifiers"""
    3. valid = []
    4. for src, q in candidates.items():
    5. if not validate_quote(q, int(time.time() * 1000)):
    6. valid.append((src, q))
    7. if not valid:
    8. return None
    9. # Prefer the healthier source first, then the one with the newer quote time
    10. return max(valid, key=lambda item: (health_score[item[0]], item[1].timestamp))

    8. Observability and Alerting

    Problems in quote systems tend to occur at the quietest moments — for example, pre-market data stopping in the early morning hours. The monitoring system should cover at least these metrics:

    • Ingestion side: response latency, success rate, rate-limit count, and validation failure rate of each source;
    • Data side: number of instruments covered per market, distribution of quote-time lag, and count of anomalous percent-change records;
    • Distribution side: push latency (P50, P95, P99), active connections, cache hit rate, and rate-limit/circuit-breaker trigger counts.

    Alert rules should be designed around business impact, not just technical metrics. For example:

    • If the same instrument’s price stays unchanged for N consecutive ingestion cycles and its quote time does not advance, flag a suspected feed outage;
    • If multiple sources deviate beyond the threshold at the same time, flag an upstream anomaly;
    • If P99 push latency stays above a set threshold, flag distribution-layer performance degradation.

    Alert messages should include the instrument, market, source, quote time, and anomaly type so on-call staff can locate the problem immediately.

    9. Security and Compliance

    Quote data also carries clear compliance requirements:

    • Display disclaimer: Quotes are for reference only and do not constitute investment advice; the UI should clearly label the data time and source.
    • Least privilege: Manage auth credentials through a key management service with regular rotation; never hard-code them in service code or frontend pages.
    • Access control: Default interfaces to least privilege, assigning each caller a visible set of instruments and fields; interfaces involving trading or accounts require strong authentication.
    • Cache-poisoning protection: Cache keys must include the caller’s visibility scope to prevent data of different privilege levels from being shared incorrectly.
    • Usage licensing: Before public display or reuse, confirm you have the appropriate authorization and follow the provider’s agreed scope of use and display requirements.

    10. Cloud Deployment: A Layered Implementation on Baidu AI Cloud

    The design above can be mapped onto cloud services in layers. Using Baidu AI Cloud as an example, one reference approach looks like this:

    • Container platform: Deploy the ingestion service, normalization service, and push gateway. With elastic scaling, add capacity automatically during peaks such as the open and the close, and scale down in quiet periods to control cost.
    • Cloud cache and middleware: A centralized cache holds the full quote set and hot data, while a message queue smooths bursts between ingestion and distribution and gives consumers a replayable data stream.
    • Object storage: Archive quote snapshots partitioned by date, market, and instrument for reconciliation, replay, and offline analysis, using lifecycle policies to clean up cold data automatically.
    • Logging and monitoring/alerting: Collect service logs centrally, configure alert policies around latency, success rate, and validation failure rate, and close the loop from detection to diagnosis.
    • Network access and security: A load balancer spreads connection load across push gateways, a web application firewall guards against abnormal requests, and a key management service centrally manages credentials.

    Three things matter at deployment time:

    1. The push gateway’s connection count is often the main scaling bottleneck, so capacity planning should center on peak concurrent connections.
    2. Ingestion nodes and cache nodes are best deployed in the same region to reduce round-trip latency.
    3. Critical paths should be deployed across multiple availability zones to avoid a single point of failure affecting overall availability.

    11. Troubleshooting

    Symptom Common cause Where to look
    Change does not “match” the price Live price and previous close come from different sources Check whether the primary/backup switched simultaneously and whether the previous-close basis is consistent
    Change is off by 0.01 without a clear pattern Binary floating-point arithmetic or inconsistent rounding Check for fixed-point usage and a unified round-half-up rule across services
    Quote time is off by hours Missing time-zone marker or a second conversion Audit UTC storage and display-layer conversion across the whole chain
    A quote is “stuck” for a long time The source stopped pushing but the connection is still open Check heartbeat and timeout detection; enable fallback pulls based on quote time
    Latency spikes at peak Push not throttled, connections maxed out Check latest-value coalescing, connection counts, and scaling policy
    An individual instrument is missing That market is outside trading hours, or source coverage is thin Check the market trading calendar and the source’s instrument coverage

    12. Summary

    A quote record that looks simple needs a complete engineering chain to reach every user’s screen reliably and accurately. The core points reduce to six:

    1. Model first: Separate raw data from display data, and store numbers as integers in the smallest currency unit.
    2. Unify time: Use UTC across the whole chain, and model time zone and market state explicitly.
    3. Centralize computation: Derive price change and percent change through a single entry point to avoid basis divergence.
    4. Validate early: Intercept dirty data with error-analysis-based quality rules rather than waiting for downstream to catch it.
    5. Distribute with restraint: Lead with streaming push and fall back to polling, and use throttling and coalescing to cut redundant transmission.
    6. Degrade in order: On source failure, degrade step by step — “backup source → last snapshot → explicit error” — backed by solid observability.

    The essence of quote data engineering is finding a sustainable balance among timeliness, accuracy, and cost. When each layer’s responsibility is defined clearly and every number’s basis is fixed, the system stays stable through market-open peaks and sudden swings. The same technical approach applies to any scenario that needs real-time, precise, and traceable time-series data.