First, been there. Used it. Pissed my users off with crazy “I posted a comment, but it doesn’t load” bugs. Dumped MySQL for PostgreSQL. Put more load on PostgreSQL with views and complex queries. Found the system was faster. Removed all of my memcached code. Using views, removed a buttload of SQL in the code too. Fell in love with PostgreSQL.
My Bold Hypothesis:
- It makes your code brittle and buggy in ways that are hard to replicate or fix.
- These bugs are usually very annoying and confusing to users.
- Can cost more in developer time than buying better hardware and software.
- People don’t pay for performance optimizations. Memcached is a performance optimization.
- Your developers could have been working on features, not cache systems.
- It is often a symptom of using an inferior, but for some reason very popular, database system…
- ... that doesn’t handle complex queries worth a damn.
- Did I mention that you are gonna buy the new database server anyway? Memcached just stalls the inevitable.
My Hope:
- I can scale my software (mozicode) to an amazing amount of traffic by proper query tuning, proper database design and proper hardware.
- Throwing hardware at the database is cheaper than using developer time.
- There is nothing wrong or evil with paying for database software. Outgrowing PostgreSQL is a good thing. SQL Server or Oracle are more than happy to help scale to the highest levels of interweb coolness.
- I hope I can use PostgreSQL for quite a while though :-)
- I hope to never use memcached outside of very limited and trivial optimizations.
My Fear:
I’m wrong :-)
Disclaimer: I used memcached for one query that gets the story count for pagenation. COUNT queries on InnoDB or PostgreSQL aren’t very fast. There is no doubt that memcached has its place for certain kinds of queries. I’m talking more about using memcached in front of every database query.
