web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

What is the best solution to transform millions rows of data one time?

(0) ShareShare
ReportReport
Posted on by

Hi,

This is Dipei, I'm working on a product which needs to transform over Millions rows ant it will take over 12 hours to get completed.

I'm using Dynamics CRM 2016 online, version 8.2.

My use case is quite clear and simple, here are the potential data flow:

1.  Read data from Dynamics CRM (batch size <= 5000)

2. Transform the data (need to run some customized codes)

3. Write back (update) the data to Dynamics CRM (batch size <= 1000)

As you guys know, there are some limitations in Dynamics CRM (online) to run the customize codes:

    - we can't run our customize codes in Plugin over 2 minutes, and

    - we can't recurrent to run the transformation process neither frequently, because the another limitation: Context Depth = 8 (some customers don't want to change this value).

I googled a lot and here are the potential solutions I may can go:

1. Microsoft allow we running big data job (long time running) in Microsoft Azure side, but this is not acceptable because part of our customers are still not have Microsoft Azure enabled.

2. Out of box application solutions to do that:

2.1, A desk top client app

It is doable, but the process may need to be run over 12 hours, it is not an ideal solution.

2.2, A online transform utility/system

It is also doable, but the problem is, such an utility/system will need to access data from Dynamics 365, some customers are not comfortable to share the credentials to connect to Dynamics CRM.

3. Workflow + Plugin:

I tried several different combinations, but still have no luck because of the limitations from Dynamics CRM online.

For example, I created a recurrence workflow (hourly), with which we can run the customize codes (Plugin) to complete the data transformation jobs. It works, but the problem is, when I tried to have it run more frequently (E.G. run once each half hour), it finally failed because Dynamics CRM took it as an infinite loop. If I can only schedule the recurrent workflow hourly, E.g. I can only have the customize code running not over 2 minutes in an hour, it will take weeks to complete the transformation and that is unacceptable.

Now, I'm planning to schedule 60 parallel recurrent workflows (all are run once each hour). It could be complicated because I learned somewhere, it says, Dynamics CRM online will not allow over 2 parallel thread to bulk read the data from the single table. In that case, I have to do do some extra works to have each independent recurrent workflow instance running in different time time lines. For example:

    - workflow 1: started at 8:00 AM, recurrent hourly 

    - workflow 2: started at 8:01 AM, recurrent hourly

    ...

    - workflow 60: started at 8:59 AM, , recurrent hourly

It may works, but have to run lots of tests to confirm that. I'm expecting to meet some other limitations which is unknown to me now.

I struggled over a week to run different tests with no lucks. It seems like it is not an easy thing. I do need expert advises/suggestions what should I do to enable such a feature working smoothly. Any helps are appreciated!

Thanks,

Dipei

*This post is locked for comments

I have the same question (0)
  • Verified answer
    ashlega Profile Picture
    34,477 on at

    Hi,

     I think you should not be trying to put this into Dynamics workflows/plugins. If it's a one-time conversion, I'd just go with #2.1 (or, possibly, would use SSIS  with CozyRock or Kingsway adapters for CRM)

     If you are actually creating a product which is supposed to do those conversions periodically for different clients.. Well, I'd definitely go with 2.1 since SSIS would not be an option(some clients would have it, other would not).

  • Dipei Profile Picture
    on at

    Hi Alex, thank you for your comments. Real appreciate it.

    I was preferring to take #2.1 personally. It is not the ideal one, but compare to all others, it seems it is the best one.

    I'd like to wait a few more days and will do more research to see if there is a better one.

    Thanks,

    Dipei

  • Verified answer
    SergiiChvyr Profile Picture
    on at

    Hi,

    For 2.1 you can create a Windows service instead to run in background and perform the job. Just process in parts and store your progress. Set automatic start for the service, so it will continue to work after restarting. You may utilize multi-threading as well to increase the performance, but be sure to have one OrgService per thread.

  • Dipei Profile Picture
    on at

    Thank you, SergiiChvyr.

    I total agree your suggestions if #2.1 is the final choice.

    So far, I'm a little greedy here and want to know if we can have better solutions. I believe I'm not the only one is facing such a problem, will wait to see if some one can give out different answers here.

    Thanks,

    Dipei

  • Verified answer
    Sergio Macias Profile Picture
    225 on at

    Hi Dipei, I´ve been working with dynamics for almost 9 years and for this particular requirement the solution is almost the same you already tried, I mean the answer from Alex Shlega is a very good one, you can also try with Scribe OnLine or OnPrem eventhough the cost per license is not an easy thing to deal with the customer.

    So thinking that you are doing a "migration" because it is jut one time, the option for the console app combining with the windows service is the best one after the SSIS solutions.

    One thing to consider is that CRM OnLine does not permit to have more than 2 threads, the OnPrem permits, If I can remember, more than 5 maybe 10.

    Here is a link where they talk about this topic

    stackoverflow.com/.../how-to-achieve-good-import-performance-with-crm-online-2015

  • Dipei Profile Picture
    on at

    Thanks Sergio.

    So far, it seems like we don't have much choice.

    Actually, I was also thinking the bellow solution. I have not tested it yet because I think it could be a bad idea. I'm going to write it down here to see if some experts like you can give out different views.

    4. Plugin + WebAPI

    The basic idea is, when the customize codes in Plugin is invoked, we can run the transformation process for a particular batch. When it is done, inside the Plugin, we call the WEB API to create/update a record which will continue invoke the Plugin. I believe in this way, it will stop tracking and counting the Context.Depth. But I have not tried it, because I had some other concerns:

    4.1, I'm not sure if it is legal to call Dynamics 365 WEB API from Plugin.

    4.2, Even if we can, call WEB API (RESTful) needs a ClientID (ApplicationID) and which seems another trouble, I can only get it by registering my application to Azure successfully. I guess to have it run in our customer side, it will also require a different ClientID, it is unacceptable.

    4.3, For #4.2, the alternated way is using the dynamics 365 .net client lib, with which we don't need a ClientID, but we do need user name/password. It may works, maybe not. And it still could be a bad idea:

       - It will be super weird to our customer, they have to input the user name/password again for this purpose, it could be unacceptable for some customer.

       - I also wondering if we can call the Dynamics 365 .net client lib inside in Plugin. Even if we can, will the system also track the Context.Depth and auto increased it?

    Thanks,

    Dipei

  • ashlega Profile Picture
    34,477 on at

    Hi Dipei,

     plugins are just not meant for that kind of extensive processing(from the performance, troubleshooting, and sandbox limitations standpoint). You'll save yourself from a lot of troubles if you don't go that route.

     What I'm not following is WHY you are trying to find another solution if 2.1 is what everyone seem to be suggesting:) Maybe you should clarify what the requirements/limitations are so we would better understand that part.

  • Dipei Profile Picture
    on at

    Thanks Alex.

    For #2.1, technical, it is doable and it could be the smallest resource effects solution. The only concern is: it is like NON-ZERO client (even we do it in Windows Service) solution, and someone hates it.

    So far, I still have a few days to make a final decision, I'm trying tell myself this: you should hold on until the deadline, because you never know what is going to happen in next step, maybe there are miracles.

    Actually, I already started the tech research things based on #2.1, and now studying some 3rd party utilities (such as Kingsway, CozyRock, which you guys suggested).

    Real appreciate the all helps from all of your guys. It is real helpful to me.

    Thanks,

    Dipei

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans