Together with collaborators, we introduced a noncommutative Riemannian geometry over Moyal algebras and systematically developed it for noncommutative spaces embedded in higher dimensions in the last few years. The theory was applied to construct a noncommutative version of general relativity, which is expected to capture some essential structural features of spacetime at the Planck scale. Examples of noncommutative spacetimes were investigated in detail. These include quantisations of planefronted gravitational waves, quantum Schwarzschild spacetime and Schwarzschildde Sitterspacetime, and a quantum Tolman spacetime which is relevant to gravitational collapse. Here we briefly review the theory and its application in the study of quantum structure of spacetime.