all news

Introduction to Salesforce Commerce Cloud

November 18, 2020
Introduction to Salesforce Commerce Cloud
Ostap Spilchuk
Web Developer Principal at Astound Commerce

I have been working as an SFCC developer for a few years and I’ve decided to share my knowledge about Salesforce Commerce Cloud (SFCC). This content may primarily interest those who have come across the platform for the first time: in a job description or a recruiter’s message, or you might have passed an interview for a position of a beginner SFCC-developer (without experience of work with this platform) and you are unsure what to do next. Another reason for writing this article is the fact that you cannot google a lot about SFCC as it is a closed ecosystem. In most cases, you come to understand what exactly you are dealing with only having worked with the platform for several months. It’s great if your expectations have matched the reality, and it’s worse if you haven’t managed to get your head round SFCC.

At one time I also had doubts if it was worth going into SFCC. Back then, as well as nowadays, there wasn’t enough information. Lack of publicly available detail was highly alarming, making me think that it was another useless platform utilized by a single company. At that time it was called Demandware and had no connection to Salesforce. Since I am writing this article now, it is obvious that I decided to take a risk and give it a go. The documentation for the platform has recently become publicly accessible which enables you to get a general idea of SFCC’s functionality and options. Following is the description of it, without any comparisons with other e-commerce platforms such as Magento or Hybris.

Introduction about SFCC platform

Salesforce Commerce Cloud (formerly Demandware, before it was acquired by Salesforce company) is a cloud platform for delivering e-commerce solutions. This is a platform which makes it relatively easy to run a big e-commerce business. It provides practical tools for both sellers and users. With SFCC you don’t need to make a tremendous effort and reinvent the wheel to create local internet stores with simple sale of goods, convenient order management, and final customers’ service.

1.1. Architecture of Salesforce Commerce Cloud

As soon as a user accesses a website created on SFCC, all the static content (JS, CSS, images) is delivered from CDN. SFCC uses eCND (Embedded Content Delivery Network). Additionally, you can configure to use an external CDN. Consequently, there is no load on Salesforce servers for static content. The rest of the data/information is processed by Salesforce servers. The company has powerful data-centers scattered around the world in order to be as close to the clients as possible. Structurally in one such data-center, there are many PODs (Point of delivery) – a hardware group that is shared among a certain number of clients dynamically allocating more resources to those who need them. A POD consists of a firewall, switches, load balancers, processing units, and file systems.

1.2. Common integrations in a simple SFCC project

All SFCC-based projects are aimed at rather big clients with sales of approximately 10-50M$ or more per year and respective site load – hundreds of thousands of users, and during big sales, this number reaches even millions. Almost in each project there is a need to integrate with a big list of services and systems:

  • payment service provider (including fraud risk management);
  • tax providers;
  • order management systems;
  • CRM-systems;
  • address verification systems;
  • recommendation providers;
  • analytics systems etc.

Implementation of most integrations is based on reusable code (integrational cartridges) which has to be modified according to specific client’s needs. But quite often large-scale clients and complex e-commerce solutions (working on dozens of markets in different regions of the world, the volume of orders) require additional functionality outside the standard integration framework. In such cases, it is needed to write a lot of custom functionality elaborating all the interfaces.

1.3. Demo store

SFCC, like most other e-commerce platforms, has its demo store where, actually, project development begins. SFCC demo store includes:

  • homepage;
  • product categories;
  • advertising banners;
  • store locator;
  • promotions;
  • checkout;
  • profile page etc.

Development of e-commerce solutions begins with customization of the suggested demo store. SFCC platform is usually used for creating b2c projects, but sometimes there are orders for b2b-, b2b2c-, or even d2c-segments. My latest project on SFCC is development of a b2b solution for a global pharmaceutical company with market presence and sales all over the world. After almost a year of work and extensive customization according to client’s needs, there is hardly anything left from the standard demo store. But it is rather an exception. Needless to say that greater deviation from the given template requires greater efficiency and work from both developers and the whole project team (business-analysts, UX and UI designers, etc.).

To give you a general idea of the market size of clients using SFCC, I can provide an actual example from a project I have worked on. Thus, in less than a year after launching the b2b solution created by us, the client sold products amounting to $2.8 billion. It’s 33% more compared to the turnover based on the previous solution.

1.4. Business manager

For project administration, the platform provides a kind of an admin panel – Business Manager, where you can manage various website aspects. There is also a section directly related to selling goods or services: product catalogs, price books, inventory, content, etc.

And there is a section which is only related to development: jobs, web-services, etc.

Business Manager provides means for creating replications, backups on schedule. At the same time, an administrator can create other users, roles, and give access to certain parts of Business Manager.

What is under the hood of the SFCC platform?

B2C Commerce JavaScript (Demandware Script) is used on the server side. It is Rhino JavaScript which includes ECMAScript 5, Mozilla extensions up to JavaScript 1.8, and E4X. The server code is organized with the help of CommonJS-compatible B2C Commerce script modules. In addition, SFCC provides API for working with the platform:

B2C Commerce API includes B2C Commerce Script API and B2C Commerce Pipelets API (legacy). B2C Commerce Script API provides a prearranged structure of classes for working with the platform and implementation of standard e-commerce flow. There are classes for working with the basket, orders, users, etc. SFCC doesn’t give direct access to DB. DB can be accessed only through SFCC API. The developer doesn’t need to design BD, table relationships, etc. The platform has already done it for you. It is possible to extend existing system objects and add new customized ones if necessary.

Following is the example of extending system object type ‘Basket’ with a new custom attribute:

In order to get the current basket through B2C Commerce Script API you only need to write:

var BasketMgr = require('dw/order/BasketMgr');
var basket = BasketMgr.getCurrentBasket();

Open Commerce API (OCAPI) is RESTful API, which consists of 3 parts:

  1. Shop API (see. Shop API resources and Shop API documents) gives access to Commerce Cloud Digital storefront functionality. It means that for making purchases API basically gives access to products, basket, creating an order, etc.
  2. Data API (see. Data API resources and Data API documents) gives access to Commerce Cloud Digital configuration and integration functionality of a certain project.
  3. Meta API, (see. Meta API) gives access to resource description and documents available in Open Commerce API

In the current version of demo site SFRA server JavaScript is organized similarly to Express Node.js framework. E.g. following is a part of controller “SomeController.js” where we add processing of GET request for endpoint “SomeController-SomeEndpointAction”

var server = require('server');

    function (req, res, next) {
        var someResult = {};


On the client’s side in the current version of demo site SFRA JavaScript isn’t organized in the best way. Architecture for client’s JS doesn’t exist as such. It is even embarrassing to show this code to someone. That is why developers who work on customization of this site invent their own wheels (microframeworks) for organizing client JS. At present Salesforce is working on standardization of the approach to client JS organization, and for this, strangely enough, they want to use Lightning Component Framework. This framework is already widely used by Salesforce in other fields.

Before SFRA appeared there had been several other fundamentally-different demo sites. The oldest one was implemented on so-called pipelines. Development using pipelines is a kind of visual programming. Here is an example:

I haven’t met a developer who likes working with pipelines. That is why SFCC gradually arrived at the decision to refrain from using them and made demo site SFRA which is a bit similar to Node.js in terms of architecture. I can definitely say that every new version of SFCC demo site becomes better than the previous one.

Currently, Salesforce is actively working on developing Headless Commerce, which sounds promising.

In Headless there is complete separation between server logic and the view part so that backend simply gives API which is hosted separately (on another domain) and doesn’t have default frontend implementation. Term “head” means frontend, which is closely (integrally) connected to the backend. There are many variations of the view part (from a mobile app to a fully-featured website). These frontend implementations are hosted separately from API. For those developing frontend using this backend API looks like work with 3-rd party integration. Headless Commerce provides API for working with products, catalogs, baskets, inventory, price books, etc. Different implementations of the view part use the same server API. Thus, for adding one more frontend implementation you don’t need to rewrite the backend. You can find more information about Headless Commerce in the article at this link.

How has COVID-19  affected the SFCC platform?

Since the global lockdown started the world has gone online and the Internet has become a lifesaver for many businesses. Thus, according to Salesforce’s Q1 Shopping Index in April this year the number of unique customers almost doubled (rose by 40%) compared to the previous year. Income of BOPISs – (buy online, pick-up in store) increased by 27% in the first quarter. Purchasing methods and formats began to change. In July Salesforce published the Shopping Index of the second quarter, according to which the number of online customers was persistently high despite the fact that many brick-and-mortar (offline) stores opened. The company expects that e-commerce will keep growing even when all offline stores open and the pandemic begins its downturn.

So, e-commerce is growing, requirements for e-commerce stores are getting higher from both business’ and consumers’ sides. Demand for good quality and reliable e-commerce solutions (online stores, apps) is also increasing. Taking into account Salesforce’s large scale, big service package for business, and constant expansion of service range, SFCC developers have a lot of work to do. Various industries have suffered during the pandemic (tourism, transport sector, etc) but online commerce has reached its peak.

How to begin working with SFCC?

For a relatively easy start with SFCC it is enough to:

  • know Javascript;
  • have some backend experience in any programming language;
  • be familiar with web store development (have experience in payment systems integration etc.).

And even if you don’t have the experience mentioned above, you can follow development programs or specialized courses to learn the basics of JS. For instance, our company sometimes organizes JS Boot Camps. Upon successful completion of such a program, you can become a Trainee SFCC developer. At present, there aren’t many good SFCC developers and with further e-commerce global development, there is a permanent lack of such professionals. That is why companies are ready to invest a lot of effort into training SFCC specialists from scratch. Companies usually give a lot of time (up to a few months) for a newbie to onboard and familiarize with the platform and only after that give operational tasks.

Do you want to become part of our team?

Check our open vacancies
Share via:

By continuing to use this website, you consent to the use of cookies in accordance with our Cookie Policy.