News for hackers. Stuff that matters.
Re:Show HN: A fast append-only data store for Java 8 by sgt on Tuesday April 14, 2015 @04:03PM (#9376893)
An example of good idiomatic Java 8 source code.

Example:

https://github.com/mrwilson/java-dirty/blob/master/src/main/...

Re:Show HN: A fast append-only data store for Java 8 by agibsonccc on Tuesday April 14, 2015 @05:14PM (#9377408)
If only enterprise didn't move so slow =/. I wish I could migrate to 8.
Re:Show HN: A fast append-only data store for Java 8 by famousactress on Tuesday April 14, 2015 @05:34PM (#9377521)
Thanks. Curious... are the parens meaningful in this method body?

    private int getPartition(int globalInsertionPosition) {
        return (globalInsertionPosition) / this.sizePerPartition;
    }
Re:Show HN: A fast append-only data store for Java 8 by probablyfine on Tuesday April 14, 2015 @05:35PM (#9377531)
No, that's likely a leftover from refactoring. Good spot.
Re:Show HN: A fast append-only data store for Java 8 by famousactress on Tuesday April 14, 2015 @05:46PM (#9377583)
Haha, no worries! I've been checked out of Java for a while and I was a little bit worried that this was semantically meaningful, which would be a pretty confusing addition to the language :)
Re:Show HN: A fast append-only data store for Java 8 by tlrobinson on Tuesday April 14, 2015 @07:27PM (#9377984)
What are the Java 8 features being used here, besides the obvious lambda expressions?

(genuine question, I haven't stayed current with Java)

Re:Show HN: A fast append-only data store for Java 8 by cedrickthecrow on Wednesday April 15, 2015 @03:43AM (#9379420)
Optional is also new to Java 8 although syntactically very similar that Guava.
Re:Show HN: A fast append-only data store for Java 8 by sgt on Wednesday April 15, 2015 @02:56AM (#9379290)
Streams are also being used.
Re:Show HN: A fast append-only data store for Java 8 by nicksellen on Tuesday April 14, 2015 @02:08PM (#9376174)
How would you compare and contrast this with http://openhft.net/products/chronicle-queue/? (which I knows does a bunch more but seems like it could be used for this purpose too).
Re:Show HN: A fast append-only data store for Java 8 by faizshah on Tuesday April 14, 2015 @04:22PM (#9377034)
This is not comparable to chronicle, this is one of the mechanisms by which chronicle works (memory mapped files).

http://stackoverflow.com/a/9268065

Re:Show HN: A fast append-only data store for Java 8 by apo on Tuesday April 14, 2015 @07:56PM (#9378094)
Re:Show HN: A fast append-only data store for Java 8 by MrBuddyCasino on Tuesday April 14, 2015 @02:21PM (#9376259)
> frequently find myself wanting a light append-only data store for pet projects

As someone who is mystified by that statement: why?

Re:Show HN: A fast append-only data store for Java 8 by dyladan on Tuesday April 14, 2015 @02:27PM (#9376297)
Could be used as an event store. Rather than storing a list of mutable objects as in a normal database, you store the changes themselves as a list of facts. This makes things like replication a lot easier and can be optimized to be much faster than a traditional database.
Re:Show HN: A fast append-only data store for Java 8 by batbomb on Tuesday April 14, 2015 @02:31PM (#9376312)
There's Apache BookKeeper to fill some of those needs.
Re:Show HN: A fast append-only data store for Java 8 by eropple on Tuesday April 14, 2015 @03:39PM (#9376750)
I've never seen BookKeeper in production. Where would you recommend its use over something like Kafka?
Re:Show HN: A fast append-only data store for Java 8 by lomnakkus on Tuesday April 14, 2015 @04:35PM (#9377140)
Great, but that's not a product. If you're on board with the CQRS/ES thing, actually building your own should not be difficult. (Ok, so I'm assuming non-distributed DB here, but with a bit of imagination one could also do infinitely(!) scalable CQRS/ES within Bounded Contexts, given the fresh crop of easily understandable/implementable concensus algorithms.)
Re:Show HN: A fast append-only data store for Java 8 by probablyfine on Tuesday April 14, 2015 @05:05PM (#9377354)
I've used it as the backing for a time-series database and to store deltas for a state-machine - in both situations I wanted something that understood "POJOs" and didn't require a lot of setup.

Even in the case of multiple non-unique entries, if the stored objects are not meant to be mutable, the API exposes .reverse() to find the most recent.

Re:Show HN: A fast append-only data store for Java 8 by rakoo on Tuesday April 14, 2015 @02:46PM (#9376411)
If you know your data has no duplicate (eg, you want to sort and store a list of cities), you know you don't need to check the already-written objects; you only need to append objects.
Re:Show HN: A fast append-only data store for Java 8 by wtetzner on Tuesday April 14, 2015 @02:32PM (#9376325)
Auditing becomes easy. The history of all changes is automatically available.
Re:Show HN: A fast append-only data store for Java 8 by jerven on Tuesday April 14, 2015 @03:35PM (#9376721)
Really nice, I am just needing this ;) Super that it is MIT licensed as well. I was halfway on building something on top of XZ SeekableInput Streams but this is probably a lot saner to use ;)
Re:Show HN: A fast append-only data store for Java 8 by hello_there on Tuesday April 14, 2015 @04:22PM (#9377040)
Great. I've been wanting something like this for a while. I've got a few questions:

1. How large files are supported?

2. It says that it will only persist primitive fields on objects - does that exclude persisting a byte array?

3. What are the failure semantics? For example, what happens if my computer's power supply fails in the middle of a write? How will the program behave the next time it is started?

Re:Show HN: A fast append-only data store for Java 8 by probablyfine on Tuesday April 14, 2015 @05:01PM (#9377321)
Hi, glad you like it.

1. Under the hood it partitions the log into sections to avoid Java's MappedByteBuffer size-limit. I've not tried to deliberately push the file-size limit yet, but it's something to add to the benchmarks when I publish them (soon!)

2. It doesn't support primitive arrays as of 1.4, but this is something that I have considered in future versions. Pull requests are definitely welcome.

3. I've not tested these failure cases yet.

Re:Show HN: A fast append-only data store for Java 8 by javajosh on Tuesday April 14, 2015 @04:34PM (#9377133)
Good questions, but wouldn't it be fun to find out the answers using empirical tests? You might even be able to add tests and submit a PR, and be immortalized in the annals of github.
Re:Show HN: A fast append-only data store for Java 8 by mrits on Tuesday April 14, 2015 @04:37PM (#9377155)
You don't get things done very fast, do you?
Re:Show HN: A fast append-only data store for Java 8 by dang on Tuesday April 14, 2015 @09:04PM (#9378320)
> You don't get things done very fast, do you?

Please don't make rude comments on Hacker News.

Re:Show HN: A fast append-only data store for Java 8 by mrits on Wednesday April 15, 2015 @07:07PM (#9384857)
It is a legitimate response to a problem that plagues the hacker community. Focus on the task at hand. Trying to understand the intricacies of a system can be educational but the best lessons learned are from completing your current project.

I'm surrounded by intelligent people that can't get anything done.

Re:Show HN: A fast append-only data store for Java 8 by dang on Wednesday April 15, 2015 @07:48PM (#9385016)
Ok, but the problem with your previous comment wasn't your view, but the rudeness. It's possible to express your view without rudeness; you just did. That's what we're going for here.
Re:Show HN: A fast append-only data store for Java 8 by jkot on Tuesday April 14, 2015 @03:20PM (#9376623)
+ For chronicle

Have look at my profile. Also there is KVEngine from H2.

Re:Show HN: A fast append-only data store for Java 8 by nicksellen on Tuesday April 14, 2015 @05:49PM (#9377601)
I tried googling for H2 KVEngine but didn't come up with anything, did you mean http://www.h2database.com/html/mvstore.html perhaps?
Re:Show HN: A fast append-only data store for Java 8 by jkot on Wednesday April 15, 2015 @04:09AM (#9379501)
yes
Re:Show HN: A fast append-only data store for Java 8 by knd775 on Tuesday April 14, 2015 @02:06PM (#9376152)
This actually seems pretty useful. I'll be sure to check it out for my next Java project.