Home / Companies / MongoDB / Blog / August 2019

August 2019 Summaries

2 posts from MongoDB

Filter
Month: Year:
Post Summaries Back to Blog
The bucket pattern is used for efficient paging by storing multiple trades in an array within a single document. A reasonable bucket size of 1000 trades can display history from any page quickly and efficiently, reducing the number of documents that need to be fetched. Data insertion into buckets can be done using an update statement with `$push` and `$inc` operators, which add new trade history and increment the count field atomically. The `upsert` modifier ensures that a new document is created if no bucket exists or contains less than 1000 trades. This approach has limitations, such as gaps in data when removing trades, but can be an effective solution for many use cases with excellent performance.
Aug 05, 2019 1,155 words in the original blog post.
The Bucket Pattern is a data model design approach used in MongoDB to improve paging performance. It involves storing related data points over time as a single document, with fields that duplicate across the original documents condensed into the root of the new document. This approach allows for efficient storage and retrieval of data, enabling fast page loads by reducing the number of documents retrieved from the database. By using this pattern, developers can store information as it's needed for display, making it easier to implement pagination with minimal latency. The Bucket Pattern is particularly useful when dealing with large datasets that require frequent paging, such as stock trade history or other time-series data.
Aug 01, 2019 1,210 words in the original blog post.