GreanTech / AtomEventStore

A server-less .NET Event Store based on the Atom syndication format
MIT License
117 stars 14 forks source link

Prepending writer #52

Closed ploeh closed 10 years ago

ploeh commented 10 years ago

Still a Work in Progress...

sgryt commented 10 years ago

How come there is still a need to Reverse() the events on a page?

sgryt commented 10 years ago
ploeh commented 10 years ago

I'm just going with Atom, where the convention is that the most recent entries appear on top of a page.

(It may actually be more than a convention... It may actually be in the Atom specification, but I haven't looked it up, so I'm just calling it a convention here...)

sgryt commented 10 years ago

I see. In the degenerate case of infinite page size (ok, not infinite, but int.MaxSize, or just a very large page size) that convention will bite clients the same way that the current implementation does. Can we allow ourselves to stray from that convention ?

ploeh commented 10 years ago

In reality, that's not going to be a problem, because if a client sets the page size that high, the overall system will have other problems. Assume that the page size is l, where l is a very large number (perhaps Int32.MaxValue).

The reason we've made page size configurable is because the best page size is a balance between optimizing for writing and optimizing for reading. We've seen this before: as the page size goes up, read speed increases, but write speed decreases

We could consider changing the pageSize argument to an Int16 or even a Byte, but I don't think it's necessary, since I doubt that this is going to be a real problem.

sgryt commented 10 years ago

Makes sense, let's leave it at that. I guess this is the limit where we stop securing people from shooting themselves in the foot :)