Fintech app best practices

We plan to use ESDB for a fintech application. The current plan is to have streams for every user.

It’s clear, that at some point there will be many events in a stream. What are the limitations here. Is it a good practice to archive streams, let’s say every month (or any other reasonable period).

If someone could recommend resources for best practices for a fintech app, I would appreciate that.

Good day!

We usually recommend that you use many shallow streams instead of fewer deep streams. This optimizes for reading. That said, there is nothing wrong, per se, with your approach

It is always good practice to have an archival and scavenging strategy. Snapshotting can also help you make reads faster in the case of having streams with a larger number of events in them

Without knowing more about your use case, it’s hard to give more tailored advice. Are you currently working with any of our team members by chance?

Hello,
thanks for the response.

No, we are not working with anyone.

I can tell more about our use case. We are designing the financial part of a betting platform. Basically it includes a couple of events: Deposit money, bet creation, bet cancellation, bet won, withdrawal. We don’t handle actual payments in our platform.
Users have different wallets (bonus, withdrawable, playthrough) , and I plan to calculate user balance for every wallet based on event types.
Do we have an approx threshold how many events should a stream have to be considered deep. Is it 10K, 100K or 100.

Thanks

Often-wise, the number of events in a stream is naturally limited by the use case, if you look deeper into it. For example, I discussed this concern with people who use event sourcing in a bank. They said the same - long streams. But, in banking, you’d normally have one stream per calendar period, most probably one month. So, it’s not an “account stream” but an “account month” stream.

I am not sure if it applies to your use case, but it might give you some ideas.

Thanks, I think we’ll start with yearly streams, then will switch to monthly ones as needed