database for simplicity. • MySQL, by default, stores each table as a single file. • Event store eventually came up to about 1.5TB and was constantly growing as it had events related to wallet transactions. • It became cumbersome to handle a file that big and make backups etc.
store if not found in main event store. • Archiving performed using a separate utility that creates snapshot and moves older events to a flat file with a memory mapped index file. • Flat file used for the simplicity of working with it. • Solution eventually scrapped due to some problems.
help us design a better event store. • Use an auto increment ID. • Store aggregate identifier as binary. • Partition the table. • From the application, we started using aliases for event classes.
the application, triggered at specific intervals, or manually using JMX. • Creates snapshots, and exchanges partitions on MySQL. • Does not affect performance.
eventual is your eventual consistency?) • One way to handle the increase in load is to scale the application horizontally. • Main requirement: all events coming from a particular player must be handled sequentially. • RabbitMQ makes it easy with its ordering guarantees.
guarantee. • Use an asynchronous cluster (@Asynchronous): queues are built in memory, and there is no "clean" shutdown. • Shard the queue on RabbitMQ itself. • Choose which consumers you want to shard from the code using @Partitioned.
and queue puts a lot of strain on our SAN. • As load increases, an IOPS ceiling is reached that was affecting our response times. • Possible solutions: DisruptorCommandBus, infrastructural changes, or a home baked solution.
events shovelled towards main bus Other services’ events shovelled into service specific bus Service Service only publishes towards and reads from specific instance
event sourced systems. • This really depends on the size of the event store. • Fully asynchronous approach: read from one thread, apply events in another thread, persist in another thread. • Using blocking data structures while waiting for things to catch up severely affects performance. • Queue buildups may also cause system to go out of memory. • Apply back pressure.