RAM-based storage aggregates the RAM of thousands of commodity servers in data center networks (DCN) to provide extremely low I/O latency and high I/O throughput. In order to achieve fast failure recovery, MemCube exploits network proximity to restrict failure detection and recovery within 1-hop range. However, previous design is applicable only to the BCube network, which limits the usage of RAM-based storage. In this paper we present CubeG, which Generalizes the "1-hop" principle of MemCube for all cube-based networks, and accelerates the recovery process through integrated implementation. Our evaluation shows that CubeG efficiently supports RAM-based key-value store for generalized cube-based networks.