The problem is not having data in memory or not in memory, but rather Indexing.
ie. knowing what data to get.
With MySQL/SQL/ORACLE the weakness is in it’s Structured Query Language limitation itself.
If you have table called CONTENT with a column of Text called 'articles’
and it has 10 billion rows
and you do a query like:
SELECT * FROM
articles LIKE '%ipad4%'
it will probably break your machine :-). All table based SQL systems and their indexing systems is limited to the structure ie. columns type and index of data.
Couchbase is Key to value i.e. Document(json).
If you know the key it will retrieve the document (json) faster then any RDBMS system, even with billions of documents. But once again you have to know the key.
Then came Elastic Search.
A full text indexing system that is faster and better then Structured Query Language.
Check out the power and new ways to query here http://www.elasticsearch.org/guide/reference/query-dsl/
Couchbase already has a super easy system to export documents to elastic search.
Query ES to get a list of keys and use CB’s SDK to get those keys at sub-millisecond speed.