DRYCODEWORKS
← Case studies

From 12 Seconds to 150 ms on Lambda and SQL Server

Daniel Young
Daniel YoungFounder, DRYCodeWorks

How I led a three-person team to improve an IoT platform’s performance and reliability without leaving SQL Server.

A small dial gauge beside a large blue-filled tank with a level scale.

Industry: IoT technology
Client: Confidential
Project Duration: Six months
Team Size: Three engineers

The Bottom Line

Over six months, I led a three-person team that rebuilt the client’s IoT platform. The results:

  • Response time improved from 12 seconds to 150ms (80x faster)
  • Uptime increased to near 100% during peak demand
  • Customer retention reached 98% following ownership change
  • User engagement increased by 150%
  • Device fleet doubled
  • Customer portfolio doubled

The Client

The client operates an IoT platform that combines device data and external data services. Customers use its dashboards to make time-sensitive operational decisions.

The Challenge: Performance Under Load

As the client's business grew, their technical infrastructure couldn't keep pace. What began as occasional slowdowns evolved into systemic problems that threatened the entire business model.

The company faced multiple critical challenges:

Slow Responses

API response times averaged 12 seconds during peak demand, delaying access to current data.

Data Integrity Issues That Eroded Trust

Reliable processing of incoming device data was another priority. We addressed that alongside API performance.

Repeatable Infrastructure Changes

Infrastructure automation and tested deployment paths were part of the reliability work.

Variable Demand

The architecture needed to absorb bursts of incoming data without passing the entire surge to the database.

Swipe sideways to see the whole diagram.

IoTDevicesExternalData servicesincoming datasynchronousMonolithicAPI / Lambdasynchronous pathconcurrent requestsquery blockingSQL Serversystem of record~12s response times

Our Approach: Building on Solid Ground

We planned the work around a window before the next period of peak demand.

Rather than rushing to quick fixes, I started with discovery:

  1. Establish reliable baselines — We implemented comprehensive logging and monitoring to accurately measure current performance.
  2. Stress test the existing system — We simulated peak demand to establish where the architecture needed more headroom.
  3. Educate stakeholders — We developed detailed design documents to ensure the client understood both the problems and our proposed solutions.
  4. Build proper foundations — We established testing and non-production environments before changing the production architecture.

Project Timeline

Swipe sideways to see the whole diagram.

DiscoverDiscovery &baselinesPrepareTerraform import,test environmentsTuneConnection pooling& DB tuningDecoupleEvent-drivenprocessingObserveEvent routing,diagnostic loggingValidateLoad testing& docsReleaseStaged rollout& handoffpreparationvalidation and release

Discovery and baselines came first, followed by infrastructure import and test environments. Database tuning and asynchronous processing preceded load testing, documentation and rollout.

The Solution: Architecting for Reliability

Eliminating Downtime with Infrastructure-as-Code

I chose Terraform to manage AWS infrastructure in a repeatable, version-controlled way. Rather than building from scratch, we carefully imported all existing production infrastructure into reusable Terraform modules for each application stack. This approach allowed us to:

  • Create consistent development and staging environments for testing
  • Add monitoring, logging permissions, and CloudWatch alarms to runtime assets
  • Enable zero-downtime infrastructure updates
  • Establish a foundation for automated scaling

Solving Database Bottlenecks

Our analysis revealed that excessive database connections from monolithic Lambda functions were creating query blocking and performance degradation. We implemented RDS Proxy to pool connections and manage concurrency, while also adjusting transaction handling to prevent unnecessary locks.

We kept SQL Server as the system of record and moved suitable workloads to specialized stores. Connection pooling and transaction handling needed to be considered together.

  • ElastiCache for transient processing
  • MemoryDB for low-latency retrieval
  • ClickHouse Cloud for time-series analysis

Reimagining Data Flow with Event-Driven Architecture

The biggest change was replacing the client's synchronous processing model with an event-driven architecture:

  • Queues with dead-letter handling and monitoring
  • Object-storage events and device webhooks feeding asynchronous processing
  • EventBridge routing and Lambda consumers
  • Centralized diagnostic logging

This new architecture allowed the platform to handle traffic spikes gracefully, processing data asynchronously without overwhelming the database or customer-facing APIs.

Swipe sideways to see the whole diagram.

S3 CreateEventsDeviceWebhooksEventBridgeS3 integrationSQSQueueDLQ + CloudWatch alarmEventBridgePipesfanoutLambdaConsumersSQL Serversystem of recordElastiCachetransient processingMemoryDBlow-latency retrievalClickHousetime-seriesasync, decoupled, retryable

The Results: From Liability to Competitive Advantage

Response Times

API response times dropped from an average of 12 seconds to 150ms—an 80x improvement. Dashboards that used to stall now update in real time.

Reliability

The platform now maintains near 100% uptime during peak demand, with 99.9% of incoming device and external data successfully processed and stored.

Headroom

Load testing established capacity headroom, and the client subsequently doubled its device fleet.

Business Impact

  • 98% customer retention following a change in company ownership—a critical vote of confidence from their user base
  • 150% increase in user engagement
  • Customer portfolio doubled with the improved system supporting twice as many users
  • Engineering team refocused on product innovation rather than emergency maintenance
  • Sales team able to offer reliability guarantees to prospects

Implementation Considerations

Minimizing Disruption During Migration

We shipped every change with zero downtime, using:

  • Feature flagging to control the rollout of new functionality
  • Application artifact tagging to associate specific code versions with database schema versions
  • Comprehensive testing of both deployments and rollbacks in non-production environments
  • Staged rollouts with careful monitoring at each step

Ensuring Long-Term Maintainability

So the client's own team could run the system after we left, we:

  • Created comprehensive technical documentation for all systems
  • Recorded walkthrough videos demonstrating key operations and troubleshooting procedures
  • Conducted hands-on training sessions with the internal engineering team
  • Established monitoring dashboards with clear alert thresholds and runbooks

Key Takeaways: Lessons for Growth-Stage Companies

The client's experience highlights common challenges that many B2B software companies face as they scale:

  • Manual infrastructure management inevitably leads to downtime and deployment risks
  • Database performance degradation occurs gradually until it reaches critical failure points
  • Synchronous processing models break under unpredictable traffic patterns
  • Lack of proper connection pooling can overwhelm database resources

None of these problems arrived overnight, and none of the fixes required replacing the database of record. They were foundations: environments to test in, infrastructure in code, pooled database connections, and a data flow that absorbs traffic spikes instead of passing them straight to the database. If your platform is showing the same symptoms, I'm happy to compare notes.

I do this kind of work for clients.

No technical lead, a team that has stopped shipping, a system your product has outgrown: as your fractional CTO, I make the technical calls and write code.

Fractional CTO & product →Book a call