Тёмный

Event sourcing in Javascript 

Fredrik Christenson
Подписаться 26 тыс.
Просмотров 7 тыс.
50% 1

In "Event sourcing in Javascript" I show you event sourcing using Javascript

Опубликовано:

 

15 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@stangeorge6893
@stangeorge6893 5 лет назад
I've looked on so many articles for the event sourcing in order to understand it better. You explained it perfectly in 16min.
@mti2fw
@mti2fw 2 года назад
Great video! Simple to understand and apply!
@victorbouffier3580
@victorbouffier3580 2 года назад
Great video Fredrik! Very easy to follow. I see you are also storing the finalized order in a separate table, not only the events to build the order. This as necessary in case you want to query two tables through a join (such as orders by customer). I am trying to visualize how to best build the model with several tables to build queries with. Is this the way you would recommend doing it? That is, to have an event store for orders plus a store for the built orders? And is such a way, also have an event store for customers, plus a store for the finalized customer entry? Thanks for your input.
@akashpandya313
@akashpandya313 2 года назад
Thank you 🙂 Easy to understand.
@felipequintero122
@felipequintero122 4 года назад
Thanks for sharing, it was very useful 🙏
@Andrei_Calazans
@Andrei_Calazans 6 лет назад
Great video, short but precise.
@Andrei_Calazans
@Andrei_Calazans 6 лет назад
After watching this video, I found that mongodb 3.6 has change streams which we could use to listen to change events and do something similar to what you have accomplished there.
@FredrikChristenson
@FredrikChristenson 6 лет назад
Glad you enjoyed it m8! Streams are a great fit for event sourcing, it brings a bit more complexity by using this approach but it has some very nice benefits to it as well. Have a great day and thank you so much for watching!
@nikolabozic3918
@nikolabozic3918 4 года назад
Thanks a log sharing his video was very useful. Can you make some video implementing CQRS, Event sourcing and RabbitMQ with microservices please. I read a lot of DDD CQRS, but never seen some real project example?
@FredrikChristenson
@FredrikChristenson 4 года назад
Sure m8 that could be fun.
@RayCh
@RayCh 5 лет назад
Great, best of all videos I have seen so far. Few doubts: 1. What if event source is saved but data isn’t stored assuming mongoDB crashed. As it’s not in a single transaction. 2. What if I repeat the last step without deleting the data?
@FredrikChristenson
@FredrikChristenson 5 лет назад
As long as you have the events you can recreate the state of your view so it becomes transactional even if the database crashes. Think of the events as a long list and the view as what you are left with if you repeat all the steps in the list, even if the view is broken or gone you can always just replay all the steps in the list and be left with the same view. If you didn't delete the data before you replay the events you would be left with two identical views but that is less of an issues since in order to recreate a clean state you simply drop your view database and run your events again to create them. Have a great day and thank you so much for watching!
@RayCh
@RayCh 5 лет назад
Fredrik Christenson But in production there might be billions of records. It’s not that easy to bulk insert so many events.
@RayCh
@RayCh 5 лет назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GzrZworHpIk.html
@FredrikChristenson
@FredrikChristenson 5 лет назад
Bulk insert would be very hard when using event sourcing yes and when I do this at work we do it by streaming the events over the course of an hour or two. This works for any size of dataset it just takes time to do it.
@geraldcampana9296
@geraldcampana9296 5 лет назад
Hi, great video. I have a question. What happen when error occurs in the middle of creating events?
@FredrikChristenson
@FredrikChristenson 5 лет назад
The reducer should at no point contain code that can fail but if there is an issue with the database connection we will simply ignore the event and either crash or return the unmodified view and logout the error depending on preference. Have a great day and thank you so much for watching!
@geraldcampana9296
@geraldcampana9296 5 лет назад
​@@FredrikChristenson Thanks! Is it okay to use transaction? When events creation fail, it will rollback.
@FredrikChristenson
@FredrikChristenson 5 лет назад
ofc, as long as the replaying of the events will result in the same view your data is consistent.
@geraldcampana9296
@geraldcampana9296 5 лет назад
got it, thank you so much!
@handerson171
@handerson171 4 года назад
What's the name of your vscode theme?
@FredrikChristenson
@FredrikChristenson 4 года назад
github.com/fChristenson/fc-configs/blob/master/vsc_settings.json Have a great day and thank you so much for watching!
@kaushikmani
@kaushikmani 6 лет назад
Can't you put it on github and share link, so we guys can give a deep look to code. If you can, it would be very good for us. well anyways Thanks for the tutorial
@FredrikChristenson
@FredrikChristenson 6 лет назад
Sure m8 here is the code: github.com/fChristenson/A-case-for-event-sourcing Have a great day and thank you so much for watching!
@kaushikmani
@kaushikmani 6 лет назад
@@FredrikChristenson Thanks i am trying to watch your videos one by one in my spare time i sent you connect request on linkedin
Далее
Scaling Event Sourcing for Netflix Downloads
50:50
Просмотров 35 тыс.
НИКИТА ПОДСТАВИЛ ДЖОНИ 😡
01:00
Просмотров 433 тыс.
Wildest 10 SECONDS OF HIS LIFE 🤯 @TomIsted
00:14
Просмотров 2,7 млн
Writing a good Javascript function
24:13
Просмотров 4,1 тыс.
Event Sourcing   You are doing it wrong by David Schmitz
43:05
Greg Young - A Decade of DDD, CQRS, Event Sourcing
48:04
Event Sourcing • Greg Young • GOTO 2014
54:25
Просмотров 94 тыс.