How about this algorithm?
first we populate a small block of resources into db, and then have a background thread monitoring the allocation status. If the allocation meets a criteria, the thread will populate one more block of resources into db.
take the vxlan ranges: 1..100000, we divide it into 100 blocks of 1000, first one 1000 is populated into db, and then another 1000 if needed.
How about this algorithm?
first we populate a small block of resources into db, and then have a background thread monitoring the allocation status. If the allocation meets a criteria, the thread will populate one more block of resources into db.
take the vxlan ranges: 1..100000, we divide it into 100 blocks of 1000, first one 1000 is populated into db, and then another 1000 if needed.