Lack of documentation, tutorials, videos or books - barrier to EventStore success?

Hey Oskar, thanks for the prompt reply! I read through the article What is Event Sourcing? and could see how simply adding an item to an order could be achieved but that assumes you already have an order, the question I couldn’t get an answer to was what if I wanted to add an order (i.e. an object that doesn’t have a parent)? What would be the right approach there?

Dave, creating new order (so entity without a parent) should have the same result as adding a child (value) object - so publishing new event.
Creating a new Order should result in calling Apply method with, e.g. OrderCreated event

Apply(
    new OrderCreated {
        OrderId = id
    }
);

Then such event will be stored in the “changes” events cache (so the same way as ItemAdded). Both types of events - so OrderCreated and ItemAdded will share the same stream name (e.g. “Order-123”). Thanks to that it’ll be possible to correlate them.

You can see more in the @alexey.zimarev samples from his book - https://github.com/alexeyzimarev/ddd-book/blob/master/chapter13/src/Marketplace.PaidServices.Domain/Orders/Order.cs

or in my samples (however, using a bit different pattern): https://github.com/oskardudycz/EventSourcing.NetCore/blob/main/Sample/Tickets/Tickets/Reservations/Reservation.cs

Ah I see, so you place the code to dispatch the event within the class itself instead of using some other superparent or root. Thanks for the links, they look really useful; I’ll have a play.

Just to make sure that I explained that correctly - it’s not precisely dispatching - but caching it in the “events-to-be-dispatched” collection. Those events are pending events cached somewhere (e.g. in the base aggregate class collection) - see, e.g. https://github.com/oskardudycz/EventSourcing.NetCore/blob/main/Core/Aggregates/Aggregate.cs#L8.

Then you can take those events and dispatch them to Event Store during saving changes.

Happy to help :slight_smile: Feel free to ask more question when they arise.

Dave,

What language you looking to use?
I have started a javascript repository that probably could be used as a basic guide:

Most of my work is in C#.

If there is anything you need a hand with, give me a shout.

1 Like

Hi Oskar, that’s clear thanks.

Hi Steven, I’m a C# dev so the example that Oskar sent is perfectly good for me.

Thanks both, I’ll come back if I have more questions :slight_smile:

2 Likes

@dave my point is that there’s no such thing as “EventStore project”. Indeed, we position EventStoreDB as the perfect choice for Event Sourcing in terms of supporting this persistence method. However, as you may find on Oskar’s repo, Event Sourcing is one thing, using EventStoreDB as a database for persisting events is another thing, how to apply DDD patterns in an event-sourced system is something in addition.

Although I (partially) agree that the number of resources about Event Sourcing is a pattern is not great, the community has done decent work to provide guidelines and tips. As the SQL Server documentation won’t tell you how to build proper relational data models, we aren’t able to cover similar things in the documentation in regards to Event Sourcing, although we will create content for that.

Next, not trying to sell you anything here, but those questions you asked are all answered in my book, with working code samples. If you don’t want to read it, you might at least find it useful to look at the code, which is open for everyone: https://github.com/PacktPublishing/Hands-On-Domain-Driven-Design-with-.NET-Core. The Chapter 13 code is quite comprehensive in that regard, although I won’t be using RavenDB in my examples right now :slight_smile:

I also did a hands-on session on a conference last week and here is the repository with a small basic app I built during a few hours on Saturday: https://github.com/alexeyzimarev/dotnext.

Finally, our on-demand webinars have live coding session where I was showing things, including the answer to your question.

So, my question here is - do we lack resources, videos and books, or those resources are too hard to find? I believe your feedback can help us a lot to be better on these things.

Hi Alexey, nothing like a shameless plug, I like it :wink:

It seems there is plenty of information out there when you ask for it, the speed in which I’ve had a response is impressive; I suppose if the relevant pieces were brought together into a single place it would give people a better chance of understanding the power of EventStore and how useful it could be to them. I certainly feel much better informed and happy such an active community quickly answered my questions, but it required me to create an account and ask the question.

Yeah, I agree about spending effort on consolidating resources. Unfortunately, internet is full of rubbish too and I have a long list of resources telling you exactly how to do Event Sourcing the wrong way :slight_smile:

For reference and inspiration, this is an example of good documentation of a database:

https://docs.influxdata.com/influxdb/v2.0/

@Hoegge thank you for the recommendation - we’ll try and check for things we can inspire.

Could you write a few essential points of what makes InfluxDB documentation good for you?

This is really correct, eventstore has a great potential but lack of tutorials, documentation makes it really difficult to get started.

Did you check our documentation website lately?

https://developers.eventstore.com/

yorick,

The documentation is solid for experienced users imo, but starting on a blank canvas I suspect it’s still pretty daunting.
When I first started using ES, I would have liked some small example showing how to use the eventstore “properly”

Simple things like:

What do I need projections for?
Examples of streams (what should the events look like)
Small example systems (an Account system) with specific gotchas in it (the classic where we want to update Account 1 and Account 2 at the same time)

We are absolutely moving towards that @steven.blair. Just give us a bit more time :slight_smile: In fact I plan to have a whole section of the documentation dedicated to best practices and how-tos

2 Likes

@Hoegge Well, I worked with Influx and for that purpose have read their docs no longer than three months ago. Honestly, I it a disaster. Especially, when it comes to their client docs, and the .NET client in particular. Not to blame or shame our colleagues from InfluxDB and their product, not al all, but our aim is to be better than that :slight_smile:

@steven.blair I think we need to make a proper distinction between documenting the product and providing guidance how it can be used. I don’t really think that Event Sourcing 101 should be a part of the documentation, as none of the SQL databases tell you about the relational theory (maybe they should as not a single developer I met knows anything about it).

We have, however, the growing learning section on the website, where we aim to expand the collection for resources about Event Sourcing and other useful topics. I still don’t think it all should be in the documentation. Happy to discuss if you think otherwise!

1 Like

Have you watched our webinars, do you think it’s still hard to get started?

Revisiting this subject after a long time. I think it’s probably improved, but reading through it I still encounter a lot of quirks, surprises and inconsistencies in the docs. Many are small issues, but together they create a barrier, for me at least. This includes both the docs as the webinars.

Allow me to list a few:

  • It seems that C# gets the most love. As a TypeScript guy I feel neglected. Also there are errors/omissions/surprises in the JS/TS examples.
  • Why is reading from a stream called FORWARDS (with an S) ?
  • There is no obvious recommended order in watching the webinars.
  • The ‘Persistent Subscriptions’ chapter does not explain what persistent subscriptions are, instead it immediately starts talking about subscription groups.
  • After watching the event sourcing tutorial I get the impression you always start with Commands. But there’s no mention of commands in the docs. Instead the chapter ‘appending events’ starts with ‘creating your first event’. Wait, what? I thought I needed to start with a command?
  • In ‘Working with EventData’ you mention ‘it is common to see explicit event code type name used as the type’, but ‘However, we recommend against this’. Ok, so what do you recommend then?
  • the docs really could use an example of how to build/maintain а PostgreSQL projection.
  • How would I send a command from a browser/mobile app? Using a REST endpoint? Can I use gRPC from the mobile app? Is that secure?
  • How would I implement subscriptions from a mobile/browser app?

So in my view it’s a mix of small inconsistencies in the docs, that leave me confused, and big-picture architectural questions.

Just my $0.02

1 Like

https://www.collinsdictionary.com/dictionary/english/backwards-and-forwards

Answering quickly to that one only as it’s the easiest :slight_smile:

The .NET gRPC client was the first one to get out there, as other clients are catching up, the docs catch up as well. Concerning the samples, there’s a NodeJS client repo where all the samples are, it’s best to open issues there when you see actual errors, so those errors could be fixed.