Hi Jeff..

yes it's a kind of "expertise test" but I know how to develop it in Java
and oracle db (local database where I can use table triggers, JPA and
java).. or any kind of other database like (mysql or derbydb)..

The problem is that I don't have knowledge on Google Cloud services (which
service to use to strore tables (bigQuery? any other options?)... (i.e if I
use AWS there are elasticbeanstalk which is entire system with app
container, database etc installed and ready to use / deploy war files)

Also what I don't understand is what are difference between memcache and
datastore (point 2.)

For backend logic I can develop simple servlet or webservice (just for test
purpose).
Let's say i have two tables in mysql (local db).. What is the way to create
the same tables on google cloud and use it with google  SDK in java?

I will try first to develop a simple service and deploy it on google
cloud.. then I must know what means memchache and datastore (what are the
difference and how to use them.. i will try to search also on youtube)..

but if someone has some good example please let me know
regards
PEter





On Tue, May 26, 2015 at 6:38 PM, Jeff Schnitzer <j...@infohazard.org> wrote:

> This looks suspiciously like some sort of exam question.
>
> Jeff
>
> On Tue, May 26, 2015 at 7:02 AM, Ryan (Cloud Platform Support) <
> rbruy...@google.com> wrote:
>
>> Salutations Peter,
>>
>> Welcome to the forms. There are many ways to do what you want to do. I
>> will answer from my personal experience but you will need to adapt to your
>> specific use case.
>>
>> 1) The user data I would store in the Datastore. It is designed to do
>> such work. I would index the players login name / email. I would then have a
>> repeated field
>> <https://cloud.google.com/appengine/docs/java/datastore/entities#Java_Repeated_properties>
>> that has a list of their friends. When the score is updated I would
>> retrieve the list of friends and check their scores. To increase
>> performance I would always do searches using key-only queries
>> <https://cloud.google.com/appengine/docs/java/datastore/queries#Java_Keys_only_queries>
>> .
>>
>> 2) Memcache is great if you need information quickly but is not
>> persistent. It can be flushed at anytime without warning. I would store
>> username (key) and scores(value) in it and always check there before doing
>> my checks in the datastore.
>>
>> 3) This one is tougher as you want % not fixed value. You need to have
>> another datastore kind that would keep a running count. Counting entities
>> in the datastore (when scaled up) is long and costly.  It is recommended to
>> keep a running count. To keep the number of reads under control you need to
>> manage when the list of badges is updated. I would update the list only
>> when needed. Keep a datastore kind that has a list of thresholds. If
>> someone adds a friend and it goes above the threshold update the badges.
>> There are other options depending on how often the badges would be changing
>> or how often they would be read.
>>
>> Keep in mind this is how I would do it, others will have other ways that
>> might match your use case better. These are recommendations based of my
>> experience not a end all guide.
>>
>>
>> On Tuesday, May 26, 2015 at 8:04:11 AM UTC-4, peter valencic wrote:
>>>
>>> Hi,this is my firs post on this group.
>>>
>>> I'am looking for some clarification about using google app engine with
>>> java.
>>> I have this kind of problem to resolve: (It's quite simple for me to do
>>> this in java and oracle database with oracle tables and triggers but in
>>> this case I must use only google APIs to do so)...
>>>
>>>
>>> "*You are responsible to implement a backend feature for new **app.
>>> This feature is a internet site. It looks like this:*
>>> *main **point of feature is to notify users when one of their friends 
>>> **overtakes
>>> them in a game (lets say it has more experience) **thus*
>>> *each user might have friends (or it might not have) *
>>> *API **call is made to backend each time user gains experience (assume
>>> you **get this info)*
>>>
>>> *if **user has just overtaken some of his friends, a API call is made*
>>> *to send him a notification (assume function to send notification
>>> exists)*
>>>
>>> *if user **is registered first time it gains experience **API **call is
>>> made to backend for each new friend user has added (or*
>>> *removed)*
>>>
>>> *Backend is implemented on Google App Engine (GAE) in Java language.*
>>> *Describe how would you do the following:*
>>> *1) use GAE services to store user data (user himself and friend list)*
>>> *Where would you store user data? By what it would be indexed, based on*
>>> *requirements/flow above?*
>>> *Consider cost and performance (scaling).*
>>> *2) GAE provides memcache service, how would you use it to minimize*
>>> *reads from datastore (mamcache is free, datastore is not)*
>>> *3) Product management has come up wiht new feature: friend size badge!*
>>> *This is a feature that works like this:*
>>> *10%*
>>> *users with most friends get gold badge*
>>> *top*
>>> *30% get silver badge*
>>> *top*
>>> *50% get bronze badge*
>>> *How would you change your design from question (1) to be able to*
>>> *determine users badges in realtime (in API call handler)?*"
>>>
>>> Can someone drive me trough this case or give me some advice on this?
>>>
>>>
>>>
>>>  --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-appengine/9ea486c9-9735-4dde-8864-e3a090c1d8f2%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-appengine/9ea486c9-9735-4dde-8864-e3a090c1d8f2%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAOA6Xr%2BhgY4KkWePj95F0S3K-XTHmADCU3ys-tEPs9i%2BWUZH0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to