Take a step back and think about how much time you are willing to invest in plugging the hole vs replacing the dam. I understand that the DBM -> SQL jump seems like a long journey -- but it may well be worth it, now. Instead of looking to extend tied DBM with delayed writes etc, think about how you could scope out DBI access and provide a hash like behavior that you can s/newfunc/oldhash/g in your code. Once the speed issue is resolved then go back and make the apps core more fitting to a true SQL app. IMHO you will end up better in the long run and maybe even spend about the same amount of time with the current fix.