Re: Advice on persistent storage in Java?
From: john martin (jmartin_at_cs.stanford.edu)
Date: 12/13/04
- Next message: Ann: "Re: html to jpg/gif converter"
- Previous message: Dag Sunde: "Re: run question."
- In reply to: Dimitri Maziuk: "Re: Advice on persistent storage in Java?"
- Next in thread: Martin Egholm Nielsen: "Re: Advice on persistent storage in Java?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 13 Dec 2004 01:48:44 -0600
Dimitri Maziuk wrote:
> john martin sez:
>
>>I need some advice on persistent storage in Java.
>
> ...
>
>>The two general options I'm considering are using an object oriented DB
>>(e.g., PERST, http://www.garret.ru/~knizhnik/perst.html), and a regular
>>SQL DB (e.g., hsqldb, http://hsqldb.sourceforge.net/).
>
>
> I've never used PERST & I use HSQLDB all the time.
>
> Is your data structure an object? -- i.e. does it have to
> have methods? If it's just data, it should map to regular
> relational schema, no need for OO DB. (You can store objects
> in HSQLDB, BTW, I just never needed that myself.)
the structure is a couple of different types of objects, although the
objects are meant to store user defined data (the user defines the
structure of the data in addition to the values), so the schema wouldn't
be known ahead of time. so it seems easiest to be able to store whole
objects.
>
> Most database engines are optimized for query speed. If you
> need to repeatedly load your data into DB, you won't get good
> performance (i.e. lots of INSERT/UPDATEs and relatively few
> SELECTs vs. lots of SELECTs & few INSERTs).
yeah, it'd be more querying than updating.
>
> HSQLDB doesn't have a good query optimizer (how much smarts can
> you fit into 200Kb?) so if you use a lot of complex SQL you may
> not get good performance.
the SQL would probably all be pretty basic.
>
> What you do get from RDB is SQL. From PERST docs, join of two
> tables requires half a dozen lines of code and as many objects
> (indexes, projections, result array, comparator). In SQL it's
> one line: less code to write, lower development & maintenance
> costs.
>
> OTGH, if you don't need advanced search capabilities of SQL
> and can do all your access via Hashmap or two, why not just
> make your data Serializable and dump it to disk yourself?
i guess i'm a bit wary of using serialization for long term storage, but
probably overly so. i'm thinking about using serialization for now
while i get started, and then switching over to something more robust
later on. although if i end up using hibernate, which lots of people
have recommended (i posted this same question in a couple of other
places), that wouldn't be the best design decision, since it would
ideally be more tightly integrated into the code than using
serialization or a DB via a persistence layer.
>
> Dima
- Next message: Ann: "Re: html to jpg/gif converter"
- Previous message: Dag Sunde: "Re: run question."
- In reply to: Dimitri Maziuk: "Re: Advice on persistent storage in Java?"
- Next in thread: Martin Egholm Nielsen: "Re: Advice on persistent storage in Java?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|