Independent sites with a shared Symfony foundation

Where shared technical capabilities end and product rules begin, using a hypothetical personal journal and catalogue.

A journal and a catalogue on a shared foundation illustrate independent product decisions.
A journal and a catalogue on a shared foundation illustrate independent product decisions.

What can be reused, and what should remain a decision for a particular product.

A personal journal and a product catalogue may have the same technical needs: pages, images, search, permissions, and caching. Yet a successful user action means something different in each. In a journal, a person finds and reads an article. In a catalogue, they choose a product and proceed to the appropriate commercial flow.

Building the entire system separately for each site gives repeated mechanics several owners. Combining every rule in one application makes the products' specific needs depend on one another. Solution200 is built around a different boundary: shared capabilities come together in independent products, each retaining its own policies.

The task defines what can be shared

Two classes looking similar does not prove that they need one implementation. First establish whether they answer the same question, have the same lifecycle, and should have their behavior changed by the same owner.

For example, preparing a derivative image can be a shared technical capability. But choosing which photograph becomes a product's main image belongs to the commercial product. Choosing a cover for a personal article belongs to the journal's editorial policy. A shared image processing mechanism should not make these decisions for them.

Data reading, checking a particular contract, or delivering an event can also be reused. The basis is a shared responsibility. Reducing differences to conditions containing site names inside a library merely moves the dependency somewhere less visible.

Which decisions remain with the site

In the Solution200 approach, a particular site combines the capabilities it needs and supplies its own values. This is where presentations, routes, branding, usage rules, and specific integrations are defined.

Using a hypothetical journal and catalogue, the boundary looks like this:

QuestionShared technical capabilityProduct decision
How to prepare an imageProcessing the original and derivativesAssigning a cover or main photograph
How to retrieve a listThe reading and ordering contractWhich collection the page needs
How to update a prepared presentationCaching and invalidationWhich pages display the data
How to build a linkThe URL generation mechanismThe site's accepted address structure
When an action is allowedShared checks for a defined capabilityRoles and rules for the particular scenario

The practical criterion is simple: once a shared capability has been extracted, its owner should understand the task without knowing which brand the code is currently serving. The site owner, in turn, should see exactly where the product's behavior is chosen.

One codebase does not mean one database or one set of permissions

Code reuse concerns behavior. Data, secrets, permissions, and execution processes require separate decisions. Installing the same libraries does not define access between sites; that needs its own configuration.

Two products can have similar data structures and different databases. They can use the same technical capability while having different accounts. One product's public presentation should not gain another's editorial permissions merely because both are built on Symfony.

There is a separate release boundary too. Each application pins its own dependencies. After a shared library changes, its consumers are not updated automatically: each application needs to select the new revision, install it, and check it.

How to change the foundation without hidden coupling

Suppose the same derivative image preparation bug is found in two products. First establish that the shared mechanism is actually responsible. If it is, the fix belongs with that mechanism's owner.

Next, check the capability's own behavior: the normal result, invalid input, and relevant boundaries. Each product then adopts the required revision and checks its scenarios. One shared change can affect the journal and catalogue differently because of their composition.

If the cause turns out to be a photograph selection rule specific to the catalogue, the shared foundation does not need to change. Otherwise, the library starts accumulating one product's rules that later consumers will be forced to work around.

The limits of this approach

A shared foundation requires version discipline and consumer checks. A bug in a widely used capability can affect several products. Reuse therefore needs a clear delivery process rather than manually copying a fixed file into installed dependencies.

Before extracting the next piece of code, the reader can ask one useful question: who should change this behavior when another product needs it? If the answer is clear, there is a basis for a shared capability.

  1. Architecture Admin, Frontend, and API: three distinct responsibilities
  2. Conformance How one fix to a shared foundation reaches sites
  3. Platform Engineering First Symfony site on a prepared stack: Composer and file permissions
  4. Architecture When a shared capability is ready to leave the project
  5. Caching Core, caching, and different devices: three foundation tasks

A project by the author · Weather Solution200

After reading, a look outside.

Temperature, rain and wind in your city. Check the forecast and plan the hours ahead.

Check the forecast
Next article