i am facing issue with comparison
If you want help, you'll tell us what that issue is.
What are you sending the binary data to, with the Serial1.write() calls?
Why isn't the code to dump the existing data in a function that you call from loop()?
Serial1.write(message, sizeof(message)); // sending command to the module
What module?
Why do you need to dump the existing array TWICE?
// HERE I NEED TO DO THE COMPASSION AND THEN ADD IT ,IF ITS NOT IN THE DATABASE
SO, WHY DON'T YOU?
Why are you screaming? We DO have closed captioning, even if we can't hear.