Kamran Javed
Hello Everyone i am working on MERN Stack since last 2 Years. i am having a question which is related to "REAL TIME LOCATION SYSTEM" and my Question is
Q1:- My client has 1000 devices which is implemented on some cars, forklift or some of in the human hand , and he want to track every single device location and see on his display Real-Time. My question is how to track all device information at a time . I am using MongoDB for database. I plan to solve this problem using develop a API with the combination of the hardware SDK which will trigger after every 3-5 sec. but can this is the best approach that the data first go to the DB then by using web socket its displayed. can its not delayed ? and if not then what is the best ideal way to achieve this?
Q2:- i have calculated the data size which is generated by all device is approx 400-500GB every month & i have to take record of last 3 month data. Now as i am using mongoDB as DB so how i can minimize the size and maintain High Scale Availability?
Q3:- And the most important one is Client want to deploy the APP Locally. I am using nodejs and Express for creating Server in the back-end development . If anyone know any way how to store real time data please help?
You put to the database data from each device but for your application, you should read object with data of all devices. I think mongo isn't the best choice for that. Maybe postgres will be faster. If you have too much data you can save data to database each 3/5/30/60 seconds. You can put all data to some fast storage, like redis, and save it to the database every few seconds. You will lose some data, but you will save space.