Friday, October 21, 2016

Mulesoft: How to Retrieve Millions of Records From Microsoft Dynamics CRM

This post will provide an overview of how the Mulesoft Microsoft CRM Dynamics connector leverages Microsoft CRM Dynamics API and the ramifications of pulling large data sets via the Mulesoft Connector.

Mulesoft Microsoft Dynamics CRM Connector Overview

The Mulesoft connector supports DataSense Queries, Native Queries (FetchXML), setting the fetch size, and returning specific pages. 
Image title

DataSense or Native Queries

For retrieving large datasets, use the Native Query Language (FetchXML), as Mulesoft will cache metadata by default if you use DataSense queries. This can run your Mulesoft JVM out of memory with even small calls.

Setting the Fetch Size

Controlling the fetch size is important and can impact your performance of requesting data from CRM. When pulling large datasets, it is best to run small performance tests to select the best size, which can range from one to 5,000.

Returning Specific Pages

The Mulesoft Connector also allows you to requests a certain page from CRM. However, our local testing has shown if the page request is over 10,000 records CRM will return an error stating the paging cookie is missing. This may be a bug, and a case has been submitted to Mulesoft for research.

Microsoft Dynamics Details

Microsoft Dynamics can take minutes to return pages of over 1,000 records.

How to Query Microsoft CRM Dynamics for Large Datasets

Option 1: Mulesoft Batch

Image title

Pros

  • All records are stored into the Mulesoft object store queue, so processing can start again if the engine fails.

Cons

  • All records must be pulled down from CRM and loaded into the Mulesoft object store queue. This requires parsing the XML and creating records to be stored, which will flush to disk for large datasets.

Option 2: Asynch Mulesoft Batch

Image title
This option has no difference from Option 1 in how Mulesoft processes the record set from CRM.

Option 3: For Each

Image title

Pros

  • Records will begin to process when a page is returned. This will speed up processing over using the batch since you are skipping the step of writing it to the Mulesoft object store.

Cons

  • Not able to begin processing where left off if the engine fails during processing.
  • The Mulesoft connector will not make the request for the next page until all the records have been processed from the page.

Option 4: Asynch for Each

Image title
This option has the same behavior as Option 3

Option 5: Parallel For Each or Mulesoft Batches

This option will require the fetchXML to have a distinct clause that will not have overlapping records.
Image title

Pros

  • Running multiple requests to CRM this way will limit the time spent waiting for pages to finish processing. 
  • This approach can be done with batch or for each, depending on requirements.

Cons

  • Must understand your data in order to not have overlaps .

Thursday, October 20, 2016

Mulesoft Champions Program Review

Mulesoft Champions Program Review


What is the Mulesoft Champions program?

Mulesoft defines the program as:
The Champions Program is all about you. Grow your skills, get recognized, get rewarded, and network with the top MuleSoft developers and advocates around the world. - https://developer.mulesoft.com/champions 

The program allows you to create an account and participate discussions and challenges.  The challenges range from validating that you read an article/watched a video, participating in a Linkedin/Facebook/Forum discussion or submitting code for challenges.


How well does the Champions Program meet its stated goals?

Grow your skills

The coding challenges provide some basic uses cases that are good when you are starting out, however when you working on specific use cases they may not help with your skill development.

The weekly articles validations are where some of the real gems are which are blogs or articles written by real MuleSoft practitioners and will gain new insights

Recognition

I submitted a blog post which was tweeted, but they are not leveraging the Linkedin MuleSoft group which would provide better exposure to the community

Rewards

There is a wide range of awards and I think most people will find something they like.  The points required doesn't seem out of line for the rewards either.

Networking

The program has had little impact on my networking

Summary  

I think the program is an interesting way to get a community to work more closely together and I think they are only scratching the surface of how it can be used to really improve the MuleSoft and adaption