System Design and Optimization for Efficient Flash-based Caching in Data Centers