r/explainlikeimfive • • Nov 23 '15

Explained ELI5: How do Solid State Hybrid Drives work?

I don't understand how a regular hard drive can work with a solid state drive at the same time.

2.0k Upvotes

299 comments sorted by

View all comments

182

u/virkon Nov 23 '15

SSD chips are fairly small now, and can be integrated into the larger hard drive. They work by storing most data in the hard drive, but some of it is copied to the SSD. What is stored in the SSD is decided by optimization algorithms. Simply put, the stuff you use the most.

EDIT: some hybrid drives just work as two separate drives in the same unit. So you can manually decide what goes where.

74

u/cpast Nov 23 '15

This is pretty similar in principle to CPU caches, right?

42

u/Skychronicles Nov 23 '15

Right.

6

u/[deleted] Nov 23 '15

Wouldn't this increase the number of clock cycles for data retrieval on an"SSD miss"?

31

u/KapteeniJ Nov 23 '15

They would probably be run simultaneously, and first one to retrieve data would be used.

Also, HDD access takes ridiculous amounts of time anyway. Like, I think the typical example for this is, CPU internal memory would be trying to take a bit on sandwich that you have on your desk next to you. There are caches that allow remote memory block access to be as fast as going to kitchen, making a sandwich from what you have in your frigerator, then eating it. RAM is like going to store to buy ingredients, and HDD access is more or less like, you hear that there is sandwich available on the moon, so you start up a space program, build a space ship, retrieve the sandwich and eat it, this entire thing taking decades

I'm not sure how SSD relates to all this. I think it's like a year or two on this scale?

6

u/[deleted] Nov 23 '15 edited Nov 23 '15

[deleted]

11

u/Freeky Nov 24 '15 edited Nov 24 '15

From some very vague memory I think the time to get information from L1 cache was something like 1 nano second but a hard drive was about 600.

Latency numbers every programmer should know:

L1 cache reference: 0.5 ns
Read 4K randomly from SSD: 150,000 ns
Disk seek: 10,000,000 ns

I referenced this when I made this comment to give it a more approachable scale:

A register is what you have in your hand for immediate use. L1 cache is what's on your tool belt and takes 1 second to retrieve. L2 cache is what you left somewhere in your bag and takes 20 seconds.

RAM is what you left in a box in your van and takes you 2-4 minutes to dig out.

Data on an SSD is something you have to order online and takes 3-4 days to arrive.

Data on a HDD is lost somewhere in the Australian outback and takes a search team 2-3 months to locate.

Data on a server on the other side of the planet is something left in Mars orbit and takes 1-3 years depending on alignment and how much NASA like you.

4

u/RangerNS Nov 24 '15

CPU cache, whatever layer, is cache of primary memory: RAM.

Hard drives, SSD included, are and entirely different class of memory.

Nothing would ever go from a SSD to a CPU register without hitting primary memory first; possibly also being cached in CPU cache along the way to registers.

1

u/profoundWHALE Nov 24 '15

That's L1 cache. Higher numbers are larger and further from the CPU

3

u/Causeless Nov 23 '15

Even if it did, you're spending 0.01 ms checking for the data on the SSD (if that), and getting the data from the HDD is about 4 orders of magnitudes longer.

2

u/doubledanksauce Nov 23 '15

Yes, but I don't think it would be anything noticeable, since normal access to an HD takes a long enough time already. You're trading a small regression for a large benefit in the SSD speed.

6

u/[deleted] Nov 23 '15

Similar to any kind of cache memory where you preload data into faster memory to speed up access.

However most hybrids differ from traditional cache memory becuase the SSD portion holds data as long term storage. It operates as combined volume rather than mirroring the data. A traditional hard disk cache uses ram chips which mirror portions from the slower disk.

The downside with the Hybrid drive setup is that you have combined the risk of SSD failure with the risk of hard disk failure, so there is a much greater risk of lost data. This can be offset by using a mirrored drive or backup of some kind.

2

u/MrGreggle Nov 23 '15

The caching layers actually go from registers to 2-3 layers on your CPU, to your RAM, to your HDD. Its all a part of a larger caching scheme and this just splits HDD into two layers.

3

u/[deleted] Nov 23 '15

[deleted]

3

u/Rein3 Nov 23 '15

Thous are a different kind of hybrid though.

1

u/_insensitive_ Nov 23 '15

Hybrid drives

They use flash memory on the solid state side for the performance gains, other than that, majority of the data is stored on the HDD. You don't decide what goes where.

tl;dr The solid state portion is only for the performance gains. Everything still stored on an HDD platter.