Smart grids promise to improve the efficiency of power grid systems and reduce green house emissions through incorporating power generation from renewable sources and shaping demand to match supply. Power generation from renewable resources such as solar and wind is affected by weather factors that can be highly fluctuating. To ensure these energy sources can be utilized efficiently, smart grid systems must shape demand through incentives to match the supply. As a result, the whole system becomes highly dynamic and requires constant adjustment. How to adjust the system can have a great impact on the efficiency and reliability of power grid systems, which offer many opportunities for innovation. We have designed a scalable data middleware specialized for smart grids.