I am developing an app on Google App Engine. In that I am reading tweets and FB post/comments and saving respective domain objects in my DB. At the same time I can reply to tweet/FB post from my app itself while creating domain object for the same in DB.
FB Case: FB will post an event to registered URL of my application on new comment/post. So, I can take that event and process it. But when I post a comment/post from my app I am getting the event back from FB for the same. As my DB is eventual consistent there is no guarantee my existing check returns true all the time.
Twitter Case: I keep polling for new tweets of registered users using a job scheduler and create respective records in DB. But when I post a tweet from my app I will get back same tweet and as my DB is eventual consistent there is no guarantee my existing check returns true all the time.
So, I end up with duplicate data in both the cases. Is there a way to pass some extra info with FB comment/post and tweet, which I will get in turn with FB comment/Tweet. So, I can avoid re-processing them?