In the last two years, more vocabulary has been added to the Salesforce B2C Commerce Cloud ecosystem because of the Composable Storefront.
And one of the terms you might have heard is “Managed Runtime“, which provides the infrastructure to deploy, host, and monitor your Progressive Web App (PWA) Kit storefront. In this article, we will explore the inner workings of Managed Runtime, its benefits, and how it empowers developers to build storefronts without having to think (much) about the underlying infrastructure.
What does the Managed Runtime do?
The Managed Runtime is designed to support applications created from a PWA Kit template in the PWA Kit repository on GitHub. It operates within environments, which is the term to describe all of the cloud infrastructure and configuration values. It is possible within that infrastructure to differentiate between development and production environments.
Developers will use the PWA Kit tools to generate a bundle, a snapshot of the storefront code at a specific time, and push it to Managed Runtime. Once the bundle is pushed, it is possible to use the Runtime Admin Web Interface or Managed Runtime API to designate that bundle as “deployed.”
Each project can have multiple bundles, but each environment has only one “deployed” bundle. Similar to the fact that you can only have one active “Code Version” on the server side.
The Managed Runtime operates within a hierarchy of organisations and projects. Organisations can contain multiple projects for various storefronts, and each project can contain multiple environments.
This structure allows for efficiently managing multiple environments and separating different work streams.
Under the hood, the Managed Runtime uses AWS Lambda, a serverless computing service provided by Amazon Web Services (AWS) that allows you to run your code without provisioning or managing servers.
Curious about Lambda? Here you go!
Benefits of the Managed Runtime for businesses
When a platform offers features, there are a lot of questions that will go through your mind. And one of them will probably be, “What benefits does it bring?”:
- Included in the license: It is not a phrase you often see in the Salesforce Eco-system, but the managed runtime is ready to be taken advantage of if you have a license for B2C Commerce Cloud!
- Simplified deployment: Managed Runtime streamlines deploying and hosting your PWA Kit storefront, meaning that developers only need to develop – and not worry about the infrastructure. And that saves time and, ultimately, money.
- Scalability: Nothing new to B2C Commerce Cloud, but the infrastructure provided by Managed Runtime allows your storefront to scale seamlessly as your business grows, ensuring optimal performance and customer experience just like the “monolithic solution“.
- Security: Managed Runtime offers robust security features that protect your storefront from potential threats and vulnerabilities like the back end.
- Improved troubleshooting: The immutable nature of bundles allows for a complete and accurate history of deployments, making it easier to identify and resolve issues or even do a quick rollback to a previous version!
Benefits of the Managed Runtime for developers
Developers working with Salesforce B2C Commerce Cloud can leverage this runtime to:
- Accelerate development: This was already mentioned, but the fact that, as a developer, you do not have to worry about the infrastructure is a significant benefit!
- Streamline collaboration: The organisation and project structure within Managed Runtime enables you to work together more efficiently, sharing knowledge and resources across multiple environments.
- Enhance productivity: With the ability to designate specific bundles as deployed, developers can easily switch between different versions of their storefront, making testing and iterating on new features more accessible.
- No credits: The environments on the managed runtime do not work on the same system as the sandboxes (credits for uptime). That means no extra processes have to be set up!
Salesforce offers a range of APIs that developers can use to interact with the platform, including:
- Managed Runtime APIs: This API allows developers to manage bundles, environments, and deployments within their projects.
- Admin APIs: This API provides access to administrative functions, such as managing users, organisations, and projects.
Some developers might hesitate to give up control when deciding whether to let Salesforce manage its environment. Others might appreciate the specialised skills needed to manage infrastructure and will gladly pass on the baton to Salesforce.
It’s important to know that you don’t have to use the Managed Runtime option and can create your own Headless Storefront for Salesforce B2C Commerce Cloud if you want to. But if you choose this route (build your own), the managed runtime might not be an option!