Skip to content

Commit bdf4514

Browse files
committed
added migration pages
Signed-off-by: bidi <bidi@apidemia.com>
1 parent ff25b9b commit bdf4514

5 files changed

Lines changed: 119 additions & 0 deletions

File tree

docs/book/v1/introduction.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ The principle of a Headless Platform is to decouple the User Interface (frontend
44
The responses from the platform are then used by another system, such as a website or mobile app.
55

66
![Headless Platform](https://docs.dotkernel.org/img/headless-platform/api-comms4.png)
7+
8+
Its design leads to a great deal of versatility in the setup and configuration.
9+
Here are some of the advantages of the Headless Platform:
10+
11+
- The ability to have multiple frontends, each targeted to various end-users, like desktop vs mobile, iOS vs Android etc.
12+
- Different frontends (websites) for various niches (younger vs older users) and countries (including localization).
13+
- Ability to customise separate frontends in terms of design, as well as available features.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Full Rewrite or Big Bang Rewrite
2+
3+
A full rewrite is a software migration strategy that implies completely rebuilding the system from scratch in the new architecture or technology.
4+
5+
## How It Works
6+
7+
- You keep the old application in use, as-is.
8+
- In parallel, you work with the development team to build a new version of the application in the target environment.
9+
- Once the new application is complete and tested, you redirect all execution to the new application.
10+
- You decommission the old application.
11+
12+
## Pluses
13+
14+
There are several advantages to this approach:
15+
16+
- Blank slate – No technical debt is carried over to the new application.
17+
- Optimal architecture – You can code the new application without worrying about legacy code or outdated design patterns.
18+
- Better maintainability and security – The new code can follow modern best practices which may be incompatible with the old code.
19+
20+
## Minuses
21+
22+
The disadvantages often weigh heavy against choosing this approach:
23+
24+
- High risk – Your release must work on the first try, there’s no partial rollback.
25+
- Long timeline – There is no immediate user value during development.
26+
- Expensive – Building a second product in parallel may prove to be just as costly as the original product.
27+
- Feature drift – Since the old application is still running, any updates performed on it may cause further delay on the development of the new one and greater mismatching of business logic.
28+
29+
## Conclusion
30+
31+
Performing a full rewrite is no easy choice.
32+
More often than not, the costs are the main reason you would not choose this migration strategy.
33+
You may find yourself delaying its implementation until you are forced to do so by circumstance.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Migrations
2+
3+
When we talk about **migration**, we primarily refer to the **transfer of functionality** (the codebase) from one platform to another, more often from an older architecture like MVC, to a modern one like middleware.
4+
Still, a complex platform migration may include:
5+
6+
- Replatforming - e.g. from on-premises to the cloud.
7+
- Refactoring - to improve readability, maintainability, and efficiency.
8+
- Database or storage migration - to improve execution time and/or security.
9+
10+
The **migration of the software codebase** is the process of moving a software system's source code **to another environment**, which can involve:
11+
12+
- Updating to a newer version of a language or framework.
13+
- Changing the infrastructure e.g. moving from SQL to NoSQL databases.
14+
- Replacing designs for security and compliance requirements.
15+
16+
The process ensures that software is kept functional, compatible, and secure as the technology evolves.
17+
It is also the perfect opportunity to implement modern design patterns recommended by the development community.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Modular Refactoring
2+
3+
The Modular Refactoring is a migration strategy where you break a large, tightly coupled codebase into smaller, independent modules.
4+
Once the modules are defined, you begin the migration to the new architecture.
5+
6+
## How It Works
7+
8+
- Identify logical boundaries in the business logic.
9+
Search for sections of code that can function independently.
10+
- Decouple dependencies.
11+
Refactor code to reduce direct cross-module calls, often introducing interfaces or APIs for communication.
12+
- Isolate each module.
13+
Ensure each module can be built, tested, and deployed separately.
14+
- Migrate module-by-module.
15+
Move one module at a time to the new architecture, integrate it back into the system, and test its functionality before moving on.
16+
17+
## Pluses
18+
19+
- Controlled scope – Each migration step is focused on one module.
20+
- Improved maintainability – As the migration progresses, the system becomes cleaner and more modular.
21+
- Enables parallel work – You can assign different development teams to migrate different modules at the same time.
22+
- Lower risk – If a migration fails, only one part of the system is affected.
23+
24+
## Minuses
25+
26+
- Refactoring cost – Breaking a monolith into modules takes time and effort.
27+
- Possible temporary slowdown – You may need to allocate resources from new feature development to the refactoring effort.
28+
- Requires strong design discipline – You need to carefully plan modules to avoid repeated rework.
29+
30+
## Conclusion
31+
32+
Modular Refactoring implies a great deal of preparation (proportional to the complexity of the application) before the migration takes place.
33+
You take e.g. the existing monolith and reorganize it into clearly defined modules, while in the same repository.
34+
You can the extract the modules into new repositories or move them into microservices, and create interfaces between the old and the new code.
35+
For the actual code migration, you can opt for the Strangler Fig Pattern.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Strangler Fig Pattern or Incremental Migration
2+
3+
The Strangler Fig Pattern is a software migration strategy that implies gradually replacing parts of the old application with new components until the old application is not needed any more.
4+
5+
## How It Works
6+
7+
- Wrap the old application with a routing layer that enables you to selectively redirect incoming requests to either the old code or to new code.
8+
- Choose an existing feature or service and build it in the new architecture.
9+
This applies to new features, as well.
10+
- Replace old features as they are ready to be deployed.
11+
After development and testing is complete on the new code, reroute traffic for that feature or service to the new code.
12+
- Decommission the old application.
13+
Once all features and/or services are migrated, you can shut down the legacy code completely.
14+
15+
## Pluses
16+
17+
- Lower risk – Each change is small, and thus easier to manage and test.
18+
- Continuous delivery – Users and stakeholders see improvements throughout the development process.
19+
- Easier rollback – If the new code doesn't work as intended, reroute traffic back to the old code until the new one is revised.
20+
- Better learning – You discover and fix problems early, adapt your plan more dynamically, and understand the business logic better.
21+
22+
## Conclusion
23+
24+
The Strangler Fig Pattern is the recommended way to go for legacy applications, especially complex ones where a full rewrite would take years and/or millions of dollars.
25+
You mitigate downtime and risk by handling small, easily manageable sections of code at any given time.
26+
One restriction for this pattern is that you need to be able to intercept requests and redirect execution.
27+
The development team can be smaller (since you isolate sections of code you work on) and the development schedule is more adaptable (you can stop at any time because the old application is always there).

0 commit comments

Comments
 (0)