KODVEXATECHNOLOGIES

SQL & Databases

Data models and queries that hold up under real load

We design schemas, tune queries and plan database changes so your data stays correct, fast and recoverable as volumes and features grow.

Executive InsightsRefreshed 6 minutes ago · Lakehouse model v12Revenue (QTD)₹ 12.4 Cr+8.2% vs planGross margin38.6%+1.4 ptsActive customers9,214Churn 1.9%Forecast accuracy93%Rolling 12 weeksRevenue vs targetJFMAMJJASONDBy regionSouth₹ 8.6 CrWest₹ 7.4 CrNorth₹ 6.1 CrEast₹ 4.2 CrInternational₹ 3.3 CrTop productsPRODUCT LINEUNITSREVENUETRENDIndustrial sensors4,820₹ 3.1 CrGateway hardware2,140₹ 2.4 CrAnalytics licences960₹ 1.9 CrData quality96%FreshnessOKCompleteness98.4%Schema drift1 warning
9:41Tuesday, 18 NovemberWorkspaceApprovals waiting72 due todayTasksApprove expense #4471Finance · ₹ 12,400Review vendor contractLegal · due FridaySign off release notesProduct · v2.8Update onboarding flowDesign · in progress

Overview

The database usually outlives the application

Frameworks get rewritten and frontends get replaced, but the data model tends to persist for years. Decisions about keys, relationships, constraints and normalisation shape what every future feature costs, so they deserve careful thought early.

Most application performance problems we investigate trace back to the database: missing or redundant indexes, queries that fetch far more than they need, ORM-generated N+1 patterns, lock contention or a schema that fights the access patterns. These are fixable, and the fixes are often small once the real cause is measured.

We work across SQL Server, PostgreSQL and MySQL for relational workloads and MongoDB for document-oriented ones. Our default for new transactional systems is a relational database, and we recommend a document store when the shape of the data and its access patterns genuinely favour it.

The challenge

Database problems teams commonly face

These issues usually appear gradually, then all at once when data or traffic crosses a threshold.

  • Queries that slow down as data grows

    Queries that were instant in development degrade with production volumes because of table scans, poor estimates or parameter sensitivity.

  • Schemas that resist change

    Missing constraints, overloaded columns and unclear ownership make every new feature risky and data quality unreliable.

  • Risky migrations

    Schema changes that lock large tables or require downtime cause outages when applied to busy production systems.

  • Contention and deadlocks

    Long transactions, hot rows and inconsistent access order lead to blocking and deadlocks under concurrent load.

  • Untested backups

    Backups exist but restore times, point-in-time recovery and procedures have never been verified.

  • The wrong database for the job

    Relational data forced into a document store, or highly variable documents squeezed into rigid tables.

How Kodvexa helps

How we work with databases

We measure before changing, and we design for the queries the application actually runs.

  • Model from access patterns

    Start from the domain and the most important read and write paths, then design keys, relationships and indexes to serve them.

  • Evidence-based tuning

    Use execution plans, Query Store, pg_stat_statements or the slow query log to find the queries that cost the most in total, not just the slowest single query.

  • Constraints as protection

    Foreign keys, unique constraints, check constraints and correct data types keep bad data out regardless of application bugs.

  • Zero-downtime change

    Migrations follow expand-and-contract patterns so application and schema can be deployed independently and safely.

Capabilities

What we deliver with SQL and databases

From initial design through to performance rescue and scaling.

  • 01

    Data modelling

    Normalised transactional schemas, deliberate denormalisation where reads demand it and clear naming and ownership.

  • 02

    Query and index optimisation

    Execution plan analysis, covering and filtered indexes, query rewrites and removal of unused or duplicate indexes.

    • Execution plan review
    • Index design
    • Parameter sniffing fixes
    • ORM query tuning
  • 03

    Migration engineering

    Version-controlled migrations with Flyway, Liquibase, EF Core or framework tools, designed for online application.

  • 04

    Partitioning and archiving

    Table partitioning for large time-series or tenant data, plus archive strategies that keep hot tables small.

  • 05

    Read scaling

    Read replicas, connection pooling and caching for read-heavy workloads, with care around replication lag.

  • 06

    Multi-tenant data design

    Shared-schema with tenant keys and row-level security, schema-per-tenant or database-per-tenant, chosen by isolation and scale needs.

  • 07

    MongoDB schema design

    Document models built around access patterns, with embedding versus referencing decisions and appropriate indexes.

  • 08

    Platform migrations

    Moving between engines or to managed cloud databases, with data validation and cut-over planning.

  • 09

    Backup and recovery

    Point-in-time recovery configuration, restore drills and documented recovery time and recovery point objectives.

Technical approach

Engineering practices we apply

Indexes are designed for specific queries, with column order chosen by equality and range predicates and included columns used to avoid lookups. Every index has a write cost, so we remove those that do not earn their keep.

Schema changes are split into backward-compatible steps: add the new structure, backfill in batches, switch reads and writes, then remove the old structure in a later release. Large backfills run in throttled batches to avoid long locks and replication lag.

  • Keep transactions short

    Transactions do the minimum work necessary, never wait on network calls and access tables in a consistent order.

  • Measure with production-like data

    Query plans depend on data distribution, so tuning uses realistic volumes and statistics rather than tiny test sets.

  • Use the database's strengths

    Window functions, JSON support, generated columns and row-level security often replace complex application code.

  • Least privilege access

    Applications connect with roles limited to what they need, and schema changes run under separate credentials.

  • Recovery is tested, not assumed

    Restore drills confirm that backups work and that recovery fits within the agreed time objectives.

Architecture & stack

A typical data tier reference architecture

A primary transactional database supported by replicas, caching and an analytics path.

  1. L1

    Application access

    Services reach the database through pooled connections, using an ORM for most work and hand-written SQL for critical queries.

    • Connection pooling
    • EF Core
    • Prisma
    • SQLAlchemy
  2. L2

    Primary database

    The system of record, with enforced constraints, tuned indexes and partitioning for the largest tables.

    • PostgreSQL
    • SQL Server
    • MySQL
  3. L3

    Read scaling and cache

    Read replicas serve reporting and read-heavy endpoints, while a cache absorbs repetitive lookups.

    • Read replicas
    • Redis
    • PgBouncer
  4. L4

    Document and specialised stores

    Document or search stores hold data whose shape or query needs do not fit the relational model.

    • MongoDB
    • OpenSearch
    • pgvector
  5. L5

    Analytics and recovery

    Change data capture or ETL feeds a warehouse, while backups and point-in-time recovery protect the primary.

    • Change data capture
    • Data warehouse
    • Automated backups

Trade-offs

Relational and document databases, honestly

Strengths

  • Relational integrity

    Transactions, constraints and joins keep related data consistent with guarantees applications cannot easily replicate.

  • Flexible querying with SQL

    SQL handles new and unanticipated questions about the data without redesigning storage.

  • PostgreSQL's versatility

    JSONB, full-text search, extensions and vector search let one engine cover many needs well.

  • Document model flexibility

    MongoDB suits variable, nested data read as a whole, and scales horizontally with sharding.

Limitations to plan for

  • Horizontal write scaling is hard

    Relational databases scale reads easily with replicas, but scaling writes beyond one primary needs sharding or distributed SQL.

  • Licensing costs

    SQL Server Enterprise features and per-core licensing can be expensive, which is a frequent reason for considering PostgreSQL.

  • Document stores push integrity to the application

    Without joins and foreign keys, consistency across documents depends on careful application logic and modelling.

  • Replica lag

    Read replicas are eventually consistent, so features that read immediately after writing must route to the primary.

Integration options

  • PostgreSQL
  • SQL Server
  • MySQL
  • MongoDB
  • Redis
  • Flyway
  • Liquibase
  • EF Core migrations
  • PgBouncer
  • pgvector
  • Azure SQL
  • Amazon Aurora

Delivery

How a database engagement runs

Whether designing or rescuing, we start with evidence.

  1. 01

    Gather evidence

    Collect workload statistics, slow queries, wait types, schema details and growth trends from the live system.

  2. 02

    Identify the highest-impact issues

    Rank problems by total cost to users and infrastructure, separating quick fixes from structural changes.

  3. 03

    Apply and verify changes

    Make changes incrementally, comparing plans and metrics before and after to confirm improvement.

  4. 04

    Address structural issues

    Plan schema refactoring, partitioning or replica strategies using safe, staged migrations.

  5. 05

    Monitor and document

    Set up ongoing query monitoring and alerting, and document decisions so the team can keep the database healthy.

Business value

What you gain

  • Faster applications

    Targeted query and index fixes often improve user-facing response times more than application changes.

  • Lower infrastructure cost

    Efficient queries reduce the need to buy larger database instances to cover inefficiency.

  • Trustworthy data

    Constraints and sound modelling prevent the inconsistencies that undermine reports and decisions.

  • Safer releases

    Online migration patterns remove the need for maintenance windows for most schema changes.

Use cases

Where this work matters most

Database engineering pays off in any data-heavy system, especially these.

  • SaaS

    Growing SaaS platforms

    Multi-tenant systems whose largest tenants are starting to strain shared tables and indexes.

  • Fintech

    Transactional finance systems

    Ledgers and payment records that demand strict consistency, auditability and correct concurrency handling.

  • Analytics

    Reporting-heavy operations

    Systems where operational reporting competes with transactions and needs replicas or a separate analytics path.

  • Modernisation

    Legacy database modernisation

    Ageing SQL Server or MySQL estates with stored-procedure-heavy logic moving to supported versions or managed services.

See it in practice

Related concept projects

Product demonstrations that show how these capabilities come together. They are concepts, not client engagements.

Treasury & PaymentsConsolidated view · INR and USD accountsAvailable balance₹ 3.84 Cr+₹ 41.2L settled todayTransferTransactions today12,48098.6% success ratePending settlement₹ 62.8LNext cycle 18:00Reconciliation97%Payment volumeWeeklyPayment methodsUPI46%Cards28%Net banking16%Wallets10%TransactionsREFERENCECOUNTERPARTYMETHODAMOUNTSTATUSTXN-90281Acme Supplies Pvt LtdNEFT₹ 4,82,000SettledTXN-90277Orbit LogisticsUPI₹ 18,450SettledTXN-90270Northstar RetailCard₹ 72,900PendingTXN-90266Helio EnergyIMPS₹ 1,20,000Mismatch
Concept Project

FinTech

FinTech Dashboard

A concept finance dashboard unifying transactions, payment providers, reconciliation and business reporting in one audited view.

  • React
  • TypeScript
  • .NET
  • PostgreSQL
Storefront ConsoleCatalogue · 2,418 active SKUsOrders today1,362+9% vs yesterdayGross sales₹ 18.6LAvg. order ₹ 1,366Cart conversion3.4%Checkout drop-off 41%Returns pending5712 awaiting QCProduct catalogueNew arrivalsAero Running Shoe₹ 6,499142 in stockTrail Backpack 28L₹ 4,25064 in stockStudio Headphones₹ 11,99028 in stockSmart Watch S2₹ 15,4009 in stockCart · Session 7F2AAero Running ShoeSize 9 · ×1₹ 6,499Trail Backpack 28LOlive · ×1₹ 4,250Subtotal₹ 10,749Coupon WINTER10− ₹ 1,075ShippingFreeCheckout · ₹ 9,674Orders this weekMonTueWedThuFriSatSunInventory alertsSmart Watch S2Warehouse Pune9 leftStudio HeadphonesWarehouse Chennai28 leftTrail Backpack 28LReorder placedPO-2281
Concept Project

Commerce

E-commerce Platform

A concept commerce platform with product catalogue, cart, order and inventory management, and a self-service customer portal.

  • Next.js
  • React
  • Node.js
  • PostgreSQL

FAQs

Frequently asked questions

Should we choose a relational or document database?

Choose relational when data is interconnected, consistency matters and query needs will evolve, which covers most business systems. A document store fits when records are self-contained, vary in shape and are mostly read and written as a whole.

PostgreSQL or SQL Server?

SQL Server integrates closely with the Microsoft ecosystem and has excellent tooling, but licensing can be costly at scale. PostgreSQL is open source, highly capable and widely available as a managed service. Existing skills and licensing usually decide it.

Can you fix our slow database without a rewrite?

Usually yes. Most slowdowns come from a small number of expensive queries, missing indexes or poor transaction patterns. We measure first and fix those before recommending any structural change.

When should we partition tables or add read replicas?

Partitioning helps when very large tables are queried mainly by a key like date or tenant, and when old data needs efficient archiving. Read replicas help when reads dominate and can tolerate slight lag. Neither should replace fixing inefficient queries first.

How do you run migrations without downtime?

We use expand-and-contract migrations, add columns and indexes online where the engine supports it, and backfill data in small batches. The application is made compatible with both old and new schemas during the transition.

Is your database slowing the product down?

Share your engine, workload and symptoms, and we will help you find the causes and a safe plan to fix them.