La mejor estrategia para almacenar datos dinámicos

I am developing a twitter client for android.
I'm doing this a practice project and I need some help regarding storing the tweets in the timeline.

Can anyone suggest the best strategy for storing the tweets in the timeline?

What I need to do is to store the tweets in the database:

  • a max of 50 tweets
  • when newer tweets are available then add newer ones
  • but still making sure that the elements in the database does not exceed 50

And also I intend to set an expiration date for the tweets, that is to delete all the tweets in db if not updated for a certain amount of time.

I specifically don't need code. Just a strategy/algorithm to get me on the right path. What do the apps in the android market employ?

preguntado el 01 de febrero de 12 a las 14:02

2 Respuestas

I think that it would be the best to write a database trigger which would remove oldest entry upon inserting a new record, if total record count exceeds 50. Shouldn't be that hard, since almost all databases support database triggers.

Respondido 01 Feb 12, 18:02

Ohh...okay did not know about triggers...thanks for the info...will try it out... :) - avatsav

I just answered this question for someone else. Use a trigger like in this

contestado el 23 de mayo de 17 a las 14:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.