5

I know there isn't necessarily a clear cut between these two like there is between Memcached an DB/Filesystem, but I'm wondering what conditions would lead to filesystem being faster than DB caching. And, conversely, under what conditions would DB caching be faster than filesystem?

1 Answer 1

11

Filesystems are always faster than databases. Databases have overheads like locking, shard buffers, SQL parsing, query planning, etc., etc.

Ultimately, the database lives on the filesystem. A database is filesystem plus overheads.

Sign up to request clarification or add additional context in comments.

2 Comments

good point, although I would add that for most purposes, there will likely be no measurable difference in the speed of as DB can likely serve from memory and good OS have file cache in memory. So, before you decide on one or the other, you need to determine whether the caching system is really the bottleneck in your app.
@Lie Ryan: Measure before optimizing. Good advice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.