Are you on Java, Go, or Python?  On Java, Objectify will use memcache for 
object storage, so you use queries (to get the keys), but not reads.  This 
would abstract away the cache usage in both situations so it's automatic.

It's not for everyone, but worth looking into.

On Sunday, March 17, 2013 10:25:38 AM UTC-5, Marc Seiler wrote:
>
> Hey guys I am somewhat new to appengine and memcache and I am struggling 
> to set my stuff up properly.
>
>
> I have 2 different situations for the same dataset I need to figure out 
> the best way to handle it.
>
> ---------------------------------------------------------
>
> First situation: On the devices checking in. Some check in very fast 
> because they need to keep the service up to date with the newest 
> information while some check in much slower. Doing this I learned that 
> appengines free quota on read/write operations can be ran through rather 
> quickly. So I started researching the memcache features. The problem is I 
> am not sure how to use memcache with this type of thing but I have come up 
> with 2 different methods and I ask for your help on chosing or being told 
> that I am doing it stupid. The main requirement for later is that it has to 
> be searchable by user because devices are attached to users and each user 
> can have multiple devices. 
>
> Method 1: When devices check in I store each one in a separate key/value 
> pair in memcache and then have a global list in a key/value pair for each 
> user that gets updated on new devices or when devices get deleted. The 
> global list is So I can use get_multi to get the list all at once.
>
> Method 2: When a device is checked in a key/pair is pulled for that user 
> that contains that users list of devices and it is updated accordingly. 
> Then the key/pair is pulled when needed later.
>
> Both of these methods will also update a database for that device if it 
> changes so we always have a database copy. The memcache is mainly what I am 
> using to detect the changes so I make minimal read/write requests to 
> database.
>
> On top of not knowing which method is best if either one is at all I am 
> not sure how I can set this up to repopulate them from the database if it 
> ever goes away in memcache. This part I am sure I can figure out but I come 
> to you guys and girls to see if I am even starting properly.
>
> ---------------------------------------------------------
>
> Second Situation: Listing the devices for the users on the site so they 
> can control them. I was thinking since this is going to be way less 
> frequent that I wouldn't really need to use memcache at all but I also 
> thought that devices checking in like they did wasn't a big deal either 
> until appengine said oops out of free quota lol. So..... I was thinking I 
> should be using memcache but I was worried about losing search capabilities 
> THEN I thought maybe I could use angular.js to pull the devices and do 
> client side searching. Thoughts?
>
> ---------------------------------------------------------
>
> All in all I am really lost and in over my head on this and I love it :P I 
> am really REALLY impress with the appengine service and its been super fun 
> developing for. its been days and days of staring at a screen going wtf do 
> I do now. If anyone has any good resources/books for me to read I would be 
> very thankful.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to