-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch the cache implementation from a simple LRU to the bigcache library which provides better performance and reduces the need for garbage collection. Further improve the cache by reducing the size of keys, by adopting hashing of keys and thus storing smaller data in the cache. Hashing also allows for detecting changes in a larger surface of the data. While todays keys are based on the event type and resource metadata, we can now include conditions in the equation as well, to provide and enhanced logic for event sending. Storing a resource metadata and its condition in the hashed keys means we can detect immediately if no relevant change was made in a resource, and quickly finish the reconcile cycle. Additionally storing the event type along with the resource metadata, means that we can detect if a specific message was already sent for a specific resource. To be able to rely on the cache to decide which event to send, we need to ensure that reconcile cycles for the same resource are never executed concurrently. To achieve this, the thread number (or concurrency) is set to 1 in the controller. Scalability needs can be addressed by scaling the events controller horizontally. The sharding of resources across instances of the reconciler is based on the resource key, so the same resource will always be directed to the same controller thus avoiding any cache miss. Signed-off-by: Andrea Frittoli <andrea.frittoli@uk.ibm.com>
- Loading branch information
Showing
16 changed files
with
483 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.