How to Integrate MongoDB with Salesforce

How to Integrate MongoDB with Salesforce

NoSQL is here guys and it is here to stay. For those who are wondering what has NoSQL got to do with Salesforce, here is a helpful clue- Salesforce Analytics Cloud, which was released this October at Dreamforce 2014 conference, utilizes a Key-value-store based NoSQL database for its actions. Yep, as we said in our previous post, NoSQL has penetrated everywhere. This speculation is confirmed by the fact that this year itself, we have seen at least 35% rise of NoSQL database integration requests with Salesforce, the most popular being MongoDB and Salesforce integration requests.

If you checkout the MongoDB website you will find that Salesforce.com is one of the top listed major investors. A lot of enterprises are looking to MongoDB as solid way to store a lot of data. First of all, unlike a traditional relational database, it does not require a schema to be set up. It also stores data in BSON format (Binary JSON), which is the language of web data. For this and several reasons MongoDB has been an increasingly common choice in companies.

Not anything like your ordinary Database

Now before we start about MongoDB Salesforce integration, I would like to point out that MongoDB is not like your ordinary database. It may seem a little similar to SQL but in reality it is much different. It has its own set of languages to handle data requests and a whole API to manage database. Playing with MongoDB means that you are not playing with CSV files, SQL files, or even excel files, instead you are playing with JSON (JavaScript Object Notation) database files which are in themselves not as popular as SQL yet.

There is still no standard NoSQL query language. In fact, there just cannot be because there are so many types of NoSQL database each coming with their own advantages and disadvantages. So for every NoSQL database solution you probably need a unique API solution to integrate it with Salesforce. What that means is that unlike SQL and CSV database files NoSQL database does not have one work-for-all click and play dataloaders. Though there are dedicated data migration services that can help you in that.

But most of the MongoDB to Salesforce integration stuff is about making custom REST API solutions to access mongoDB JSON files, and push, pull, or delete data from Salesforce databases.

Integrating MongoDB with Salesforce

MongoDB is a very versatile database system. It’s surprisingly simple to manage yet this simplicity defines the type of integration solution you are going to make. And ‘Make’ is the keyword here, unfortunately every integration project will require some coding to make it possible, no matter the solution.

The steps for integration are as follows:
Step 1: Authentication
This step involves authenticating yourself for accessing MongoDB databases, and also Salesforce databases, if you are planning a migration that is. Yes, pretty basic stuff.
Step 2: Using MongoDB API for accessing data

MongoDB uses its own ‘Database format’, BSON, which is a modified form of JSON. Though database format is not strictly an accurate term for BSON but for simplicity we can use the same as long as it serves the purpose.

MongoDB has its own set of APIs to access its BSON data. For accessing the databases you would basically need a JavaScript program that can use MongoDB BSON HTTP interfaces to pull and if required, push and delete data collections, or documents, or data etc. As said it is a custom program, hence no plug-and-play solution.

Step 3: REST API solution for accessing salesforce
Now once you have retrieved the MongoDB data, you will have to create you own REST API solution to push that data into Salesforce interface or Salesforce database.

Automation vs Using dataloader

Now if your database can be converted into traditional database formats, it’s is easier to just convert your mongoDB data to CSV files(or any other) and then use a dataloader to migrate data from CSV to Salesforce. But a single solution to directly push MongoDB data to salesforce is very easy to convert to an automated solution. When you include Dataloaders into equation, automation becomes very difficult.

Data Migration solutions

There are a number of paid data migration solutions that can be used for Salesforce integration with MongoDB. Here are the three most popular apps dedicated to Salesforce to MongoDB integration

 

It’s a developing field

Integrating MongoDB with Salesforce will differ, and differ greatly depending upon the type of database you have built using MongoDB. For example if you are storing documents using MongoDB, you may have to use a different REST API solution that the one that just pushes data into Salesforce. This is the main reason why there is no Dataloader till now, but it will change as more and more companies will shift to NoSQL database. It’s already happening. But for now you will have to do with Custom solutions.

Hiring professional services for the Salesforce and MongoDB integration is highly recommended because it is not just about integrating, but taking the best approach by studying closely your own business setup and your requirements and objectives of integration. We here at Algoworks have developed a number of custom MongoDB to Salesforce integration services for our clients and will be glad to help you in your project. You may consider getting in touch with us for free salesforce consulting to begin with.

The following two tabs change content below.
Pratyush Kumar

Pratyush Kumar

Co-Founder & President at Algoworks, Open-Source | Salesforce | ECM
Pratyush is Co-Founder and President at Algoworks. He is responsible for managing, growing open source technologies team and has spearheaded more than 200 projects in Salesforce CRM alone. He provides consulting and advisory to clients looking for services relating to CRM(Customer Relationship Management) and ECM(Enterprise Content Management). In the past, Pratyush has held consulting roles with various global technology leaders, such as Globallogic & HCL in India. He holds an Engineering graduate degree from Indian Institute of Technology, Roorkee.
Pratyush Kumar

Latest posts by Pratyush Kumar (see all)

Pratyush KumarHow to Integrate MongoDB with Salesforce