Legacy Database Refactoring

Untangle, modernise, and stabilise the database logic your VB6 system depends on. Refactoring SQL, stored procedures, triggers, and data access patterns is essential for both stability today and successful modernisation tomorrow.

Most VB6 systems rely on database code that has grown organically for years. Inline SQL, procedural logic, and hidden dependencies often create performance bottlenecks, concurrency issues, and unpredictable behaviour. This service focuses on understanding, documenting, and refactoring that logic in a safe, structured, and maintainable way.

Who this is for

  • Organisations with VB6 systems that rely heavily on stored procedures and inline SQL.
  • Teams experiencing performance issues, deadlocks, or unpredictable behaviour.
  • Businesses preparing for a rewrite and needing clarity on database logic.
  • Environments where database changes are risky due to lack of documentation.
  • Organisations that need to move to a different database platform but cannot untangle the old one.

Problems this service addresses

  • Stored procedures with hidden side effects or duplicated business rules.
  • Inline SQL scattered across forms and modules.
  • Triggers that obscure data flow and create debugging challenges.
  • Queries optimised for hardware or workloads that no longer exist.
  • Data access patterns that block concurrency or degrade performance.

Benefits and outcomes

Improved stability

Refactored SQL and stored procedures reduce fragility and make behaviour more predictable. Create one class that holds all SQL calls in one manageable and efficient construct.

Better performance

Modern indexing, query tuning, and data access patterns improve responsiveness and throughput.

Modernisation‑ready

Clear, documented database logic makes rewrites faster, safer, and more accurate.

Refactoring approach

1. Discovery and mapping

We identify where business logic lives: stored procedures, triggers, inline SQL, and data access modules. This includes mapping dependencies and understanding real‑world usage patterns.

2. Behavioural analysis

We analyse how queries behave under load, how they interact with each other, and where bottlenecks or risks exist.

3. Refactoring and optimisation

We refactor SQL, consolidate logic, remove duplication, and modernise data access patterns. Where appropriate, we introduce indexing, partitioning, or architectural improvements.

4. Documentation and handover

All changes are documented clearly, including data flows, dependencies, and business rules. This supports both ongoing maintenance and future rewrites.

Deliverables

  • Database logic map (stored procedures, triggers, inline SQL, dependencies).
  • Refactored and optimised SQL and stored procedures.
  • Documentation of business rules embedded in the database.
  • Performance and stability improvements with before/after metrics.
  • Recommendations for future architecture and modernisation.