Flash storage and in-memory solutions for databases (high-level)
Storing databases “in-memory” has been getting a lot of coverage recently and this will start to increase much more now that Oracle is marketing Exadata X3 as the ‘in-memory machine’ and SAP is pushing their HANA appliance. When people talk about in-memory they are usually referring to DRAM but it is true to say that flash is also a form of memory just presented differently with different characteristics. For the purpose of this blog post I am referring to in-memory as DRAM based and compare that to the use of flash memory storage for you’re databases. Personally I don’t agree with Oracle saying that the Exadata X3 is an in-memory machine because you cant put you’re whole database into DRAM and it still has to reside on flash or disks but that’s another discussion all together.
The first in-memory database was released commercially in 1993 and since then a raft of companies including Oracle have been offering product lines which put your databases into a servers DRAM. Over the years DRAM prices dropped and became cheaper. I remember when I was young that just a few MB for my PC cost be £200 but now I can pick up a 4GB for £15. So it became logical to load up database servers with memory and do more caching or look at in-memory products such as Timesten, especially since disk speeds never improved while application I/O demands increased. There are a lot of hybrid “in-memory” solutions out at the moment where active data is cached on DRAM and the rest of disks i.e. Exadata X3. However to me an in-memory database is one where all the data is stored in DRAM, not just part of it. So some of the advantages for putting you database into memory are:
- DRAM is still the fastest form of storage you can get for a database server
- As prices dropped, it became more affordable to load up servers with memory
- In-memory databases boast performance by giving almost instant data access as DRAM latency is measured in nanoseconds
- Faster data retrieval can increase application productity and transactions per second
- CPU is more efficiently as there is less waiting around for I/O
- Really good for smaller sized databases
However the disadvantages of in-memory databases are:
- DRAM is volatile so if power is lost then so is the data sitting in-memory
- In-memory databases still need persistent storage to store the data for the above reason
- Even though DRAM prices have dropped it is still more expensive than disks and flash
- Changes that haven’t been flushed to disk will be lost
- Lack of scalability and are limited by the number of DRAM slots in a server
- Due to cost and server limitations it is not suitable for large databases
- DRAM storage can not be shared amongst other database servers so is not suitable for RAC
- On server startup, the data needs to be read from slow disk and loaded into memory
- Not as redundant or highly available as flash or disk storage
- Write access is slower
Flash Memory Storage
Flash storage based on NAND technology has been fast gaining popularity in the data centre with many companies such as Violin Memory playing in the market. NAND flash was invented by Toshiba and was used heavily in mobile devices such as ipod, smart phones etc before making their way into packaged storage arrays. There are many businesses that package up NAND flash has storage arrays but only a few do it properly. To get the real benefits of using NAND flash, the arrays need to be designed from the bottom up rather than use commodity parts like disk controllers. Building from the bottom up ensure the array can get maximum performance from the flash and also implement proper high availability and redundancy.
Some advantages of NAND flash storage arrays:
- provide extreme performance compared to disks; can be up to 20x faster
- Has no moving parts so is cheaper so has lower failure rates, operational and maintenance costs than disks
- Is persistent storage so if power is lost than the data still exists
- Better scalability to larger capacities than DRAM. More arrays just be added if space is required without disruption
- provides very latency as low as 25microseconds, IOPS as high as 1million and high throughput upto 5GB/s
- Provides a SAN type sharable storage solution so data can be accessed by multiple servers making it a better clustering solution
- Better innovation in the hardware and software layers of the arrays
Flash arrays do have disadvantages like wearing and performance degradation when full but companies are getting better at solving these such as Violin Memory who has patented algorithms in place to reduce wear and give consistent performance. Cost is another thing that people tend pick on but really when you look at the cost per IOP and TCO then flash arrays can actually give ROI’s of 6-12 months which makes them cost effective. In my opinion flash storage arrays are a better all-round solution for the enterprise datacentre than DRAM based in-memory databases. These storage arrays act like SANs, are sharable and have the enterprise level high availability/redundancy you would expect. Flash storage arrays have a much wider range of use cases because of these benefits.
However this post is not to say that one is better than the other because in-memory has its uses with the right application. Actually DRAM in-memory solutions can work very well with flash storage arrays for databases. As mentioned in one the disadvantages, an in-memory architecture has to be load data from persistent storage on server boot. If the persistent layer is disks then the data load will only be as fast as the disks themselves. If that persistent layer was flash storage then the initial data loads on server boot will be up to 20x faster.
Both solutions help businesses move closer towards real time data access as applications become increasingly mobile. In-memory databases will not replace traditional databases on persistent storage but they do have their place. However flash storage, with their high performance and SAN capabilities, will replace disks as the tier one option possibly working in harmony with in-memory architectures for the right application use case.
Posted on October 9, 2012, in Its all about Flash Storage!, Oracle Database and tagged flash, flash array, flash storage, I/O, I/O performance, in-memory, in-memory databases, Oracle, storage, violin memory. Bookmark the permalink. 2 Comments.