-1

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?

Pokuri
  • 3,072
  • 8
  • 31
  • 55

1 Answers1

0

If I understand correctly what you are trying to do; no, that is not possible.

If what you're trying to do is add an extra "field" to the FB post/Feed at the moment of creation, sending that to FB/Twitter and getting that back when you poll. That can't be done.

Instead, you should use the ID you receive when you create a post/tweet. You can store that already in your DB (or, maybe better: after creation poll it again, using that ID, and then populate your DB).

Besides from that; why do you want to store the posts/tweets in your DB?

Roemer
  • 3,566
  • 1
  • 16
  • 32
  • Thanks. Yes, now I am saving those with ID I got from FB/Twitter. So, storing again with same ID will just override existing data. And for your question: I store data as per my business requirement – Pokuri Aug 16 '15 at 15:38