[Logo] Space4J - Java Persistence
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Moderation Log] Moderation Log   [Register] Register / 
[Login] Login 
Slow inserts  XML
Forum Index » General Questions
Author Message
fred



Joined: 15/11/2008 01:27:34
Messages: 1
Offline

Hi,

While querying data is fast, it seems adding new records is extremely slow.
Having played around with the Phonebook example I was not able to insert more than 10 records per second.

Is there a way around this? My application would need to store about 1M records.

Thanks,

Fred
saoj



Joined: 05/09/2008 13:26:12
Messages: 26
Online


Hi Fred!

I would not expect this slowliness. Now I am curious what is the bottleneck: I/O?

You would have to take that Space4J source code and benchmark the writing process, step by step, to find out where the bottleneck is.

-Sergio
saoj



Joined: 05/09/2008 13:26:12
Messages: 26
Online


I have been thinking about this and my bet is that the bottleneck is on disk I/O.

Disk I/O after a write (or a commit in relational DB) is pretty much unescapable, because you need to make sure data is persisted and safe in case of a crash.

I am wondering who is faster. A relational database doing multiple inserts and commits in sequence or Space4J.

If you are really concerned about this speed, you can perform the disk I/O asynchronously, but the price is clear: you will not be sure when your write is persisted and safe in disk. After a crash, you will end up losing some past sucessful writes.

So two questions remain:

1) Is Space4J as fast as any regular relational database when it comes to muliple and consective inserts/commits ?

2) Is there a scenario where doing async disk i/o is actually desirable considering its cost?

Let me know your thoughts...


 
Forum Index » General Questions
Go to:   
Powered by JForum 2.1.8 © JForum Team