Question

Ok so first I want to describe the anti-pattern anti-practice.

Company creates system for customer number 1. Then customer number 2 comes along they fork the codebase customize it. (Say for variations in customer number 2s country) Rinse and repeat for the next 14 customers.

Now to add an new feature needs to be repeated 16 times. Very expensive!

Let's say you get to rewind the clock back to starting work for customer number 2.

What patterns or practices can be used to keep one core code base which can service many different customers/countries, but with some quite divergent requirements?

I am not looking for implementations, but for abstract patterns that can be applied to any system

Était-ce utile?

La solution

What you need is a core and modules.

The core will contain all of the functionality that is common to every tenant.

Modules will also contain common functionality, but can be customized to each tenant, and there will be modules that are specific to particular tenants.

Hence, you need a "modular" system.

There are several technical solutions for modularity, in particular plugin systems. Most modern programming languages use interfaces. I suggest you begin by researching those.

Making a database multi-tenant can be as simple as adding a TenantID field to each table.

Licencié sous: CC-BY-SA avec attribution
scroll top