I was recently hired, and I found two exact applications with a single extra service in the duplicated version, and of course each application points to separate databases.

However, the original version had some vulnerabilities that I need to duplicate again on the copied version.

Thus, the raised question is: should we keep one application and show/hide functionalities, or is the current situation the right one?

2 Answers 2


You should never duplicate complex code. Period. The main reason is exactly the situation you're in: Complex software will require modification (whether to correct defects or to extend functionality doesn't matter), and making the same change twice is more effort and more error-prone.

Therefore the right thing to do is to develop one code base and deploy it wherever and however it's needed to satisfy the business requirements. There's nothing wrong with multiple instances of a program running multiple times in an enterprise, on separate databases, etc. However, they should be developed and maintained once and not multiple times. Everything that involves duplication should be part of an automated deployment process.


I concur with what @Killian Foth says in their answer. I would add that there may come a time in the future when the functionality needed by the users of the 2 apps starts to diverge and you may be tempted to once again break it into 2 separate apps. In a case like this, I would recommend instead breaking the functionality out into libraries (possibly dynamically loaded, possibly static, depending on the specific needs of each app). The various libraries can contain the code which is shared, and can still be included in both apps to reduce the work of maintenance.

Note also that in cases like this you'll often want to have some versioning mechanism so that different groups can keep track of what version of either the app or any given library they are currently running. That way if they report a bug that has been fixed you can see if they're using an older version and just need to update to get the fix, or if in fact the bug has regressed and reappeared.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.