8000 Trade Data Database · Issue #27 · sneilan/stock-exchange · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Trade Data Database #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sneilan opened this issue Nov 27, 2023 · 0 comments
Open

Trade Data Database #27

sneilan opened this issue Nov 27, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@sneilan
Copy link
Owner
sneilan commented Nov 27, 2023

Implementation Notes

  • Use sqlite write ahead log to journal trades. Leverage SQLite for WAL and atomic commits instead of apache avro. Can tune settings for performance.
  • Rotate trade journals by storing no more than 100k trades per file. Filename should be unique. Can put trade id / date etc in filename but rely on database because storing metadata in filenames is less scalable.
  • Take checkpoints of market depth and event store in sqlite too.
  • Track checkpoints in database to say which trade ID was latest when checkpoint taken.
  • Restore checkpoints in sqlite to memory by deserialization.
  • Do not save / restore checkpointed data by pure memory because the pointers to mmap buffers will misalign on reload. Plus saving memory data directly will also save any memory fragmentation.
  • Replaying trade journals should result in correct system state.
  • Add tests to make sure journals / replay work.
  • Define data structures to store this.
@sneilan sneilan added the enhancement New feature or request label Nov 27, 2023
@sneilan sneilan self-assigned this Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
< 375D /div> None yet
Development

No branches or pull requests

1 participant
0