In-memory data grid(IMDG) becomes more and more popular because of its high performance and scalability. Howe-ver, due to its simple key/value data model, IMDG does not support SQL and is incompatible with relational database oriented legacy systems. To solve this problem, an IMDG data accessing engine is designed and implemented. The engine supports automatical data loading, SQL sentences analyzing and executing, and data persistence. Common SQL sentences including the complex join operation are supported, which makes it possible to automatically transfer relational database oriented legacy systems to IMDG platform with significant performance improvement.