← Back to list

3 Patterns to help you with app migration and modernization

The reverse proxy pattern

Anastasios Savvopoulos · 2025-08-27 12:24 · 0 claps · 3.2 min read
#app-modernization #application-migration #architecture-design
Open on Medium ↗
Wiki topics: 🏛️ · Architecture

3 Patterns to help you with app migration and modernization

The reverse proxy pattern

Usually the reverse proxy is a component, most of the times a separate server that sits between your application and the client. But also it can be a code component that proxies the an object of some kind between you the component author and your client.

Based on the kind of the request for example the proxy can decide to send the request on the old back-end service or the new one. The criteria could be different from the URL of the request or the parameters.

Coding wise this design pattern can help you encapsulate an object and add additional functionality for example such as caching as seen in the example below.

// File
interface MyFile {
    void printContents();
}

// Real implementation
class RealImage implements MyFile {
    private String filename;
    public RealFile(String filename) {
        this.filename = filename;
        createFileInDisk();
    }
    public void printContents() {
        System.out.println("Displaying file contents: " + filename);
    }
}
// Proxy implementation
class ProxyFile implements MyFile {
    private RealFile realFile;
    private String filename;
    public ProxyFile(String filename) {
        this.filename = filename;
    }
    public void printContents() {
        if (realFile == null) {
            realFile = new RealFile(filename);
        }
        realFile.printContents();
    }
}
// Client code
MyFile myFile = new ProxyFile("example.txt");
// File will be created in disk only when printContents() is called
myFile.display();
// File will not be created in disk again
myFile.display();

Benefits:

  1. You can use it to encapsulate components and expose a consistent contract to your clients.
  2. It can help you centralize functions in the proxy such as addition of custom header requests, logging, authentication etc
  3. You can migrate older components to new by hiding implementation details.
  4. Can potentially optimize resource consumption either for services that need less resources that can be separate to your main application or in code with lazy-loading.

The strangler fig pattern

The strangler fig pattern is ideal when modernizing legacy applications by moving parts of your legacy code into a new app. You can use a facade or a proxy, which is your strangler fig proxy that raps your public api contract and redirects the request coming to the proxy from outside to the new code.

This is an iterative approach that slowly moving parts of your legacy application into new code or even separate services. The complexity here is that both the old and new application live at the same infrastructure that could cause issues and data complexity.

Benefits:

  1. You can reduce the risk of your migration because it’s not a big-bang approach
  2. It can allow you to work with multiple teams that cannot handle the complexity of the whole monolith at the same time
  3. You can create quick wins since moving smaller parts of the monolith can be moved relatively quickly.

The shadow requests pattern

Request shadowing is a technique that can be used to mirror requests to other components of your system. You can either choose to mirror all traffic to 2 or more components or even use other techniques such as weighting or percentage etc.

This component usually is a proxy similar to a reverse proxy but you will often hear it as envoy proxy, which is specifically configured to forward all or parts of your requests to other components.

An envoy is nothing else but an intermediate component acting many times as a load balancer, proxy etc and facilitates communication between services. Nginx can also be an envoy for example with appropriate configuration.

Benefits:

  1. You can easily test new implementation of your apps by just replicating requests in your new environment
  2. In some case scenarios database migration can be achieved by running different versions of services in parallel that handle different database schemas.
  3. You can also do performance comparisons for both services running in parallel given the same request.

Conclusion

These are some of the many patterns you can use when migrating your older legacy apps in the cloud. I encourage you to try and look more information about them as well as build your own test project on how to best utilize them in your applications.

If you found this article useful, leave me a comment or share it!


메타데이터
post_id
71bfb9181bb0
slug
3-patterns-to-help-you-with-app-migration-and-modernization-71bfb9181bb0
url
https://medium.com/@anastasios.savvopoulos/3-patterns-to-help-you-with-app-migration-and-modernization-71bfb9181bb0
canonical_url
https://medium.com/@anastasios.savvopoulos/3-patterns-to-help-you-with-app-migration-and-modernization-71bfb9181bb0
author_url
https://medium.com/@anastasios.savvopoulos
status
ok
fetched_at
2026-06-09 15:37:30