spring - Fastest Way To Create 1 Million Files In Java -


i have requirement create 1 million files containing records in , insert in oracle db using java code.

system configuration :   ram:-32gb   hdd:-100gb   processor:-intel core 2 duo 

what best approach.

approach planing follow :

  1. since have amount of ram, create 100 files using thread pool executer pool size of 5 (20 files per thread) , each thread again call thread pool execute 5 thread (1 file each thread) insert data in db. once data inserted in db old files deleted , new bunch of 100 files create , on. have query db @ levels when amount of data (100, 1000, 10000, 10000 1 million) has been inserted in db.

  2. create dump files each (100, 1000, 10000, 10000 1 million) , restore 1 one , query result (do need restart application restore dump 2 or more files or work fine no matter restore number of dump files in db without restarting application server).

  3. create zip files each (100, 1000, 10000, 10000 1 million) extract when needed , read files location , insert in db using 5 or more thread pools.

is right approach or there better way this? please suggest...

any idea how may threads able run simultaneously if have 32gb of ram ?


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -