Salesforce Integration With External Systems

Salesforce Integration

Salesforce Integration With External Systems

In this post, we will discuss Salesforce Integration and various methods for integrating the Salesforce System with external systems. This Salesforce integration guide will assist you in comprehending Salesforce integration Patterns and Best Practises. Let us first define Salesforce Integration. and enrol in our Salesforce Integration Crash Course.
Let's get started with our Salesforce Integration Tutorial, which will cover all of the fundamentals of Salesforce Integration.

Curriculum

  1. What is Salesforce Integration?
  2. Why Integration
  3. Basic Integration Architecture
    • Point to Point
    • Hub and Spoke
    • Enterprise Service Bus (ESB)
  4. Salesforce Integration Direction
  5. Salesforce Integration Levels
    • What is DMZ network in Integration Levels
  6. Time-Based Integration Processes
    • Synchronous Process
    • Asynchronous Process
    • Batch Process
  7. The Inception of API
    • The Evolution of API
    • SOAP
    • REST
    • GraphQL
    • gRPC
  8. Difference between SOAP vs REST
  9. What all Integration options are available in Salesforce?
  10. What is REST API?
    • Learn the basic of REST API
    • Key points to consider for the REST APIs
  11. Apex REST API
  12. SOAP API
    • What is the difference between SOAP and REST?
    • What is WSDL?
  13. What is the difference between Enterprise WSDL and Partner WSDL?
  14. Apex SOAP API
  15. Connect REST API
  16. Analytics REST API
  17. User Interface API
  18. Tooling API
  19. Bulk API
  20. Metadata API
  21. Streaming API
  22. Tools for Event-Driven Architecture with Salesforce
    • Push Topic
    • Generic Streaming Events
    • Change Data Capture
    • Platform Event
  23. Ways to Fetch data from SFDC
  24. Data Integration with Salesforce
  25. Salesforce Integration Patterns
  26. Enterprise Salesforce integration
  27. Why Middleware in Enterprise Context
  28. Related Post
  29. Summary
    • Share this:
    • Related

What is Salesforce Integration?

Salesforce Integration is a process of connecting two or more applications. Enterprise system uses many applications, many or most of which are not designed to work with one another out of the box. Each application can have data, business logic, presentation, and security layers, all of which are possible targets for integration.

Why Integration

Salesforce can’t be the source of everything. It can be CRM or any Custom application. However, SAP can own Order Management or Inventory, an External system for sending email, Other System for Payment, and External Fleet Management, And possibilities are high that Salesforce would need to exchange data with these systems.

Basic Integration Architecture

Let’s understand the Integration Architecture first. While doing integration we have a different way to integrate the system using point-to-point, hub & spoke, and ESB. All of them have their own benefit. Let’s understand it in detail.

1. Point to Point

Each system is connected to every other system through direct integration.

Easy to implement with only a few systems.

Difficult to scale

2. Hub and Spoke

  • Every system connects to the Hub.
  • All data transfer is done through the hub.
  • Easy to design and implement.
  • Architectures are proprietary in nature.
  • Single point of failure.
  • Inability to support large transaction volumes

3. Enterprise Service Bus (ESB)

  • Distributed services architecture.
  • Employs distributed adapters.
  • Highly scalable.

Salesforce Integration Direction

Integration can be two direction inbound integration or outbound Integration.

  • Inbound Integration: Inbound: An external system initiates contact with Salesforce.
  • Outbound Integration: Outbound: Salesforce initiates contact with an external system.
Outbound Inbound
  • Authentication
  • Remote site settings
  • Named Credentials
  • API - REST/SOAP
  • JSON/XML(WSDL)
  • Apex/Configuration
  • Push/Pull
  • Salesforce is Consumer
  • Authentication
  • Connected App
  • Credentials
  • API - REST/SOAP
  • JSON/XML(WSDL)
  • Apex/Configuration
  • Push/Pull
  • Salesforce is Subscriber

Salesforce Integration Levels

  1. Unser Interface: Display information from external system in Salesforce Application.
  2. Application Logic: Leverage interfaces, such as APIs ,to allow interaction with external data and business processes.
  3. Data: Extract, Transform and Load data between data stores.

What is DMZ network in Integration Levels

A DMZ Network is a perimeter network that protects and adds an extra layer of security to an organization’s internal local-area network from untrusted traffic. A common DMZ is a subnetwork that sits between the public internet and private networks.

Time-Based Integration Processes

Salesforce integration can be Synchronous, Asynchronous, and a Batch process. Let see when to use which time-based Salesforce Integration processes.

1. Synchronous Process

A user action creates a request, and the user is blocked from continuing until the response is returned. A very near real-time response is expected and needed.

  • Tools/Technique : REST or SOAP API

Scenario: When a Salesforce account is created, a lookup must happen in the existing legacy system to check whether the Salesforce account already exists or not before the Save is completed.

2. Asynchronous Process

A user action creates a request, and the system does not wait for the response before letting the user move to the next task. Analogous to near real-time process

  • Tools/Technique : MQ ,Kafka

Scenario: When the user changes an account record, the process of replicating the change to external systems begins immediately. However, the process of replication does not block the user from continuing the work.

3. Batch Process

Large data volumes are broken into chunks and processed in queues based on available resources. Can be implemented through Bulk API,SOAP/REST API. Often associated with a scheduled process.

  • Tools/Technique: Bulk API/ETL/File Transfer

Scenario: When we need to update account information once in a day to a back-end system.

The Inception of API

API stands for Application Programming Interface. It is a set of definitions and protocols for building and integrating application software. API enables integration with heterogeneous systems and data to bring new business models, products, and services to the forefront.

The Evolution of API

1. SOAP

Simple Object Access Protocol (SOAP) is a protocol for exchanging information encoded in Extensible Markup Language (XML) between a client and a procedure or service that resides on the Internet.

2. REST

REST is an acronym for Representational State Transfer. The basic premise is that developers use the standard HTTP methods, GET, POST, PUT and DELETE, to query and mutate resources represented by URIs on the Internet. REST APIs are designed to make server-side data readily available by representing it in simple formats such as JSON and XML.

3. GraphQL

GraphQL was developed in response to REST APIs, with the idea that you could execute precise syntax that retrieves only what is needed, lightening the payload and simplifying the process significantly. The API can accept specific requests and return a result that matches exactly what the user is looking for.

4. gRPC

In gRPC, RPC stands for Remote Procedure Call and refers to something that can execute a function housed elsewhere but in a different context. A user on one side will select a remote procedure to execute, serialize the necessary parameters and then append any additional information into the message. This will then be sent to the server, which interacts with the other application, decoding the message and executing the operation. A result then comes back to the initial user.

Difference between SOAP vs REST

Web Services API / SOAP REST
Meaning/Uses Simple Object Access Protocol, uses WSDL Representational State Transfer, native use of all HTTP methods
Design Standardized protocol with pre-defined rules to follow.Architectural style with loose guidelines and recommendations.
ApproachFunction-driven (data available as services, e.g.: “getUser”) Data-driven (data available as resources, e.g. “user”).
StatefulnessStateless by default, but it’s possible to make a SOAP API stateful. Stateless (no server-side sessions)
CachingAPI calls cannot be cached.API calls can be cached.
SecurityWS-Security with SSL support. Built-in ACID compliance.Supports HTTPS and SSL
PerformanceRequires more bandwidth and computing power. Requires fewer resources.
Message formatOnly XML.Plain text, HTML, XML, JSON, YAML, and others.
Transfer protocol(s)HTTP, SMTP, UDP, and others. Only HTTP
Recommended for Enterprise apps, high-security apps, distributed environment, financial services, payment gateways, telecommunication services. Public APIs for web services, mobile services, social networks.
Advantages High security, standardized, extensibility. Scalability, better performance, browser-friendliness, flexibility.
Disadvantages Poorer performance, more complexity, less flexibility.Less security, not suitable for distributed environments.
Error Handling SOAP response will contain error information.Custom since there is no built-in.

What all Integration options are available in Salesforce?

There are lots of Integration options available in Salesforce. Here is Salesforce Integration Cheatsheet.

S.NoAPI NameProtocolData FormatCommunication
1REST APIRESTJSON, XMLSynchronous
2Apex REST APIRESTJSON, XML, CustomSynchronous
3SOAP APISOAP (WSDL)XMLSynchronous
4Apex SOAP APISOAP (WSDL)XMLSynchronous
5Chatter REST APIRESTJSON, XMLSynchronous (photos are processed asynchronously)
6Analytics REST APIRESTJSON, XMLSynchronous
7User Interface APIRESTJSONSynchronous
8Tooling APIREST or SOAP (WSDL)JSON, XML, CustomSynchronous
9Bulk APIRESTCSVAsynchronous
10Metadata APISOAP (WSDL)XMLAsynchronous. Retrieve, deploy, and modify metadata
11Streaming APIBayeuxJSONAsynchronous. Push notifications from Salesforce to
subscribing applications/entities
(replaces polling).

Let see different option available in Salesforce and when to use which Salesforce API for Integration.

What is REST API?

The Salesforce REST API lets you integrate with Salesforce applications using simple HTTP methods, in either JSON or XML formats, making this an ideal API for developing mobile applications or external clients. Salesforce also supports Apex REST, which lets you create Web services on Force.com using Apex.

  • Representational State Transfer is a style of software architecture for distributed hypermedia systems.
  • REST API has a lightweight request and response framework
  • Simple, easy to use and powerful web service based on RESTful principles.
  • Expose functionality via REST resources and HTTP methods.
  • (CRUD) records, search or query your data, retrieve object metadata, and access information about limits in your org.
  • REST API supports both XML and JSON.
  • Mobile and Web apps
  • Rest resource is referenced using URI, abstraction of information, access using HTTP methods

Learn the basic of REST API

Key points to consider for the REST APIs

  1. Authentication And Authorization
  2. Compression
  3. Caching Behvior
  4. Cross-Origin Resource Sharing
  5. Composite Resources
  6. Multipart Message for Blog data
  7. Status Codes and Error Response.

Apex REST API

You can use Apex REST API when out of the box REST API will not be able to fulfill your business requirement. For that, you can create your Apex REST API and expose it to an external system.

Here is some key consideration for APEX REST API.

Note : Use the Continuation class in Apex to make a long-running request to an external Web service or Chaining Asynchronous Callouts.

Check our>Salesforce Integration Crash Course.

SOAP API

  • Application layer protocol used to exchange structured information between systems
  • It uses a Web Services Description Language (WSDL) file to rigorously define the parameters for accessing data through the API.
  • SOAP API supports XML only.
  • Because SOAP API uses the WSDL file as a formal contract between the API and consumer, it’s great for writing server-to-server integrations.
  • Access to Salesforce data and business logic
  • Handles medium data volumes
  • Updates multiple records with single

What is the difference between SOAP and REST?

Here is the difference between SOAP and REST API.

SOAP APIREST API
Relies on SOAP protocolRelies on REST architecture using HTTP
Transports data in XMLTransports data in JSON or XML
Highly structured/ typedLess structured? Less bulky data
Handles large data loadsWorks well with JavaScript
Designed with large enterprise application in mindDesigned with mobile devices in mind

What is WSDL?

WSDL (Web Services Description Language) is an XML document that describes a web service. There are two types of WSDL in  Salesforce:

  • Enterprise WSDL
  • Partner WSDL

What is the difference between Enterprise WSDL and Partner WSDL?

Here is difference between Enterprise WDSL and Partner WDSL.

Enterprise WDSLPartner WSDL
Strongly TypedLoosely Typed
Tied to a specific configuration of SalesforceUseful for any configuration of Salesforce
Changes if custom field or custom objects are added to your organizationDoes not changes if custom field or custom objects are added to an organization’ Salesforce configuration

Apex SOAP API

Same as Apex REST API. You can Expose APEX SOAP API to an external system. Apex SOAP API supports both authentication OAuth 2.0 and Session ID.

Connect REST API

Connect REST API provides programmatic access to B2B Commerce, CMS managed content, Experience Cloud sites, files, notifications, topics, and more. Use Connect REST API to display Chatter feeds, users, and groups, especially in mobile applications.

Analytics REST API

You can access CRM Analytics features such as datasets, dashboards, and lenses programmatically using the CRM Analytics REST API.

User Interface API

Build Salesforce UI for native mobile apps and custom web apps using the same API that Salesforce uses to build for the web and Salesforce for Android, iOS, and mobile web. Build user interfaces that let users work with records, list views, actions, favorites, and more.

Tooling API

Tooling API exposes metadata used in developer tooling that you can access through REST or SOAP. You can use Tooling API to build custom development tools or apps for Platform applications.

Bulk API

Bulk API is a specialized RESTful API for loading and querying lots of data at once. By lots, we mean 50,000 records or more. Bulk API is asynchronous, meaning that you can submit a request and come back later for the results. This approach is the preferred one when dealing with large amounts of data. There are two versions of Bulk API (1.0 and 2.0). Both versions handle large amounts of data, but we use Bulk API 2.0 in this module because it’s a bit easier to use

Metadata API

The main purpose of Metadata API is to move metadata between Salesforce orgs during the development process. Use Metadata API to deploy, retrieve, create, update, or delete customization information, such as custom object definitions and page layouts.

Streaming API

It enables the transmission of real-time data from the Salesforce Platform. Data is transmitted using Push Technology. Push Technology transfers information that is initiated from a server to the client. You can use one of the subscription mechanisms such as CometD, and Subscription API in node js or in Mulesoft. Push Technology is also called the publish/subscribe Model

  1. Push Topic: Stream Salesforce changes based on SOQL
  2. Generic Streaming Events: publish Arbitrary String value
  3. Change Data Capture: New Version of Push Topic. No to SOQL
  4. Platform Event: new Version of Generic Streaming.

1. Tools for Event-Driven Architecture with Salesforce

2. Push Topic

Push Topic enables to stream Salesforce record changes to clients based on criteria you define in
a SOQL query in a PushTopic record

Learn more about PushTopic Events in Salesforce.

3. Generic Streaming Events

Generic Streaming events enable you to publish event messages with an arbitrary string value that the client receives.

4. Change Data Capture

Change Data Capture is a streaming product on the Lightning Platform that enables you to efficiently integrate your Salesforce data with external systems. Change data capture is also called CDC. With Change Data Capture, you can receive changes in Salesforce records in real time and synchronize corresponding records in an external data store.

Check when and how to use change data Capture here.

5 Platform Event

Platform Event is based on Event-Driven Architecture which enables apps to communicate inside and outside of Salesforce. Platform events are based on the publish/subscribe model and work directly with a message bus that handles the queue of incoming events and processes listening for them. This is built in real-time integration patterns in the Salesforce Platform which helps to reduce point-to-point integration.

Learn more about Platform Events in Salesforce.

Ways to Fetch data from SFDC

There are different way to fetch data from Salesforce.

  1. Change Data Capture
  2. Outbound Messaging
  3. Apex Custom Code
  4. Polling
  5. Data Export
  6. Salesforce Connector
  7. Heroku Connect

Data Integration with Salesforce

There are different way and option are available for Data Integration with Salesforce.

  1. Salesforce to External Systems
  2. External Systems to Salesforce
  3. Salesforce to Salesforce

Salesforce Integration Patterns

There are different Integration patters like request and reply/response, Fire and forget, Batch Data Synchronization, Remote Call In, and Data Virtualization.

In Salesforce we have below Integration patterns.

  1. Remote Process Invocation—Request and Reply: Salesforce invokes a process on a remote system, waits for the completion of that process, and then tracks the state based on the response from the remote system.
  2. Remote Process Invocation—Fire and Forget: Salesforce invokes a process in a remote system but doesn’t wait for the completion of the process. Instead, the remote process receives and acknowledges the request and then hands off control back to Salesforce.
  3. Batch Data Synchronization: Data stored in Lightning Platform is created or refreshed to reflect updates from an external system, and when changes from Lightning Platform are sent to an external system. Updates in either direction are done in a batch manner.
  4. Remote Call-In: Data stored in Lightning Platform is created, retrieved, updated, or deleted by a remote system.
  5. UI Update Based on Data Changes: The Salesforce user interface must be automatically updated as a result of changes to Salesforce data.
  6. Data Virtualization: Salesforce accesses external data in real-time. This removes the need to persist data in Salesforce and then reconcile the data between Salesforce and the external system.

Learn about Salesforce integration Patterns and Integration Best Practices.

Enterprise Salesforce integration

Why Middleware in Enterprise Context

Here are 6 Fundamental Principles for Middleware in Enterprise Context:

  1. Transnationality: While Salesforce is transactional within itself, it’s not able to participate in distributed transactions or transactions initiated outside of Salesforce.
  2. Event handling: Event handling In Salesforce integrations using middleware, the control of event handling is assumed by the middleware layer.
  3. Queuing and buffering: Queuing and buffering generally rely on asynchronous message passing, as opposed to a request-response architecture.
  4. Extract, transform, and load: Extracting data from the source systems. This typically involves data from several source systems, and both relational and non-relational structures.
  5. Translation and transformation: Transformation is the ability to map one data format to another to ensure interoperability between the various systems being integrated. Typically, this entails reformatting messages enroute to match the requirements of the sender or recipient.
  6. Mediation routing: Many middleware-based solutions depend on a message queue system. While some implementations permit routing logic to be provided by the messaging layer itself, others depend on client applications to provide routing information or allow for a mix of both paradigms.

Learn more about>Enterprise Integration.

Summary

Before integrating anything with Salesforce, as per Architect, it is necessary which system components are important for security and may impact with integration pattern to be used. I hope this Salesforce integration guide helped you to understand the Salesforce Integration Options.

Post a Comment

0Comments
Post a Comment (0)