Newbie questions

Hi Guys. Based on a conversation with a close friend who pointed me to the EventStore website, I am beginning to become very interested in the project and the concepts behind it. I am quite keen to get started using the EventStore, possibly in my next project. Before I do I need to get started running some tests to see if I have the concepts correct and test out performance etc. I was hoping to get an opinion on how some data could be stored and the environments possible to communicate with the server.

  1. Libraries. My next project is going to be using nodejs as the server. I noticed there is a TCP connector to the EventStore (https://github.com/kenpratt/nodejs-EventStore) but with the last commit a year ago, and the basic.js example not working, and errors communicating with the server using basic code, I don’t think this is an option for me. Failing to find any other projects, I was wondering if anyone knew of any other libraries I can use with nodejs to make my learning curve easier.

  2. I suppose my biggest leap to understanding the best way to use the system is ‘what is a stream’. Is my understanding correct that a stream is like a row in a relational table? e.g. if I have a shopping cart table, someone comes to my site and adds something to their cart, do I create a stream at that point to identify all the events that are associated with the cart?

  3. If my above understanding is correct, do I also need to create an event on a ‘carts’ stream that will keep track of all my carts (thinking of the abstraction, this would be similar to the table in a relational database). e.g. if i wanted a list of all the carts, would this appear on a separate stream? I could imagine a scenario where I would want to get a list of all my users, I would need some way to work out which of my cart and users and products and (ad-nausium) streams would be just my user streams.

  4. A big hurdle I have is doing ‘finds’ on the EventStore (i.e. find all users with the first name john). Am I to believe that the projections api would help with this? I have the thought that I would also run a rethinkdb/mongodb/mariadb instance along side EventStore to hold the current state of my entities. This way the EventStore could be my authoritative source, however for doing things like finding all the carts that have been abandoned could be done very quickly and easily in a more conventional database. It would report back the data as well as the stream id’s. If this is the way to do it, then my solution would be to run some kind of worker (running the tcp connection to EventStore) to listen to every event, and simply modify the row/document each time. Any thoughts/suggestions about if this is good, bad or ugly? Or how to improve? Or have I missed the mark completely :slight_smile:

  5. Similar question to above, if I do keep an index of current states, and my ‘finds’ are off them, when I instantiate a new instance of an object, would I be better rebuilding the state of the object from the event store, or simply use the index? My thinking at the moment is to make that flexible, or even do both (this way I can keep track if the state in the index is up to date, or has been corrupted somehow, forcing a delete of the object in the index and playing back its stream again).

  6. Is the project production ready? I cant see that I would need any more than a single node for any real use, but I would want to investigate the clustering if for nothing more than replication and fast failover in the event of a disaster. But if I was to go into production, how stable will it be? Are updates backward compatible (or have reliable upgrade paths?) How many nodes can be managed using the cluster? How many events/streams/etc can be expected? How big are systems out there now? How performant are the big systems (do they need to rely on snapshots for performance for example?)

I think thats it for the moment. Thank you in advance for any answers, and thank you for making it this far :slight_smile:

Matt.

Matt, sorry for the delay in replying to this I have been with a customer this week and it will be a rather long reply. Comments are inline.

Thank you for your comments. I think you might be right about the nodejs modules. I’ll start with the http interface and may even roll my own tcp connection. I like the idea of being able to subscribe to a stream and get pushed updates.

If I may ask a further question regarding point 3. How do I get a list of all the streams to do with carts? If I name my stream ‘cart-user-greg’, ‘cart-user-shaun’, etc, I suspect I would also have a ‘product-phone-iphone’, ‘product-phone-nexus’, ‘product-pc-freenas’ etc. Perhaps I want to write a client which just wants the events for all the cart streams. Is this a simple regex on the stream name, or would i need a further set of streams, i.e. ‘all-carts’ and ‘all-products’ which will contain the events for when a cart is created or abandoned, or when a product is created or disabled etc?

Or will this be a job for the projections when they come of age?

I appreciate the feedback. I have a busy few months ahead of me I think :slight_smile:

Matt.

I would love to punt on this question for say one month. Is that acceptable?

Of course its acceptable - thank you for giving me an expected time frame

(I am assuming by punt you mean ponder? In Australia a punt is a gamble which I don’t think you mean.)

But of course you shouldn’t assume :slight_smile:

Matt.

This would be why Aussie rules suck. Kidding except for billiards. There is new functionality quietly coming…

Nice! I’ll quietly ignore aussie rules statement, and await unsaid functionality :wink:

My project is only starting and I’m doing it in my spare time, so I’ll likely take a few months to come to grips with a few of the new technologies i’m working with. End game is to role the event store into my day job, but that will take some convincing so I want to make sure I’m up to speed with things first.

Matt.