How to prevent duplicates while storing result from different application
You can add unique key constraint on the db table , the table itself will prevent the second application to insert duplicate data and return error code such as "unique key violation" ,  in the application you will need to handle this error/exception.