We have implemented CDBStream as an alternative to CDataStream for reading and writing only to the blockchain, which does not require a secure allocator.
This will, DB is able to skip full copying to std::vector once.
db.h
https://github.com/FromHDDtoSSD/SorachanCoin-qt/blob/master/src/db.h