Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 28 ยท First Steps

What Is Salesforce B2C Commerce?

Learn what Salesforce B2C Commerce (SFCC) is, how SFRA and the headless PWA Kit differ, and how instances, realms, sites and Business Manager fit together.

Salesforce B2C Commerce, still widely called Salesforce Commerce Cloud or SFCC (and earlier Demandware), is a hosted e-commerce platform. Salesforce runs the servers, the database, the page cache and the CDN. You do not install it. You get an account, you get one or more environments, and you extend the shop by uploading code and importing configuration.

This track teaches you to be a developer on that platform: how code is organized, how a request travels through it, how data is modeled, and how to extend, test and ship safely. This first lesson gives you the map. Names such as realm, instance, cartridge and Business Manager appear in every job description, so it pays to get them straight now.

Nothing from the platform can run on this site, because B2C Commerce is a closed, hosted service. Real platform code is shown in read-only blocks. The runnable examples are small JavaScript stand-ins that model an idea (for example the instance hierarchy) so you can experiment. We say which is which in every lesson.

What the platform gives you

B2C Commerce is a platform, not a framework you host. That has consequences:

  • Hosted and managed. Salesforce handles scaling, patching and the infrastructure. In return you work inside its rules: a fixed server-side runtime, execution quotas, and a defined deployment process.
  • Server-side JavaScript. Storefront logic is written in JavaScript that runs on the platform (an older, Rhino-style engine rather than Node.js, which The Script API and Common Classes covers). There is no PHP, no Composer, and no npm packages at runtime.
  • Configuration lives in Business Manager. Catalog, prices, promotions, content, jobs, services and site preferences are edited in a web admin called Business Manager, and moved between environments by import/export and replication.
  • Everything is multi-site. One environment can host several storefronts (sites) with different catalogs, currencies, locales and domains.

If you know a system like Magento or WooCommerce, the biggest mental shift is that you never touch the server. Your unit of deployment is a code version (a folder of cartridges you upload), and your unit of data is what the platform stores for you.

Three ways to build a storefront

There are three storefront approaches you will hear about.

Approach What it is Status
SiteGenesis The original reference storefront built on XML pipelines and ISML templates Legacy, kept for old projects
SFRA Storefront Reference Architecture: JavaScript controllers, models and ISML templates The main server-rendered approach
PWA Kit A React-based headless storefront using the Shopper APIs, hosted on Managed Runtime The composable, headless approach

SFRA renders HTML on the platform. A request hits a controller, the controller prepares data, and an ISML template turns it into HTML. Most of this track is about SFRA, because it is where the platform's concepts are easiest to see: cartridges, controllers, models and ISML.

PWA Kit is headless. The storefront is a React application that calls the platform through APIs (see OCAPI and SCAPI) and runs on a separate hosting service. You still use Business Manager, the catalog and the order system, but you do not write controllers or ISML for the storefront itself. Headless Storefronts with PWA Kit compares the two properly.

flowchart LR
    B["Browser"] --> S["SFRA storefront<br/>(controllers + ISML)"]
    B --> P["PWA Kit app<br/>(React, Managed Runtime)"]
    S --> C["B2C Commerce platform<br/>(catalog, baskets, orders)"]
    P -->|"Shopper APIs"| C
    BM["Business Manager"] --> C

Both storefronts sit on the same commerce platform and the same Business Manager data.

Instances, realms and groups

An instance is one running copy of B2C Commerce with its own code, data and Business Manager. The instances your company owns live inside a realm, which is the account-level container identified by a short realm ID.

The classic layout has two groups:

  • Primary instance group (PIG): production, staging and development. Production serves customers. Staging is where you load and test catalog and configuration before it goes live. Development is a shared integration environment.
  • Secondary instance group: sandboxes. These are disposable instances for individual developers, and on-demand sandboxes can be created and deleted when you need them.

Data and code move differently. Code moves as uploaded code versions, and one version is active per instance. Catalog and configuration are typically prepared on staging and replicated to production. Orders and customers belong to production and are not replicated back down, which is why you test with fake data elsewhere.

flowchart TD
    R["Realm (abcd)"] --> PIG["Primary instance group"]
    R --> SIG["Secondary group"]
    PIG --> PRD["Production"]
    PIG --> STG["Staging"]
    PIG --> DEV["Development"]
    SIG --> SB1["Sandbox: Anna"]
    SIG --> SB2["Sandbox: Ben"]
    STG -->|"data and code replication"| PRD

One realm contains the production group and any number of developer sandboxes.

JS A realm, its instances and code versions

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Sites, catalogs and Business Manager

Inside an instance, a site is one storefront: it has an ID (for example RefArch), its own locales, currencies, domain, cartridge path and preferences. A global brand might run UK, DE and US sites on one instance and share most of the catalog between them.

Data comes in two scopes, and confusing them is a classic beginner mistake:

  • Organization-level (shared by every site in the instance): product catalogs, price books, customer lists, the shared content library, inventory lists, and many system settings.
  • Site-level: site preferences, site-specific content, promotions, orders, and the site catalog that decides which categories a site shows.

A product catalog holds products and their attributes. A site catalog is a navigation tree of categories, and the products "assigned" to those categories are what a shopper sees on that site. One product catalog can feed several site catalogs.

JS Which products does a site show?

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Business Manager is the web admin at your instance's hostname under /on/demandware.store/Sites-Site. You use it to manage catalogs, prices, promotions, content, search settings, jobs, services and users. Developers use it too: to set the cartridge path for a site, activate a code version, read logs, and import metadata. A good developer knows which settings are configuration (change them in Business Manager and move them by import) and which are code (change them in version control).

What runs where

Keep this picture in your head when you debug:

  1. The browser sends a request to a site's domain, which usually passes through a CDN and the platform's page cache.
  2. On a cache miss, the platform runs your active code version: a controller, its models, and an ISML template, using the Script API to read the catalog, baskets and customers.
  3. Third-party systems (payment, tax, search, ERP) are called from your code through the service framework, or the other way around through APIs and jobs.
  4. Jobs run on the platform on a schedule, for imports, exports and cleanup.

Money and order rules are not specific to Salesforce. For payments, order states and idempotency, see Order Lifecycle and Payments Overview; this track focuses on how the platform implements them.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is a realm in B2C Commerce?

    A realm groups all instances of a customer. Sites live inside instances, not the other way around.
  2. 2. Which statement about SFRA and PWA Kit is correct?

    Both use the same commerce platform and data. They differ in where the storefront code runs and how it gets data.
  3. 3. How does your code reach production?

    There is no server access. Code is uploaded as a version and one version is active per instance.
  4. 4. Which data is organization-level, shared across sites in an instance?

    Product catalogs and price books are shared. Site preferences, orders and the cartridge path are per site.

Summary

  • B2C Commerce is a hosted platform: you deploy code versions and import configuration, you never manage servers.
  • SFRA renders pages with controllers and ISML; PWA Kit is a headless React storefront on the same platform.
  • A realm contains instances (production, staging, development, sandboxes); a site is one storefront inside an instance.
  • Product catalogs and price books are shared; site catalogs, preferences and orders are per site.
  • Business Manager is where you configure, import data, set the cartridge path and activate code.

Next: Setting Up Your Development Environment