5

It seems that network connections are usually faster than local disk seek, as discussed in the question Are networks now faster than disks?

I come up with this question when I am using Berkeley DB, an embeded database which uses caching mechanism to improve performance. When the database is very large and there is no big enough memory, disk seek reduces performance.

If the network is faster, I wonder if I can put the database to the memories of sevral remote computers and visit it through network so as to avoid disk seek.This can be an alternative solution of workstation-class PCs.

PS: I am not a native English speaker. So apologize for my inaccurate expressions. Thanks!

Dz.
  • 51

3 Answers3

4

As per the question and answer you reference, it may well be faster to contact a host over a network than it is to perform a local disk seek operation (depending on the network and the disks in question, of course).

That doesn't always translate into faster operation for a real life working system - keep in mind when you talk about putting databases "in the memory" of various distributed systems (and leaving aside the availability and latency issues that might arise) you have to remember that those systems will perform their own memory management (and might page your data out to their local disk, giving you the worst of both worlds) and may well have other work to do which will make a system resource such as the network connection, say, busy and cut down on your speed advantage.

There's a big difference between a relatively simple cache system and trying to run a database in the memory of a number of distributed systems as you seem to be doing. Some database transactions might become very cheap (aka fast) but others may become much more expensive, and you may find that a need to design for fast performance in this kind of system places constraints on your DB design that negate any benefits.

So my answer to you is a rather boring one: It depends. You'd need to test your specific system under load to see if any possible theoretical performance gains translate into real ones for your particular situation.

Rob Moir
  • 32,154
1

The answer to this question, as with many performance questions, is:

"Maybe. Benchmark your situation and find out."

womble
  • 98,245
0

Considering the popularity of memcached I'd say definitely yes.

I get sub 1ms times with over 4 network hops in my network, while a disk seek on a 7200rpm drive can take anywhere from 1ms (if you're extremely lucky), through 15ms (average) up to few seconds (when sector is unreadable and the drive performs re-reads).

You should still have a dedicated LAN for access to memcached instances.

Alicja Kario
  • 6,449