Originally posted by John Takacs, D.P.M.:
I'm looking to implement a database persistance layer for a search engine I run.
Currently I have 3 million + urls in a mysql database. The main table has several important columns but the the ones that matter are:
Title, Description, and url.
If I create an object that is essentially a single row of data, i.e. Title, Description, and url, I can get the size of that object down to about 450 bytes.
My question then is, is it safe to say that my memory use in the above example, for JDO only, would be 450 bytes * 3,000,000 rows?
Am I missing something here?
Thanks in advance!
Originally posted by David Jordan:
No, JDO does not store the entire set of rows from a table in memory. Craig's response may have given that incorrect impression.
You would issue a query on fields of your Java object. This would get mapped to a SQL query on the corresponding column in the corresponding table. If only one object matched the query constraint, you would just get one object back, not the entire table.
When I use the word reference, I mean a standard Java reference. That is different from a primary key, from an identity value, etc.
Originally posted by Craig Russell:
I think it would be a very interesting benchmark to store your 3 million instances in memory as a regular HashMap and in a JDO cache with a persistent instance having a persistent HashMap with the 3 million persistent instances. There certainly is additional overhead for the persistence management, which will be implementation-specific. But you might be surprised by the results.
Originally posted by Mike Farnham:
I am not familiar with MySQL's datastructures. I know Oracle has a number of blobs for storing large strings or binary objects.
Are you specifically limiting the length of a URL to say 255 or maybe 512 characters?
I am only asking mostly out of curiousity. I know the GET has a definite limit. A co-worker and I were just discussing what the limit might be for POST. A quick search using Google revealed a variety of answers. She created a sample URL that was 659 characters long. And, not one of the browsers failed to correctly deal with it.
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!https://www.kickstarter.com/projects/paulwheaton/greenhouse-1