What is the Best way to write high volume of data into database

Certified Senior Developer

Hi All,

I have an interface where we are having paragraph field and grid . User will be giving data in the paragraph field in specific format and will click on add button, Once they clicked on it, it will be written into database and the grid will be refreshed with the added data. There are some use cases where user will be adding more than 2000 records at a time. Currently it is taking around 2 minutes to load the 500 records into database.  What is the best way to save the data into database with minimal time? Could someone please help me on this

  Discussion posts and replies are publicly visible

Parents
  • There could be multiple ways of looking at it based on what is more important. 

    1. If the priority is to take less time, then I will advise changing the approach and letting the user save every record once they are done working on it. This will surely increase the clicks but will ensure that every data is saved instantly so the 2 minutes is reduced to almost negligible. 
    2. If the priority is to keep it performant and keep the user efforts minimal, then I will advice writing the data in batches of 100 and calling this process as an async process. You can add a refresh interval of 30 seconds on your grid data to auto-refresh and show the newly written batch of data
Reply
  • There could be multiple ways of looking at it based on what is more important. 

    1. If the priority is to take less time, then I will advise changing the approach and letting the user save every record once they are done working on it. This will surely increase the clicks but will ensure that every data is saved instantly so the 2 minutes is reduced to almost negligible. 
    2. If the priority is to keep it performant and keep the user efforts minimal, then I will advice writing the data in batches of 100 and calling this process as an async process. You can add a refresh interval of 30 seconds on your grid data to auto-refresh and show the newly written batch of data
Children
No Data