- The project consists of the following microservices.
- Instructions on how to run these projects is given in their respective
README.md
Eureka
is used for microservice discovery along withSpring Cloud
for loadbalancing.- The service Location-Writer is used to recieve location data. Since there will be a lot of request coming to this end point I've created multiple instances of this service which are loadbalanced.
- The loadbalancing startegy is the default
Round Robbin
, I've also created a custom strategy based onURL hash
for server stickiness. The reason for this was because we have multiple instances ofLocation
microservice, the data of a particular user would be distributed, making pagination and data retrieval complex. - However my custom
URL hash
load balancer depends on number of instances for server stickiness, so if instances increases the data would be distributed again. - Keeping this in mind I created another microservice Location-Reader which would sync with the Location-Writer.
- The Location-Reader's database would have partitions as well as indexes for fast retrival.
- These two databases sync with each other by an Async method that send location data through kafka from Location-Writer to Location-Reader. (Previously I used Debezium but that seemed over kill, as well as a few problems I faced with Debezium connector).
- In Location-Reader Database
Location
is partitioned based onuser_id
column for fast retrieval since a user can have thousands of entries. created_on
column has been indexed as well for doing time frame query.- The
id
column is an auto-increment column so the latest location of the user is the last value inserted in the partition.
-
Notifications
You must be signed in to change notification settings - Fork 0
mhdzaid/CQRS-Pattern
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published