All work

Production API Platform

Production · Tata Consultancy Services, production work · Engineer, backend

Business-critical services need APIs that stay correct and fast under real traffic, integrate with legacy systems, and make failures obvious instead of silent.

My contribution
Owned the backend redesign of a Spring Boot service: REST API contracts, request validation, error handling and downstream integrations while keeping existing consumers working. Reviewed pull requests and documented API contracts and integration guides. Details generalised for confidentiality.
Key challenge
Changing live systems safely. Consumers depended on existing behaviour. Changes were backward compatible by default and rolled out with monitoring in place to catch regressions quickly.
Outcome
Critical endpoints tuned at the query level, one error contract for every consumer, and recurring incidents fixed at their root cause.
On this page

Overview

A representative view of my professional backend work, generalised to protect employer confidentiality. The systems are REST APIs in Java and Spring Boot, backed by Oracle, serving web applications and other internal systems, deployed to production and supported on call.

Problem

Mature enterprise APIs accumulate friction: inconsistent validation, errors that surface as generic 500s, queries that were fine at launch but slow at current data volumes, and downstream dependencies that occasionally hang.

Each of those becomes an incident eventually. The goal was to make the services predictable: correct inputs in, clear errors out, and performance that holds as data grows.

Requirements

  • Reject invalid input early with actionable messages
  • Return a consistent error contract across endpoints
  • Keep critical endpoints fast at production data volumes
  • Isolate the service from slow or failing downstream systems
  • Ship safely, with the ability to diagnose issues quickly in production

Architecture

A layered Spring Boot service: controllers own HTTP concerns and validation, services own business rules and transaction boundaries, and repositories own data access through JPA with hand-tuned SQL where it matters. Downstream integrations sit behind clients with explicit timeouts and error mapping. A global exception handler converts every failure into one well-defined response shape.

Production API Platform architectureClient requests cross the highlighted validation boundary, then the controller and service layers in Spring Boot. Oracle access uses tuned SQL. Conditional calls to downstream APIs have timeouts and error mapping. A global exception handler produces a shared error envelope.Spring BootClientGlobal exception handlerShared error envelopeValidationControllerServiceOracleTuned SQLDownstreamAPIsWhen needed:timeout + error mapping
Architecture sketch. Solid arrows are the main path, dashed arrows run only when needed, and the outlined box marks the key engineering decision.
  1. RequestWeb app or partner system
  2. ValidateSchema + business rules at the edge
  3. ServiceDomain logic, transactions
  4. DataJPA + tuned Oracle SQL
  5. IntegrateDownstream calls with timeoutsWhen the request needs another system
  6. RespondConsistent success and error contract
  7. ObserveLogs, metrics, alerts
HTTP/1.1 422 Unprocessable Entity

{
  "code": "VALIDATION_FAILED",
  "message": "2 fields need attention.",
  "errors": [
    { "field": "accountId", "message": "must not be blank" },
    { "field": "amount", "message": "must be greater than 0" }
  ],
  "traceId": "c1f4…9a2e"
}
Illustrative validation error in the shared error contract. Field names are examples.

Engineering decisions

Explicit transaction boundaries in the service layer
Keeps units of work obvious and prevents lazy-loading surprises leaking into controllers.
Projections over full entities for read-heavy endpoints
Fetching only needed columns cut database and serialisation work without changing API contracts.
Fix root causes, then add guards
Recurring incidents were traced to their source first; alerts and validation were added so the same class of bug surfaces early next time.

Challenges

Changing live systems safely

Consumers depended on existing behaviour. Changes were backward compatible by default and rolled out with monitoring in place to catch regressions quickly.

Performance that only shows up in production

Some slow paths only appear at real data volumes. Execution plans and production-like data were the tools, not guesses.

Coordinating across teams

Contract changes touched frontend, QA and partner teams. Clear API documentation and early agreement on error shapes avoided late surprises.

Results

Qualitative outcomes; benchmark measurements are not published.

  • Reduced database round trips and optimised Oracle SQL queries in the Spring Boot services.
  • Recurring incidents traced to their root cause, with validation and alerts so the same failure shows up early next time.
  • A consistent error contract that simplified frontend and partner error handling.
  • Safer deployments: backward-compatible by default, with monitoring in place before each release.

Lessons learned

  • Most performance problems are data access problems. Read the query plan first.
  • Good error messages are an API feature; they save hours for every consumer.
  • Tracing recurring failures led back to explicit validation, downstream timeouts and request-context logging.
Technical approach and performance notes

Technical approach

Validate at the boundary

Bean Validation on request models plus explicit business-rule checks in the service layer. Bad requests fail fast with field-level messages instead of travelling deep into the system.

One error contract

A central exception handler maps domain, validation, data and integration exceptions to stable status codes and a consistent body, so consumers can handle errors programmatically.

Query-level performance work

Slow endpoints were traced to specific queries: N+1 fetches, missing indexes, over-fetching entities. Fixes ranged from fetch strategy changes to projections and targeted native SQL.

Defensive integrations

Every downstream call has a timeout and a defined failure path, so one slow dependency degrades a feature instead of exhausting the thread pool.

Performance and scalability

  • Indexes and query shapes reviewed against execution plans for high-traffic endpoints.
  • Pagination and projections for large result sets.
  • Bounded connection and thread pools, with timeouts on every external call.
  • Logging with request context so a failing call can be traced end to end.

Technologies used

  • Java
  • Spring Boot
  • JPA / Hibernate
  • Oracle
  • REST APIs