We want to monitor service response times by storing the startime , endtime, user , server node and in case if the service failed, then the exception details also needs to be stored .
We do not want to go for an expensive relational DB to store this data . If we go for JSON structure like below , would MongoDB be a good choice ? Are there any other DB recommended for this usecase?
{
startTime:"01 Nov 2021 10:00:00"
endTime : "01 Nov 2021 10:00:03"
user:Tom
serviceName: retrieveCustomers
serverIp :127.0.01
error : {
errorStackTrace : "Null pointer exception...."
}
}
Please note we should be able to query transactions by user name , transactions which took more than 5 seconds , error transactions etc.
CodePudding user response:
More context would be required to answer this question. But let me tell you my perspective here:
I would use the ELK
framework here instead of Mongo, as Search
/Aggregation
is way faster in Elastic Search
than in MongoDB
.
Note: The statement above is based on my experience with both Elastic
& MongoDb
by running aggregation over a data set of 50M on similar kind of machine.