High-capacity storage technologies are needed to meet our ever-growing data demands1,2. However, data centres based on major storage technologies such as semiconductor flash devices and hard disk drives have high energy burdens, high operation costs and short lifespans2,3. Optical data storage (ODS) presents a promising solution for cost-effective long-term archival data storage. Nonetheless, ODS has been limited by its low capacity and the challenge of increasing its areal density4,5. Here, to address these issues, we increase the capacity of ODS to the petabit level by extending the planar recording architecture to three dimensions with hundreds of layers, meanwhile breaking the optical diffraction limit barrier of the recorded spots. We develop an optical recording medium based on a photoresist film doped with aggregation-induced emission dye, which can be optically stimulated by femtosecond laser beams. This film is highly transparent and uniform, and the aggregation-induced emission phenomenon provides the storage mechanism. It can also be inhibited by another deactivating beam, resulting in a recording spot with a super-resolution scale. This technology makes it possible to achieve exabit-level storage by stacking nanoscale disks into arrays, which is essential in big data centres with limited space.