The following question was closed. The question naively asks which Java data structure is used to implement large internet databases. If we replace "Java data structure" with "data structures", then the question makes sense: How are internet databases implemented?

Raphael comments that "we can't know". But database people can probably enlighten us even if they never worked for Oracle. While specific tricks and optimizations are trade secrets, general principles are probably public domain. Databases not being one of my specialties, I cannot answer the question, but others probably can.


2 Answers 2


Let's forget the specific companies and just consider the question

What data structures is commonly used in the industry to index millions of items? Suppose Java is being used. Would a LinkedList be preferable as items can be extracted from the middle (O(n) fetch) or an ArrayList(O(1) fetch) or an HashMap(Again O(1) fetch) or something else?

The answer to that is really “databases”. Which Dave Clarke has already provided. To go beyond this would take a whole course on databases. This is too much for a Stack Exchange question: as the FAQ says, if you can imagine an entire book that answers your question, you’re asking too much.


Thanks for raising this. If you think you can make the quesiton good, please edit it accordingly!

I think that the Stack-Exchange-good question in there may not be a CS question; it seems to me the user wants to write a Java program with lots of data and wants to know which class to use. That question would be for SO or programmers.SE.

If the question was "What data structure to use for lots of data?", we are a back to square one: the user has to specify the usage characteristics, otherwise we can't answer.

In short, I don't know what the OP wants. Until specified, this question should remain closed, imho.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .