Please note this is improved version of previously[1] explained architecture.
Master Data Change Detection
- Admin Panel will change or add master data.
- Changes goes to DB.
- Update Hibernate First Level Cache.
- Distribute data via Kafka.
- Kafka Consumer detect master data change notification.
- Update Hazelcast Distributed map with which master data has been changed.
- Scheduler application task read from HZ map and get to know about which master data changed.
- Get latest data for changed master data from master data micro service.
- Update LocalEntityMap with business key and Entity.
- Update Business key to Primary key map.
- Removed master data notification record from HZ distributed map.
Scheduler Application Load Balancing
- Get Business key to primary key mapping to all master data.
- Update Business key to primary key mapping
- Read Business key to primary key map then load balanced among HZ cluster members.
- update HZ distributed map.
- Keep business keys which load balanced to local application node.
Processing using master data within scheduler task
- Read from HZ distributed map and get master data local to this node for processing and Keep them for processing.
- Take business keys to process.
- Get locally cached master data for business keys for processing.
- If can’t find in the cache get from micro service.