Skip to main content
2 of 3
edited title

How do I build my application with high throughput in mind? (Need guidance)

I am building a Spring boot REST API app that is part of a microservice architecture project. What I am planning:

  • My app listens for events from two other services and after some business logic, logging, calculating, and persistence I have to publish my results to another rabbit MQ exchange.
  • The first two services listen to pings every 10 seconds from 15,000 devices each and publish their data to queues that I listen to.

My current plan:

  • I need some sort of cache to keep track of events sent from both services because I need data from both at a time interval to do my logic. I am using an in-memory hashtable and I am sorting the values in this hashtable everytime I update it.

  • My hashmap is a Map<String, Map<String, Instant>> where the first key is a regionID and the second map is keyed based on deviceID. This sorting is done on the internal map and I suspect might become the bottleneck.

Is this scalable with the amount of data I'm expecting? Do I need some other form of fast storage that will work with my cluster once I go live with multiple instances of my app?