Lee Marzetti
Lee Marzetti

Reputation: 1

Google app engine: how to store and retrieve a single variable

I'm new to app engine (and SO)...

I'm writing a twitter bot that replies to mentions. Wanting to remember the last tweet it replied to using since_id but im not sure of the best way to store that ID so the next time the page loads it can check it, reply to any since, and then overwrite and store the new ID.

Do I use memcache for this?

Cheers!

Upvotes: 0

Views: 354

Answers (1)

Wooble
Wooble

Reputation: 89897

Unless you're fine with losing the data, don't use memcache for data storage; it should only be used as a cache. The reason for this is that although you can set how long it should keep this data, it's documented that it can delete it at any time.

Create a datastore entity to hold the object.

example:

class LastTweet(db.Model):
    since_id = db.IntegerProperty()

Upvotes: 1

Related Questions