Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Data Quality and Observability

By Kokil Thapa | Last reviewed: September 2026

Bad data does not announce itself. A booking portal accepts a payment while the order row never lands. A legal intake form stores a mistyped phone number that breaks SMS reminders for weeks. Data Quality and Observability is how you catch those failures before customers do. It pairs validation rules with runtime signals—metrics, logs, and traces—so you know whether records are correct, complete, timely, and consistent across systems. On production enterprise applications I maintain, this discipline sits beside application monitoring, not instead of it.

What is Data Quality and Observability in production systems?

Data quality asks whether information is fit for use. Observability asks why a system behaved a certain way under real load. Together they answer two questions every engineering team faces: Is the data wrong? and Where did it go wrong?

In practice, data quality covers dimensions you can test:

  • Accuracy — values match source truth (correct totals, valid enums).
  • Completeness — required fields are present (email on a lead form).
  • Consistency — the same entity agrees across tables or services.
  • Timeliness — records arrive within an SLA (hourly sync, nightly batch).
  • Uniqueness — no duplicate keys where the business forbids them.

Observability adds runtime context: latency spikes on an ETL job, a failed webhook retry, or a queue backlog that explains stale rows. The overlap is intentional. A freshness alert without a trace leaves you guessing. A trace without a row-count check confirms latency but not correctness.

Data Quality and Observability StackSourcesAPIs, DB, filesQuality LayerChecks + contractsWarehouseMySQL, lakeMetricsRow counts, lagLogsJob failuresTracesSpan lineageAlerting and dashboardsPager, Slack, incident runbooks
Data Quality and Observability stack: validation at ingest, storage downstream, and three signal types feeding alerts.

I treat this as part of system design, not a post-launch audit. On a legal-tech portal with document uploads and payment records, a missing foreign key is both a data defect and a support ticket waiting to happen. The same mindset applies to data engineering for DevOps teams that own pipelines and the apps that consume them.

How do you measure data quality at the pipeline level?

Start with checks you can automate on every run. Manual spot checks do not scale once nightly jobs feed dashboards used by finance or operations.

Define SLIs for data, not only for HTTP

Application teams track p95 latency and error rate. Data teams need parallel service level indicators:

  1. Freshness — max timestamp lag versus wall clock (e.g. under 15 minutes).
  2. Volume — row count within expected bounds (±20% versus seven-day median).
  3. Schema — columns, types, and nullability match a published contract.
  4. Distribution — key fields stay within statistical norms (no sudden null spike).
  5. Referential integrity — orphan rates for joins the product assumes are valid.

Express thresholds in code or YAML so they version with the pipeline. A pattern I use on Laravel exports mirrors what test data management for pipelines describes: seed realistic fixtures, then assert invariants after each transform step.

Example: freshness and volume gate in SQL

-- Run after daily sync; fail the job if thresholds breach
SELECT
  MAX(updated_at) AS latest_row,
  TIMESTAMPDIFF(MINUTE, MAX(updated_at), UTC_TIMESTAMP()) AS lag_minutes,
  COUNT(*) AS row_count
FROM orders_staging;

-- Expected: lag_minutes < 60 AND row_count BETWEEN 9000 AND 11000

Wire this into your orchestrator. Apache Airflow can mark the task failed; GitLab CI can block a deploy. The point is to stop propagation, not to email someone after the CFO opens a broken report.

Data contracts between producers and consumers

A data contract is a published schema plus allowed values and SLAs. The producer (an API team, a SaaS export, a mobile app event stream) commits to it. The consumer (warehouse model, BI dashboard, ML feature store) tests against it.

On a client project with booking and payment flows, we documented that bookings.status must be one of five enums and that paid_at is non-null when status is confirmed. Breaking changes require a version bump and a migration window. That is boring governance. It also prevents silent report drift.

Quality Gates in an ETL PipelineExtractGate: schemaTransformGate: rulesLoadGate: volumeServeGate: freshnessFailed gate stops downstream tasksAlert includes table, check name, observed valueRunbook link in notification payload
Quality gates at each pipeline stage prevent bad rows from reaching dashboards and APIs.

Tools like dbt tests, Great Expectations, or custom SQL assertions all implement the same idea. Pick one that fits your stack and keep checks close to the code that owns the data. See dbt transform patterns in the warehouse for a practical starting point.

How does observability differ from monitoring for data systems?

Monitoring tells you a threshold was crossed. Observability lets you ask new questions with the telemetry you already collect. For data pipelines, that difference matters when the job is green but the numbers are wrong.

A job can finish in six minutes with zero exceptions while dropping 30% of rows because of a silent filter. Row-count metrics catch that. Monitoring alone often does not.

SignalTypical monitoring useData quality + observability use
MetricsCPU, job duration, queue depthRows ingested, null rate, duplicate rate, freshness lag
LogsError stack tracesStructured events: source file, batch ID, rejected record sample
TracesAPI request pathEnd-to-end lineage: webhook → queue → worker → DB → materialized view

The three pillars still apply. What changes is the vocabulary. Instead of only HTTP 5xx, you track data incidents: schema drift, stale partitions, broken joins, and business-rule violations. I align this framing with observability versus monitoring for logs, metrics, and traces so app and data on-call rotations share one mental model.

OpenTelemetry signals give you a vendor-neutral way to emit those metrics and traces from custom workers, Laravel queue jobs, or Python ETL scripts. You do not need a full service mesh to benefit. A trace ID propagated from an API controller through a queued export job is often enough to debug a missing row.

What tools and patterns implement data quality checks in 2026?

Your stack depends on where data lives and who maintains it. A WooCommerce shop, a Laravel SaaS app, and a Snowflake warehouse do not share one tool—but they can share one pattern: test early, fail fast, alert with context.

Application-layer validation (Laravel and APIs)

Never trust the client. Form Requests, database constraints, and transactional writes are your first quality gate. I've used Laravel model factories for realistic test data to simulate edge cases—empty middle names, duplicate phone formats, timezone boundaries—before they hit production.

// app/Rules/NepalMobileNumber.php — server-side completeness
public function validate(string $attribute, mixed $value, Closure $fail): void
{
    if (! preg_match('/^(98|97)\d{8}$/', (string) $value)) {
        $fail('The :attribute must be a valid Nepal mobile number.');
    }
}

Pair validation with idempotent writes and unique indexes. Duplicate submissions are a data quality problem dressed as a UX bug.

Pipeline orchestration and CDC

For scheduled or event-driven pipelines, orchestrators like Airflow run checks as first-class tasks. Change Data Capture with Debezium keeps warehouse tables aligned with OLTP sources; quality checks then compare counts and checksums across both sides. Read Apache Airflow orchestration patterns and Change Data Capture with Debezium for wiring details.

Warehouse-native tests

In dbt, schema tests and custom singular tests run after models build. In SQL-only shops, scheduled assertion queries write to an audit.check_results table. Either way, failed checks should block downstream marts tagged critical.

CI quality gates

Shift left. Run lightweight checks on pull requests: JSON schema validation on fixture files, migration dry-runs against a scratch database, and snapshot diffs on exported CSV samples. This mirrors build verification and quality gates in CI and SonarQube-style quality gates for application code.

Monitoring Only vs Data Quality and ObservabilityMonitoring onlyJob success = healthyAlerts on crashesSilent data lossStale dashboardsHard to trace root causeQuality + observabilityChecks on every runMetrics on row healthTrace ID across jobsFail before serve layerRunbooks tied to alertsupgrade
Monitoring-only pipelines miss silent failures; Data Quality and Observability adds checks, health metrics, and traceable lineage.

For JSON payloads from third-party webhooks, a JSON formatter and validator helps during development. Production still needs automated schema tests—not manual paste checks.

How do you combine data quality with application observability?

Most business systems are hybrid. A Laravel app writes to MySQL 9.7 or PostgreSQL 18. Redis 8.10 caches hot reads. A nightly job pushes aggregates to a reporting database. Quality and observability must span that path.

Correlate trace IDs across boundaries

When a user submits a form, generate or accept a trace ID. Pass it to the queue job, the export command, and the log line written by the warehouse loader. When support asks why one record is missing, search by that ID instead of grepping three systems. OpenTelemetry as the observability standard documents how to propagate context without locking into one vendor backend.

Cache and database coherence

Stale cache is a data quality issue. After writes, invalidate the keys your read path depends on. Monitor cache hit ratio alongside row freshness. I've debugged production issues where Redis caching patterns served outdated legal document lists because invalidation missed a tag—users saw "upload complete" but the admin grid did not refresh for an hour.

Compliance and residency

For Nepal-based companies, personal data handling adds quality dimensions: consent flags present, retention windows enforced, cross-border copies documented. Technical controls belong in the same observability stack as uptime. See data residency and compliance for Nepali companies and data privacy law for web apps in Nepal for policy context that should become automated checks where possible.

Operational ownership

Assign an owner per dataset: who gets paged when orders_fact freshness slips. Document expected volume bands and upstream dependencies. On sister sites I deploy with GitLab CI and Deployer 7, the same pipeline that ships code can run post-deploy assertions—a row count smoke test against staging before promoting to production.

Trace Lineage Across App and Data LayersWeb formtrace_id setQueue jobsame trace_idMySQL writeconstraintsETL batchquality gateSingle trace spans HTTP, queue, DB, and batch loaderGotcha: async gapUser sees success before ETLFix: status fieldsynced_at + freshness SLI
Propagating trace IDs from web forms through queues and ETL closes the observability gap in hybrid app-and-data systems.

On a client portal with document sharing and payments, that end-to-end view is not optional. A missing payment row and a successful gateway callback are the same incident seen from two angles.

What are common data quality failures and how do you prevent them?

Patterns repeat across stacks. Naming them helps you build a checklist before the next launch.

  • Schema drift without versioning — an API adds a field; the warehouse model ignores it until a BI column goes blank. Fix with contracts and CI schema diff.
  • Timezone-normalisation bugs — Nepal business reports use Asia/Kathmandu; servers use UTC. Fix by storing UTC, converting at display, and testing boundary dates with a Nepali date converter during QA.
  • Silent deduplication — DISTINCT hides duplicate source events. Fix with explicit dedupe keys and duplicate-rate metrics.
  • Partial batch commits — half a CSV loads before a constraint error. Fix with staging tables and all-or-nothing transactions.
  • Environment parity gaps — staging lacks volume to expose slow joins. Fix with anonymised production samples and testing and optimization practices that include data volume tests.

External references help set expectations. The Great Expectations documentation shows how assertion libraries express checks as human-readable expectations. For warehouse modelling discipline, the dbt tests guide remains the clearest introduction to in-warehouse validation.

When incidents happen, run a short blameless review. Capture the missing check, add it to the pipeline, and link the alert to a runbook. That loop is how Data Quality and Observability matures from a spreadsheet of rules into an engineering habit.

Key Takeaways

  • Define SLIs for freshness, volume, schema, and business rules—not only job success flags.
  • Place quality gates at extract, transform, and load so bad rows never reach serve layers.
  • Propagate trace IDs from web requests through queues and batch jobs for cross-system debugging.
  • Publish data contracts between producers and consumers; version breaking schema changes.
  • Run assertion checks in CI on fixtures and migrations, not only in nightly production jobs.
  • Assign dataset owners and tie alerts to runbooks so on-call engineers act without guesswork.

People Also Ask

Is data observability the same as data quality?

No. Data quality measures whether values meet defined standards. Data observability uses metrics, logs, and traces to explain pipeline behavior and detect unknown unknowns like drift. You need both: quality rules catch known bad patterns; observability helps diagnose new failures quickly.

What metrics should I alert on first?

Start with freshness lag, row-count variance versus a rolling baseline, and null-rate spikes on critical columns. These three catch most silent pipeline failures before downstream users notice. Add schema violation counts once baseline alerts are stable.

Can small teams afford enterprise data observability tools?

Yes, by starting simple. SQL assertions in cron, structured logs with batch IDs, and OpenTelemetry in queue workers cover most Laravel or WordPress plus warehouse setups. Paid platforms help at scale; they are not prerequisites for useful checks.

How does data quality relate to GDPR and Nepal privacy rules?

Quality includes lawful processing flags, retention dates, and deletion completeness—not just accurate email addresses. Automated checks should verify consent fields and purge jobs completed, aligned with your privacy compliance model for web applications.

Build trustworthy data from day one

Data Quality and Observability is not a dashboard you add after launch. It is how you prove that bookings, payments, legal records, and analytics reflect reality. Start with contracts, automated gates, and trace propagation on your highest-risk datasets. Expand coverage as volume grows.

If you are planning a portal, API, or pipeline where bad data has real business cost, I can help design validation and observability into the architecture from the start. Review relevant work on the portfolio, explore API development services, or contact us to discuss your stack.

Frequently Asked Questions

It pairs automated validation on freshness, schema, volume, and business rules with pipeline metrics, structured logs, and distributed traces so teams detect bad or drifting data before it corrupts dashboards, APIs, or customer workflows.

No. Data quality measures whether values meet defined standards. Data observability uses metrics, logs, and traces to explain pipeline behavior and detect unknown unknowns like drift. You need both working together.

Start with freshness lag, row-count variance versus a rolling baseline, and null-rate spikes on critical columns. These three catch most silent pipeline failures before downstream users notice.

Monitoring tells you a threshold was crossed—job duration, queue depth, or an error stack trace. Observability lets you ask new questions with telemetry you already collect. A pipeline job can finish with zero exceptions while dropping thirty percent of rows because of a silent filter; row-count metrics catch that, monitoring alone often does not. For data systems, track incidents like schema drift, stale partitions, broken joins, and business-rule violations alongside CPU and job-success flags, using structured logs with batch IDs and end-to-end lineage traces from webhook through queue to warehouse.

Define service level indicators parallel to HTTP metrics: freshness as max timestamp lag versus wall clock, volume as row count within expected bounds against a seven-day median, schema matching a published contract, distribution staying within statistical norms, and referential integrity for joins the product assumes are valid. Express thresholds in code or YAML versioned with the pipeline. Wire SQL assertions into your orchestrator so Apache Airflow marks tasks failed or GitLab CI blocks a deploy. The point is stopping bad data from propagating, not emailing someone after finance opens a broken report.

A data contract is a published schema plus allowed values and SLAs. The producer—an API team, SaaS export, or mobile event stream—commits to it; the consumer—warehouse model, BI dashboard, or ML feature store—tests against it. On a booking project, document that status must be one of five enums and paid_at is non-null when status is confirmed. Breaking changes require a version bump and a migration window. That governance prevents silent report drift when upstream systems change fields without downstream models knowing. Contracts turn informal assumptions into testable rules both sides can enforce in CI and nightly jobs.

Stack depends on where data lives. Application teams use Laravel Form Requests, database constraints, and transactional writes as the first gate. Pipeline teams use Apache Airflow for orchestrated checks and Debezium for change-data capture aligned with warehouse counts. Warehouse validation runs through dbt schema tests, Great Expectations expectations, or scheduled SQL assertions writing to an audit table. OpenTelemetry propagates metrics and traces from Laravel queue jobs or Python ETL scripts without locking into one vendor. Shift-left CI gates on pull requests—JSON schema validation on fixtures, migration dry-runs, CSV snapshot diffs—mirror application quality gates. Pick one pattern that fits your stack and keep checks close to owning code.

Yes, by starting simple rather than buying platforms first. SQL assertions in cron, structured logs with batch IDs, and OpenTelemetry in queue workers cover most Laravel or WordPress plus warehouse setups I've seen on client projects. Paid enterprise tools help at scale with centralized lineage and incident views, but they are not prerequisites for useful checks. The same GitLab CI pipeline that ships code with Deployer 7 can run post-deploy row-count smoke tests against staging before promoting to production. Useful Data Quality and Observability is an engineering habit, not a license budget line item.

Schema drift without versioning breaks BI columns when APIs add fields—fix with contracts and CI schema diff. Timezone-normalisation bugs corrupt Nepal business reports when servers store UTC but reports assume Asia/Kathmandu—store UTC, convert at display, test boundary dates in QA. Silent deduplication with DISTINCT hides duplicate source events—use explicit dedupe keys and duplicate-rate metrics. Partial batch commits leave half a CSV loaded before a constraint error—use staging tables and all-or-nothing transactions. Environment parity gaps hide slow joins—load anonymised production samples into staging for volume tests. After incidents, run a blameless review, add the missing check, and link alerts to a runbook.

Most business systems span an application, cache, and reporting path—a Laravel app writing to MySQL or PostgreSQL, Redis caching hot reads, and nightly jobs pushing aggregates downstream. Quality and observability must cover that entire route. Generate or accept a trace ID on form submission and pass it through the queue job, export command, and warehouse loader log line. Treat stale cache as a data quality issue: invalidate keys after writes and monitor cache hit ratio alongside row freshness. Assign an owner per dataset who gets paged when freshness slips, with documented volume bands and upstream dependencies tied to actionable runbooks.

Test five dimensions on every run: accuracy so values match source truth like correct totals and valid enums; completeness so required fields such as email on a lead form are present; consistency so the same entity agrees across tables or services; timeliness so records arrive within an SLA like an hourly sync or nightly batch; and uniqueness so forbidden duplicate keys do not slip through. Express each as code assertions at ingest and after transforms. A freshness alert without a trace leaves you guessing why data is stale; a trace without a row-count check confirms latency but not whether the numbers themselves are correct.

Place gates at each stage so bad rows never reach serve layers. At extract, validate webhook JSON schema and log rejected record samples with source file and batch ID. At transform, assert invariants after each step—seed realistic fixtures, then verify counts and business rules mirror test data management patterns. At load, run freshness and volume SQL checks before downstream marts tagged critical build. Failed dbt tests or custom assertions should block promotion the same way a failing unit test blocks merge. Monitoring-only pipelines miss silent failures; adding checks, health metrics, and traceable lineage closes that gap without waiting for users to report broken dashboards.

Quality includes lawful processing dimensions, not only accurate email addresses. Automated checks should verify consent flags are present, retention windows are enforced, and deletion or purge jobs completed fully. For Nepal-based companies handling personal data, cross-border copies and residency requirements become additional quality dimensions that belong in the same observability stack as uptime monitoring. Technical controls should align with your privacy compliance model for web applications rather than living only in policy documents. Consent completeness and deletion verification are data defects waiting to become compliance incidents if left untested.

When a booking portal accepts a payment but the order row never lands, debugging without lineage means grepping API logs, queue workers, and warehouse loaders separately. Propagating a trace ID from an API controller through a queued export job to the database loader closes that gap. OpenTelemetry provides a vendor-neutral way to emit metrics and traces from custom workers without requiring a full service mesh. A missing payment row and a successful gateway callback are the same incident seen from two angles—correlation turns hours of cross-system guessing into one searchable identifier across logs, metrics, and traces.

Never trust the client. Laravel Form Requests, custom server-side rules such as Nepal mobile number validation, database constraints, unique indexes, and idempotent writes form your first quality gate before data enters pipelines. Duplicate form submissions are a data quality problem dressed as a UX bug. Pair validation with realistic model factories simulating empty middle names, duplicate phone formats, and timezone boundaries before production. Application checks catch bad input at the source; pipeline checks catch drift, silent filters, and sync failures downstream. On portals with document uploads and payment records, a missing foreign key is both a data defect and a support ticket waiting to happen.

Share this article

0 Comments

Leave a comment

Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

Quick Contact Options
Choose how you want to connect me: