Using an RDBMS as event sourcing storage

前端 未结 6 1671
灰色年华
灰色年华 2020-12-07 07:02

If I were using an RDBMS (e.g. SQL Server) to store event sourcing data, what might the schema look like?

I\'ve seen a few variations talked about in an abstract sens

6条回答
  •  粉色の甜心
    2020-12-07 07:54

    I reckon this would be a late answer but I would like to point out that using RDBMS as event sourcing storage is totally possible if your throughput requirement is not high. I would just show you examples of an event-sourcing ledger I build to illustrate.

    https://github.com/andrewkkchan/client-ledger-service The above is an event sourcing ledger web service. https://github.com/andrewkkchan/client-ledger-core-db And the above I use RDBMS to compute states so you can enjoy all the advantages coming with a RDBMS like transaction support. https://github.com/andrewkkchan/client-ledger-core-memory And I have another consumer to be processing in memory to handle bursts.

    One would argue the actual event store above still lives in Kafka-- as RDBMS is slow for inserting especially when the inserting is always appending.

    I hope the code help give you an illustration apart from the very good theoretical answers already provided for this question.

提交回复
热议问题