Saturday, October 21, 2023

Maximizing Sitecore XM Cloud: Unraveling Multisite Setup Options



Sitecore XM Cloud stands out for its unparalleled flexibility in managing multiple sites within its ecosystem. A critical decision in setting up multisite configurations is whether to employ a single head to serve multiple sites or deploy multiple heads to manage distinct sites. In this article, we'll delve into both options, highlighting their advantages, considerations, and best use cases.

Option 1: Single Head to Serve Multiple Sites

In this approach, a single Sitecore head takes on the responsibility of serving content to multiple sites. Each site shares the same backend infrastructure, reducing operational overhead and potentially minimizing costs.

Advantages:

  • Centralised Management: Maintenance and updates are streamlined as all sites operate within a unified instance.
  • Cost-Efficiency: Shared infrastructure can lead to cost savings in terms of resource utilization and hosting expenses.
  • Unified User Experience: Consistency in content management and administration interfaces facilitates a standardized user experience.

Considerations:

  • Scalability Challenges: As traffic and content demands increase, a single head might face scalability challenges, impacting site performance.
  • Customisation Limitations: Achieving distinct branding and feature sets for each site might be more challenging due to shared resources.
Implementation:- 

Sitcore has the build in plugin which can be used, here is the high level digram, taken from the Sitecore site just for the reference here.

Image source taken from the Sitecore -  The Next.js Multisite add-on
Full Implementation details can be found in above link, after doing the setup, when you run the application (Next.jss) app, it it will give a site reponse as a collection of all the sites.





Option 2: Multiple Heads to Serve Multiple Sites

In this scenario, each site is associated with its dedicated Sitecore head, providing autonomy in terms of content management and scalability.

Advantages:

  1. Scalability: Each site can scale independently based on its specific requirements, ensuring optimal performance.
  2. Customization Flexibility: Tailoring each site to its unique branding and functionality is more achievable with separate heads.
  3. Isolation: The independence of heads ensures that issues or updates on one site do not impact others.

Considerations:

  • Increased Management Complexity: Operating multiple heads necessitates additional management efforts for updates and maintenance.
  • Resource Utilisation: Separate heads might lead to increased resource utilization, potentially impacting hosting costs.
Implementation:- 

I used this aproach for one of our client, I belive that time we cound't find the option of Multisite plugin, we used multiple site in the solution.

Like 
1. Shared
2. Site1
3. Site2

We used NPM Workspace to share the content beetwen all the sites, to resolve the dependencies we used next-transpile-module and defined dependencies in packages.json 

Now, to access the shared site components, we used ComponentFactory.ts which is generated when we run a build.

My work colleague, David, has written an excellent blog post on a similar implementation. You can read it here: Headless Sitecore JSS Multi-site with NPM Workspaces


Best Use Cases

Single-Head Approach:

  • Ideal for scenarios where sites share similar content, branding, and features.
  • Suitable for small to medium-sized multisite setups with moderate traffic.

Multiple Heads Approach:

  • Recommended for multisite setups with diverse content, branding, and functionality.
  • Appropriate for larger-scale implementations where autonomy and scalability are paramount.

The choice between a single head serving multiple sites and multiple heads for distinct sites in Sitecore XM Cloud hinges on the specific requirements and characteristics of your multisite architecture. Carefully assess the unique needs of your organization, considering factors such as scalability, customization, and management efficiency, to determine the most suitable approach for your multisite setup.

No comments:

Post a Comment