// CASE_STUDY_04

BANCO RENDIMENTO:
LEGACY MODERNIZATION

ROLE
Lead Software Architect
CORE STACK
C# .NET 9 / Ocelot / Angular / Keycloak
STATUS
IN PROGRESS (Strangler Pattern)
// 01. THE_FRICTION

THE "BLACK BOX" ARCHAEOLOGY

"We were dealing with code written before Git was the industry standard. We're talking Classic ASP and scripts from the early 2000s running core banking operations."

The friction wasn't just technical debt; it was technical risk. The system was a "Black Box" where maintenance was nearly impossible—changing a line of code felt like defusing a bomb without a manual.

RISK 01

Zero Version Control

Parts of the legacy system had no commit history.

RISK 02

Fear-Driven Deployment

Deployments were rare and painful; unknown impact radius.

RISK 03

Performance Bottlenecks

Ancient tech couldn't scale to modern demands.

// 02. THE_ARCHITECTURE

STRANGLER FIG & .NET 9

[ Angular Client ]
      |
      v
[ Ocelot BFF (.NET 9 Gateway) ]
      |
      +--- (Legacy Routes) ---> [ Classic ASP / Legacy Monolith ]
      |
      +--- (Modern Routes) ---> [ New Microservices (.NET 9) ]
                                    |
                                    +--> [ Keycloak (Auth) ]
                                    |
                                    +--> [ SQL Server ]

We chose the Strangler Fig Pattern to mitigate risk. We don't rewrite everything at once; we "strangle" the legacy system route by route.

Ocelot Gateway (BFF): Acts as the facade. It handles routing and aggregation. Frontend is agnostic to the backend implementation.

Domain-Driven Design (DDD): New services enforce strict business rules, not just scripts.

Keycloak: Centralized Identity Management (OAuth2/OIDC).

// 03. R&D_INTELLIGENCE

AGGREGATION & MODERNIZATION

The biggest engineering challenge was ensuring the new .NET 9 services could coexist with the chaos of the past while delivering superior performance.

1
ROUTE HIJACKING

Mapping Ocelot endpoints to new microservices, instantly modernizing features.

2
REQUEST AGGREGATION

Ocelot aggregates 5+ calls backend-side, reducing latency and chatty traffic.

3
STRICT TYPING

Moving from loose scripting to C# strong typing for reliability.

// Ocelot Configuration Example (Simplification)
{
  "Routes": [
    {
      "DownstreamPathTemplate": "/api/v1/investments/{userId}",
      "DownstreamScheme": "https",
      "DownstreamHostAndPorts": [ 
          { "Host": "new-investment-service", "Port": 80 } 
      ],
      "UpstreamPathTemplate": "/investments/{userId}",
      "UpstreamHttpMethod": [ "Get" ]
    },
    {
      "DownstreamPathTemplate": "/old-asp/account.asp",
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [ 
          { "Host": "legacy-server", "Port": 80 } 
      ],
      "UpstreamPathTemplate": "/account/details",
      "UpstreamHttpMethod": [ "Get" ]
    }
  ]
}
// 04. UX_LEADERSHIP

ANGULAR MODULAR MONOLITH

While the backend is distributed, the frontend needs to be cohesive. We avoided the "Micro-frontends" hype trap which would add unnecessary complexity at this stage. Instead, we built a Modular Monolith.

We implemented a standardized UI Kit and strict TypeScript interfaces. A Junior dev doesn't need to guess how to build a service call; they follow the architectural blueprint.

PLACEHOLDER: BANKING_DASHBOARD_UI
.NET 9
MIGRATION

Performance - Leveraging the latest .NET runtime features (AOT, JIT) for future-proof, fast services.

15+
SERVICES

Decoupling - Successfully identified and mapped over 15 distinct business contexts being strangled out.

100%
UPTIME

Zero Downtime - The Ocelot Gateway allows instant traffic switching without disrupting the end-user.