DNA as an exceptional data storage medium offers high information density. However, DNA storage requires specialized equipment and tightly controlled environments for storage. Fast encapsulation within minutes for enhanced DNA stability to do away with specialized equipment and fast DNA extraction remain a challenge. Here, we report a DNA microlibrary that can be encapsulated by metal−organic frameworks (MOFs) within 10 min and extracted (5 min) in a single microfluidic chip for automated and integrated DNA-based data storage. The DNA microlibrary@MOFs enhances the stability of data-encoded DNA against harsh environments. The encoded information can be read out perfectly after accelerated aging, equivalent to being readable after 10 years of storage at 25 °C, 50% relative humidity, and 10 000 lx sunlight radiation. Moreover, the library enables fast retrieval of target data via flow cytometry and can be reproduced after each access.