techswamy
    Menu
    Pine trees in front of a forested ridge in warm, hazy light
    Case study

    How we helped an enterprise climate-tech platform turn a slowing product into a more observable, efficient system

    From multi-minute recalculations and rising infrastructure costs to faster experimentation, better visibility, and analytics delivery measured in days rather than weeks.

    Industry
    Climate tech
    Company
    Enterprise (confidential)
    Engagement
    Platform performance, observability and architecture

    Key results at a glance

    5–7 minutes

    of unnecessary processing removed for applicable activity changes

    Up to 50%

    improvement in recalculation and API response time after data cleanup

    2 days → 14 minutes

    for a severe recalculation regression after fixing MongoDB indexes

    Weeks → days

    to deliver new analytics dashboards

    The challenge

    A critical product was becoming too slow

    The platform helps large organizations measure and reduce their carbon footprint. Customers upload and maintain operational datasets, change parameters, recalculate emissions, analyze results, and use them for reporting and decision-making.

    Over time, even relatively small changes to customer data could take several minutes before updated results appeared. For a product built around exploring data, changing assumptions, and rerunning calculations, that delay directly affected how customers used the platform.

    At the same time, the company was facing competitive pressure from products that could return results faster, while the cost of operating the platform was increasing.

    We were initially brought in to fix MongoDB performance problems. What we found was broader: database design and query efficiency were part of the problem, but so were the recalculation flow, unnecessary processing, data access patterns, and the lack of visibility into where time was actually being spent.

    The core user workflow
    1. 1. Upload or change data

      Customers update activity data and parameters.

    2. 2. Recalculate emissions

      The platform matches data, runs calculations and produces updated results.

    3. 3. Analyze and explore

      Users compare outcomes, explore scenarios and generate reports.

    The solution

    A systematic approach to performance, observability and architecture

    We led a five-person core team and coordinated with engineers from adjacent teams, working closely with the Director of Engineering, Head of Product and Enterprise Architect. The broader product direction was set collaboratively; our role was to translate it into architecture and an executable technical sequence.

    1. 1

      Remove unnecessary work

      Decouple rematching from recalculation so expensive processing runs only when it is genuinely required.

    2. 2

      Make the system observable

      Introduce a consistent OpenTelemetry-based framework for logs, metrics and traces.

    3. 3

      Reduce data in the hot path

      Move inactive data out of operational databases so active workloads stay lean.

    4. 4

      Evolve the architecture

      Design around business capabilities and separate compute-heavy workers from customer-facing APIs.

    The investigation

    Start by understanding where the time is actually going

    One of the first difficulties was visibility. There was no reliable end-to-end representation of what happened after a customer triggered a recalculation.

    To investigate performance problems, we traced requests from the API downward, manually correlated log lines, followed the query path, and worked with engineers responsible for different parts of the processing pipeline to reconstruct what was happening.

    That experience reinforced something we already suspected: improving performance would be difficult if every investigation began with detective work.

    The backend had no consistent observability layer, making it difficult to identify bottlenecks and monitor services systematically. So observability became a foundational part of the solution rather than an operational afterthought.

    01

    Stop doing work that does not need to happen

    One of the most significant findings was in the recalculation pipeline. The system was performing a complete rematch and recalculation whenever certain activity changes were made.

    But not every change required the matching step. Activity-to-emission-factor relationships were already persisted, which meant the system could reason about what had actually changed rather than treating every update as if the entire matching state had become invalid.

    The architectural change was to decouple rematching from recalculation. Instead of automatically rerunning both processes, the system could identify when rematching was genuinely necessary and bypass it when it wasn't.

    For changes that did not require rematching, the new flow eliminated at least five to seven minutes of processing per applicable activity change.

    Before trying to make expensive work faster, ask whether that work needs to happen at all.

    Before: rematch and recalculate on every change

    Activity changeRematch (all data)Recalculate (all data)Updated results

    After: rematch only when needed

    Activity changeCheck if rematch needed
    Skip rematchRun rematch
    Recalculate (affected data)Updated results
    02

    Make the system observable before optimizing it blindly

    As the platform moved toward a more distributed architecture, logs alone were not enough. Once a request crosses multiple services and processing stages, knowing that an error occurred is very different from knowing where time was spent, which service introduced the delay, which database operation was slow, or whether the bottleneck was application code or infrastructure.

    We designed and implemented an observability framework based on OpenTelemetry. The choice was intentional: we wanted a vendor-neutral instrumentation layer rather than embedding AWS-specific monitoring code throughout every service.

    We also deliberately favored controlled instrumentation over simply switching on broad automatic instrumentation. Automatic instrumentation would have been easier initially, but it provided less control over which signals mattered and how telemetry evolved over time.

    To make adoption practical, we created a shared observability library so service owners did not need to understand all the details of OpenTelemetry. The framework standardized logs, metrics and traces and integrated them with the company’s existing AWS monitoring stack.

    The practical outcome mattered more than the tooling. Before this work, engineers often had to hunt through logs and correlation IDs. Afterwards, they could trace a request through the system and see where time was actually being spent.

    Observability did not merely help operate the system. It helped reveal what to optimize next.

    Example: end-to-end traceRequest flow for a recalculation
    • API Gateway
    • Activity service
    • Matching service
    • Calculation service
    • MongoDB
    • Result aggregation
    • Response
    03

    Reduce the amount of data the hot path needs to process

    Another source of unnecessary work was the volume of data sitting inside active customer databases. Not all of that data was still needed for current calculations.

    We introduced a cleanup service that moved inactive or unnecessary data out of the active database and into cold storage, while retaining the ability to restore it if required.

    That reduced the amount of information the operational system had to work through. After deployment, the team observed improvements of up to 50% in recalculation time and API response time, alongside the potential for lower storage costs from maintaining smaller active datasets.

    Why are we asking the database to carry and process this data in the first place?
    Active vs cold data

    Active data

    • Smaller, relevant dataset
    • Faster queries and calculations

    Cold storage

    • Inactive or historical data
    • Restorable when required
    04

    A severe regression demonstrated the value of methodical debugging

    During the engagement, another recalculation issue surfaced after a MongoDB version change. In one customer environment, a recalculation that should have completed much faster took approximately two days.

    The team traced the problem to indexes that needed to be rebuilt. After correcting them, the same recalculation came down to roughly 14–15 minutes, with similar improvements observed in other environments.

    This was not the centerpiece of the engagement, but it reinforced the same operating philosophy: performance problems should not immediately trigger architectural rewrites. They should trigger investigation.

    Recalculation time
    • Before (after the MongoDB upgrade)

      ~2 days
    • After (indexes rebuilt)

      14–15 minutes
    05

    Architecture around business capabilities, not database entities

    Performance improvements solved immediate problems, but there was a broader question: how should the platform evolve as the product and engineering organization grew?

    The organization was moving away from a monolithic architecture. One proposed approach was to create services based around individual data entities and CRUD operations. We recommended against that.

    If entities remain tightly dependent on each other, the system can end up replacing in-process calls with network calls while preserving the same coupling. The result is often more operational complexity without meaningful independence.

    Instead, we proposed decomposing the platform around business domains and capabilities. Each service would own a coherent piece of business logic and act as the source of truth for that domain.

    A service boundary should answer “What business capability does this component own?” rather than “Which table or document does this component perform CRUD operations on?”

    Example: domain-oriented service architecture
    Client applications (web, API)
    • Activity management
    • Emission factor management
    • Working set management
    • Matching
    • Recalculation orchestration
    • Calculation
    • Forecasting
    • Cleanup
    06

    Separate computational work from customer-facing APIs

    The architecture review surfaced another performance problem. Some CPU-intensive worker processes were deployed alongside application services responsible for serving APIs.

    Those two workloads have very different characteristics. An API process is largely optimized for I/O; a computational worker may consume CPU for extended periods.

    Running both within the same deployment meant expensive worker activity could compete with customer-facing requests for resources.

    We recommended separating the workers so they could be deployed and scaled independently. This also created the freedom to use a different language or runtime for computation in the future without forcing the rest of the platform to change with it.

    Separate workloads

    API services

    • Optimized for I/O
    • Serve customer requests
    • Scale independently

    Worker services

    • Optimized for computation
    • Run processing workloads
    • Scale independently
    07

    Move analytics closer to the shape of the problem

    Performance was not the only bottleneck the organization faced. Building new analytics dashboards was also taking too long — a dashboard could take weeks to go from requirement to usable feature.

    We redesigned that workflow around a dedicated, pluggable analytics layer connected to the platform's data.

    The approach included preprocessing data before visualization, shaping it into analytics-friendly star-style schemas, preparing reusable queries, and building reusable React visualization components.

    Instead of rebuilding the entire data-access and visualization path for every dashboard, the platform gained a reusable analytics capability. Dashboards that previously took weeks could now be delivered in days.

    This part of the engagement was also different operationally: while most of the platform work involved architecture leadership, team direction and stakeholder alignment, the analytics layer was both architected and implemented directly by Tech Swamy.

    Time to deliver new analytics dashboards
    • Before

      Weeks
    • After

      Days
    The user-facing result

    Faster experimentation

    The product allowed customers to modify parameters and datasets and then recalculate their emissions. When each iteration took several minutes, experimentation became cumbersome.

    Faster recalculation made it practical to change assumptions, rerun calculations, compare outcomes, decide what to do next and produce reports sooner.

    Better platform performance translated into faster experimentation and faster decision-making.

    The engineering result

    Less guessing

    Before the observability changes, debugging often meant manually tracking logs and correlation IDs across the system.

    With traces, metrics and standardized instrumentation in place, engineers could see the path a request had taken and identify where a slowdown or failure occurred.

    Debugging shifted from searching for clues to following evidence.

    The numbers

    Measurable impact

    5–7 minutes

    removed from applicable recalculation flows

    Up to 50%

    improvement in recalculation and API response time

    2 days → 14–15 min

    for a severe recalculation regression

    Weeks → days

    to deliver new analytics dashboards

    Our approach

    Architecture was only part of the job

    The technical work was only half of the engagement. The other half was building enough confidence in the proposal that everyone affected by it understood the problem, the alternatives, the trade-offs, and why the recommended approach was preferable.

    • Methodical problem solving

      Investigate multiple issues that were related at the system level but not obviously connected.

    • Clear communication

      Structure proposals and trade-offs so stakeholders and adjacent engineering leads can evaluate them.

    • RFCs and ADRs

      Document decisions so reasoning does not disappear into meetings or individual memory.

    • Strong execution

      Once there was alignment and buy-in, implementation proceeded with little organizational resistance.

    Engagement model

    Tech Swamy led a five-person core team, coordinated with three engineers across adjacent teams, and worked directly with the Director of Engineering, Head of Product and Enterprise Architect.

    The broader lesson

    The important part was not any individual technology

    The engagement was not really about MongoDB, OpenTelemetry, microservices, or one performance fix. It was about dealing with a collection of problems that initially looked independent: slow recalculations, expensive database infrastructure, unnecessary processing, poor visibility, difficult debugging, slow analytics delivery, and architectural constraints.

    They were not solved with one large rewrite. They were solved by approaching the system methodically: trace behavior, understand where time is spent, talk to the people who know each part of the system, separate symptoms from causes, remove unnecessary work, instrument the system, document architectural decisions and their trade-offs, and build the case clearly enough that teams can align around it.

    Good platform engineering is not about choosing fashionable architecture. It is about making the system easier to understand, easier to change, and better able to support what the business needs next.

    Has your product outgrown some of the decisions that got it here?

    Let’s figure out what is slowing your team down.

    Get in touch

    No forms. No sales team. You speak directly with the person leading the engagement.

    techswamy

    © TechSwamy. All rights reserved.