S4S with M4S

M4S is a module that works with S4S and sits between Sitecore and Salesforce. M4S and its associated M4S database improves transaction speed, allows the volume of calls to Salesforce to be controlled, and ensures key Salesforce data, like login credentials, is available to Sitecore, even if Salesforce is not. 



M4S replicates Salesforce records in an out-of-the-cloud MongoDB database. Used with S4S, it can act as a highly configurable super-cache.

When S4S is used to push data to Salesforce, M4S simultaneously replicates the data in the M4S database. If Salesforce is unavailable, the data in the M4S database is flagged for sync when Salesforce returns. Data pulled from Salesforce to Sitecore with S4S is sourced from the M4S database so no Salesforce API calls are consumed.

To keep the systems in sync, a Sitecore scheduled task updates the M4S database with recent changes in Salesforce (based on date/time stamps) and, in the other direction, updates Salesforce with any flagged changes in the M4S database. Because pushes to Salesforce are bulkified by S4S, the overall API count is significantly reduced.


Why would I need S4S and M4S?

In almost every case, you will not need M4S but if you have critical concerns about the following then M4S is ideal: 

  • Number of API calls to Salesforce
    • Daily API count needs to be reduced 
    • API count needs to be reduced on days when the website has very high traffic volumes  
  • Business continuance when Salesforce is unavailable
    • Continue to collect web form data e.g. lead submissions from WFFM or a custom web form 
    • Still allow website visitors to log in to Sitecore if Salesforce is offline (if the S4S Security Connector is used)
    • Show Salesforce records in the M4S Sitecore Launchpad application if Salesforce is offline
    • Show Salesforce data normally viewable in Sitecore web pages if Salesforce is offline
  • Transaction speed to and from Salesforce
    • Cloud latency needs to be reduced
    • Large documents or binary files are slowing processing
    • Push, pull record data volumes are large and take too much time
    • Visitors authenticating into Sitecore with credentials in Salesforce require a faster login (if the S4S Security Connector is used)
  • Controlling the API Count in Peak Periods
    • On peak days the API count needs to be reduced. On other days, transact directly with Salesforce


Is M4S a backup and restore solution for Salesforce?

The answer is yes, and no. M4S is an excellent backup solution but has constraints around restore. M4S stores Salesforce object fields, including the Salesforce relationship data with other objects, but M4S does not have mechanisms to connect them together. This means all new records created in the M4S database will be unrelated. If a relationship is required, this needs to be created in Salesforce.

What M4S can do!

Users with access to the Sitecore Launchpad can log in and view Salesforce records in M4S (those that have been chosen to sync). A record list is visible and the field data is available by clicking into each record. The list is currently read-only. Sitecore access permissions can be granted to allow the Salesforce team to access this data if Salesforce became unavailable.

Records in the M4S database can be created, read, updated or deleted by purpose-built Sitecore functionality and these changes will be reflected in Salesforce when the next sync occurs.

What M4S can't do!

There is no out-of-the-box support for relationship handling. New records created in the M4S database with relationships to other records (like account and contacts) will require the relationship to be created in Salesforce.

M4S Dashboard

The dashboard provides an insight into the M4S database and lets you configure your sync settings. It is also where you go to view Salesforce records if you cannot access Salesforce. You can open the dashboard from the Sitecore Launchpad.


  • MongoDB Database: Location of the M4S database.
  • M4S Cache Provider: ASP.NET database service.
  • Salesforce API Count: Calls to Salesforce in the last 24 hours.

Synchronization Configuration

  • Rows: Salesforce objects selected for sync to the M4S database.
  • Row Details: Sync interval, last sync date, show records in the M4S database and show records in Salesforce.
M4S Dashboard, Sitecore Salesforce Connector

M4S Database Records

The cached records are stored in the M4S database, typically on the same network as the Sitecore server. Because the data store is local to Sitecore it is not impacted by the delays and API constraints of cloud stored data.

M4S Cached Records

  • Rows: Salesforce records in the M4S database that relate to the selected objects.
  • Row Details:
    • Native Salesforce identifier: Click to open in Salesforce.
    • Name property of the object: The generic name in Salesforce.
    • Timestamp: When created or modified in the M4S database.
    • Last Modified SF: When created or last modified in Salesforce.
    • View: Click to see the record fields in the M4S database.
M4S Cached Records

M4S Record Detail

Selecting a record opens a page with a list of Salesforce fields (including custom fields) that relate to the chosen object. The data, stored in the M4S database, and is as up-to-date as the timestamp indicates.

Record Detail

  • Field: Salesforce field name. Field visibility is controlled by the permissions of the Salesforce API user that S4S connects to Salesforce with. 
  • Value: The corresponding value stored in the local M4S database - data is read-only. If the values are changed in Salesforce, they will be updated in the M4S database when the next sync occurs. If the values are changed by Sitecore, typically with S4S, they are updated immediately in the M4S database and simultaneously in Salesforce.
M4S Dashboard

M4S in the Real World

Scenario 1 - High traffic volumes on a Sitecore website
  • An education provider publishes exam results on their Sitecore website. Thousands of students hit the website and log in to get their results. Using the S4S Security Connector, their authentication credentials are held in their Salesforce contact record.
  • A healthcare company sends a newsletter to all its customers. A link in the email directs them to a Sitecore website where they download a brochure sourced in Salesforce.
  • A Sitecore eCommerce website has thousands of products in Salesforce. A nationwide TV promotion drives several million visitors to the website.

Result: In each scenario, Salesforce may be hit with a large number of API calls within a 24 hour period. If the API count is exceeded, Salesforce will close the API for 24 hours, which will adversely impact the website.

Solution: With M4S installed, Sitecore uses the M4S database, so very few Salesforce API calls are consumed (explicit calls can bypass M4S). Independently the scheduler bulk updates Salesforce and then updates the M4S database with any changes in Salesforce.


Scenario 2 - Form submission when Salesforce is not available
  • A finance company advertises a job vacancy on their Sitecore website. Thousands of candidates complete the web application form that creates new Salesforce contacts.
  • An events company promotes a symposium in Houston. Unexpectedly, it is overwhelmed by online applications that create new Salesforce leads.
  • A car manufacturer is forced to recall a model for a headlight issue. A huge number of owners apply, by online form, to create a Salesforce case and book an appointment.

Result: With Salesforce unavailable, these important web form submissions would be lost.

Solution: M4S handles this situation transparently so the website visitor will be unaware of a problem. Under normal circumstances, the form data is pushed to both Salesforce and the M4S database but with Salesforce unavailable, the data is only captured in M4S. When Salesforce comes online, M4S will automatically update Salesforce with the new data.


Scenario 3 - Login when Salesforce is not available
  • The customers of a tech company login to the company website to get special offers. Their login credentials are stored in their Salesforce contact record.  
  • A salesperson logs into a Sitecore portal page to view Salesforce leads. Their login username and password are stored their Salesforce contact record.

Result: With Salesforce unavailable, these website visitors would not be able to log in.

Solution: Again, M4S handles this situation transparently so the website visitor will be unaware of a problem. The login credentials are available in the M4S database so login is possible.


Scenario 4 - Salesforce is remote
  • A law firm in New Zealand has a Sitecore web portal that allows key customers to access privileged information. Customers log in to access this information but experience a login delay because the Salesforce cloud servers are based in Japan.
  • A multinational company collects leads from its Sitecore website. The company has complex lead validation processes that normally require several API calls to Salesforce to determine if the lead already exists or is new. The additional calls make the submission process slower than ideal.

Result: Interactions slower than ideal adversely impact user experience and may cause loss of business.

Solution: The M4S database is adjacent to the Sitecore server so information access is extremely fast. Where multiple calls to Salesforce are required, these occur locally, with only the final updated data pushed to Salesforce during the next synchronization.

Join our next S4S webinar!

See the power of S4S in action.

Registrations are now open for
28 July 2020

  • PDT 12:00 pm - 1:00 pm
  • CDT 2:00 pm - 3:00 pm
  • EDT 3:00 pm - 4:00 pm
  • GMT 8:00 pm - 9:00 pm
  • CEST 9:00 pm - 10:00 pm
  • Contact us for other times

Time in Nelson, New Zealand

Our Saturday is Friday in the US

Compare New Zealand times with:

Ready to join the integration revolution?
Get started and enjoy the benefits sooner