Say you have a successful site.
It's built quite many years ago but still very functional.
However, you've now built a new foundation for your websites and would ideally like to use this for the functionality of the successful site mentioned earlier.
What's a viable way to get the new foundation tested (so you know that you can use it for the new stuff without ending up realizing that it was actually WORSE than the old way of building things)
Also, how do you do this since you cannot do it step by step as the foundation is completely different. I guess you can lift feature by feature but the old implementation is procedural PHP (I'm not sure I use the right word here but what I mean is that the PHP has globals and functions, and I manually include all files needed with every call in a "app.php" file, basically the way Wordpress works if you are familiar) whereas the new foundation utilizes OOP a bit more in the sense that we use a Layered Architecture:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Controllers (handle requests)
Services (contain business logic)
Repositories (handle data access)
Controllers are generally responsible for handling requests, setting up data, and choosing views
Services might handle broader business processes e.g. Password Hash and Password reset can go in same "PasswordService"
One repository per table/entity. If security or business concerns warrants it, we can use > 1 repository per table e.g. PasswordRepository operates on stuff that usually goes in UserRepository.
Fine.
The app is split up in three parts:
Domains
Features
Shared
The shared is the base part. Features may use shared services. A feature is typically something like Authentication and in there UserLoginService, UserRegistrationService, UserActivationService etc.
Domains are stuff that are application specific. Most features and shared stuff can be used in many different projects.
In addition to this, we use VITE to handle the JS and CSS which give us a lot better handling of "load features as you need them" in the user flow on the website, improving (we THINK) performance and load times etc.
Assistant
Transitioning to a New Foundation for an Established Website
Testing Strategy for Your New Foundation
To properly test your new foundation before fully committing to it, consider these approaches:
1. Shadow Testing
Implement the new system to run in parallel with the old one
Have both systems process the same requests, but only return results from the old system
Compare outputs to identify discrepancies
This helps validate that the new system produces identical results without affecting users
2. Feature Parity Testing
Create a comprehensive test suite that covers all existing functionality
Document expected behaviors from the old system
Ensure the new implementation passes all these tests
Include performance benchmarks to verify the new system isn't slower
3. Controlled Rollout Options
Option A: Subdomain Testing
Deploy the new foundation on a subdomain (e.g., new.yoursite.com)
Invite internal users or a select group of customers to test
Gather feedback and fix issues before wider deployment
Option B: Feature Flagging
Implement feature flags that allow you to toggle between old and new implementations
Gradually enable the new system for increasing percentages of users
Monitor metrics and roll back quickly if issues arise
Migration Strategy
Since you can't migrate step-by-step due to the architectural differences, consider:
1. Strangler Pattern
Create an API/facade layer that both old and new systems can work with
Gradually move functionality from old to new, one feature at a time
Use a routing mechanism to direct traffic to the appropriate implementation
This allows incremental migration despite different architectures
2. Domain-by-Domain Migration
Start with less critical domains or features
Fully implement and test one domain before moving to the next
This breaks down the migration into manageable chunks
3. Data Migration Considerations
Ensure data consistency between systems during transition
Consider using a shared database initially if possible
Or implement synchronization mechanisms if using separate data stores
Performance Validation
Since you mentioned VITE and performance improvements:
User
If I'm in a situation where I want to start a subscription service on the old system, but I realize that I would then need to implement quite a lot of what is already there in the new system e.g. login / register rate limits etc., should I wait and try to finish it on the new system first or should I implement what's needed in the old system, the "old way", to secure that this doesn't become a "we'll soon get there, just another month we think " i.e. the myth of the next release.
Assistant
Balancing Immediate Needs vs. Future Architecture
This is a classic technical strategy dilemma that many organizations face. Here's my analysis and recommendation:
Option Analysis
Implementing in the Old System
Pros:
Faster time-to-market for your subscription service
Proven, stable environment with known behaviors
Immediate revenue generation
No dependency on completing the new system first
Cons:
Technical debt accumulation
Duplicated effort (implementing features that already exist in new system)
May need to migrate these features later
Resources diverted from completing the new foundation
Waiting for the New System
Pros:
Avoids duplicate implementation
Better architecture from the start
Forces progress on the new foundation
No migration needed for these features later
Cons:
Delays revenue from subscription service
Risk of the "just another month" syndrome you mentioned
Business opportunity cost while waiting
Potential scope creep as you try to perfect the new system
Recommendation: Hybrid Approach
I recommend a pragmatic hybrid approach:
Set a firm deadline for evaluating if the new system can be ready in a reasonable timeframe (e.g., 2-4 weeks of focused assessment)
During this assessment period:
Identify the minimum viable subset of the new system needed to support subscriptions
Create a concrete timeline with checkpoints
Determine what resources would be needed to meet this timeline
Make a data-driven decision:
If the timeline is reasonable (e.g., 1-3 months depending on business needs), proceed with the new system
If longer, implement in the old system with a migration plan
If implementing in the old system:
Design the subscription implementation to be as modular and isolated as possible
Document thoroughly to ease future migration
Consider implementing an abstraction layer that could later be connected to the new system
Business Considerations
Set up performance testing with tools like Lighthouse, WebPageTest
Establish baseline metrics from the current site
Compare with the new implementation under similar conditions
Test with various network conditions and device profiles
Validate your hypothesis about improved load times
Risk Mitigation
Maintain the ability to quickly revert to the old system
Document all changes and decisions
Set clear success criteria before starting
Consider hiring external auditors to review the new architecture
This approach allows you to thoroughly test your new foundation while minimizing risk to your successful site.
The "myth of the next release" is real and costly. Consider:
Opportunity cost: Calculate the revenue lost by delaying the subscription service
Market timing: Are there competitive pressures making speed essential?
Customer expectations: Will your existing users wait?
Technical Considerations
If you implement in the old system:
Use patterns that minimize entanglement with the legacy code
Consider implementing just the API in the new system, with UI in the old system
Document all decisions and technical debt incurred
Final Thought
Remember that perfect is the enemy of good. A subscription service generating revenue on an imperfect technical foundation is usually better than a perfectly architected system that's still in development while opportunities pass by.
The key is making this a conscious business decision with clear timelines, rather than letting technical perfectionism indefinitely delay business value.