May 20th 2024
Earlier this year, A project I've been working on with a client for more than a year finally saw the day and went live with a massive digital transformation,
This project consists of Hybrid Sitecore Implementation with XM 10.3 Platform combined with SaaS OrderCloud Commerce, along with many other third-party Integrations.
In this Blog series, I will go through some details about this implementation and key factors that made it a success. You can view this as a Case Study.
In this first part, I will go through the overall architecture and design decisions, but before we get into that, let's get into a bit of history and how we came up with this implementation in the first place.
The Context:
The Client is a Not-For-Profit organization who has been on Sitecore Platform for many years, starting with Sitecore XP 8, followed by an upgrade to XP/XC 9.0.2 and later to XP/XC 9.3.
Across these multiple upgrades, and with different partners/contractors involved, the platform and the solution became heavy to maintain and challenging for Marketing to fulfill their vision. Technical Debt, Lack of Flexibility, and significant time spent troubleshooting and solving problems.
It was therefore time to start fresh with a rewrite and a new implementation.
Many options were considered:
Migrate to a 100% Cloud-Based Platform: XM Cloud with OrderCloud.
Migrate to Headless SXA XM 10.3 with OrderCloud.
Migrate from XC to OrderCloud and from XP 9.3 to XM 10.3 (SXA MVC).
The decision ended up being the latter for the following reasons:
Budget: As a Not-For-Profit organization, Budget is always a major factor.
Level of Rewrite: Even if all options are considered Rewrites, the latter option offers the possibility to reuse many of the major non-Commerce Functionalities that have been built recently. Such as the SXA-based Search Feature.
Team Skillset and Learning curve: With a team composed mainly of .Net Developers, recently trained on Sitecore, it would've been a huge lift and cost to shift to Headless at this point of time.
P.S: We went for XM instead of XP, because we opted for a Hybrid Solution with XM being much lighter than XP, and surround it with SaaS/Composable Products.
POC:
Now that the we chose a solution, next step is to do a POC to be sure OrderCloud was the right Commerce Product for us.
So the first step was to build a POC with an end to end Checkout Scenario. We picked a few scenarios that are specific to the Client and that presented some complications previously with XC.
3 key factors made this Proof of Concept, one of the best POC experiences I had:
OrderCloud Free Sandbox available for everyone to get started.
Extensive Documentation.
OrderCloud Support Team available and extremely helpful on Sitecore Slack Channel.
Design and Architecture Decisions:
After a successful POC, it's time to think about our implementation.
At this step it is very important to learn from our past mistakes and plan the implementation based on Content Team, Dev Team and QA Team feedbacks from previous implementations.
And try to make it a better experience for everyone.
Sitecore Architecture:
Since we are still on MVC, it made sense to go with Helix Principles.
Add a Connect Layer to the usual Helix trio: Project, Feature and Foundation.
Any external systems will be abstracted through the Connect Layer, making them easier to replace. (Commerce System, Payment Providers, Tax Provider and so on...). It was previously a challenge to replace integrations with external systems.
In the below example, anything specific to OrderCloud is contained in the Connect.OrderCloud project and abstracted to Feature Commerce and rest of the Solution. If we were to replace OrderCloud, we'd only have to replace the Connect Project:
Component-Based Implementation instead of Page-Based Implementation for reusability. Content Team is responsible for building the pages from the components we provide.
Enforce Feature Toggles and Group them in the Content Editor to be easier to find and manage.
Search:
Our website includes 2 types of Search:
Global Search: Accessible anywhere on the site and Combines Content and Products.
Store Search: Instead of a traditional Product Listing Page we are using Store Search with Categories being Filters.
When we started the implementation Sitecore Search didn't support combining Content and Products. This feature is now available in Sitecore Search.
So, we went with a mix of Custom and SXA Search based Solution. Using custom Renderings and Front-end with SXA Search APIs, Scopes and Facets. This allowed us great flexibility.
More details about our Search Implementation can be found in this 2-part blog Post:
Caching and Performance:
Another area we had to improve on was overall Performance both on the Front-end and Back-end. And we needed a much higher Lighthouse Score.
Being on MVC as opposed to Headless implementations can prove to be challenging in that regard, but we still managed to get Lighthouse score > 95.
A future Blog Post by one of my colleagues and Sitecore MVP Mentees will shed more light on how we achieved that.
On the server-side, we leveraged Redis Cache, which is already part of the Sitecore Install.
We used Redis, for example, to cache Product Details. In our case, to load all the data needed for a Product details page, we need to make 5 API Calls to OrderCloud. During our load testing, we clearly noticed a significant performance issue with PDPs.
So why Redis ?
It's Distributed: In a scaled production environment, you want to ensure all users see the same data and that data is up to date, especially when it comes to Products. Memory Cache would cause inconsistencies in this scenario.
It's separate from Sitecore, so you can clear, delete individual entries and so on without having to restart Sitecore. Clearing cache on Sitecore CDs has always been a challenge.
It's scalable: You can easily monitor your Redis instance and scale it accordingly if it needs more resources.
However, you need to have mechanisms in place to ensure Cache is always up to date with Product Data.
In our case, we used an OrderCloud Webhook, triggered by Create, Update Delete Products or their assignments. The webhook would simply remove the product entry in Redis, so next call loads the updated version from OrderCloud.
I will write a dedicated Blog-Post about this Redis Implementation to go into more details.
Catalog Migration:
One of the most important steps of this implementation: How to migrate our Catalogs from XC to OrderCloud.
First, we need to choose the right Catalog Architecture.
The client has 5 offices in US, Canada, Australia, UK and South Africa.
Each office serves countries within the same region.
In XC we used to have 5 separate catalogs, one for each office.
Moving to OrderCloud we decided to use a Single Catalog and manage visibility and differences through Assignments.
We ended up choosing this Catalog Design:
Multi-Currency with Shopper Selected Currencies (Guest Shopping & Anonymous Buyers)
Next step was to choose and build a Catalog Migration Process. We went with a custom-built plugin for this purpose.
The plugin is described in details this blog post: https://www.alyassolutions.com/post/sitecore-commerce-to-ordercloud-catalog-migration-plugin
Catalog Management:
For Catalog Management we chose to extend an in-house tool to do our Catalog Management and Sync with OrderCloud APIs.
Customer/User Migration:
Coming from XP/XC, our users existed in both XP (User Manager) and XC (Bizfx), but also in our Back-Office, which is the Source of Truth when it comes to Customer Data.
Moving to XM/OrderCloud, we had to figure out the Login/Auth Process, since both XM and OrderCloud have their own AUTH mechanism.
With the guidance of OrderCloud Team, we opted for:
User Impersonation in OrderCloud: This approach allows us to move forward with User migration without duplicating passwords in both systems. For more information on User Impersonation: https://ordercloud.io/knowledge-base/impersonation
OrderCloud user migration on first-time Login: We decided to only migrate Users from Sitecore XP 9.3 to Sitecore XM 10.3 using Visual Studio SQL Comparison tool. When it comes to OrderCloud, when the user logs-in for the first time on the new site, the user and its assignments will be created in OrderCloud based on the data from Back-Office. This saved us a lot of time worrying about migrating users from XC to OrderCloud.
That's all for now, I hope you find this overview of our recent hybrid implementation insightful. More Blog Posts to follow with some detailed aspects.
Feel free to comment or reach out, if you have any questions.
Comments