Hello,

I am sorry for my late answer. I am trying to implement kind of
authorization
system to access certain service. This service is only available for
example

X times per Y seconds (x = 5, y = 60 * 15)
each request to this service is identified by uniqueID so I know who
is asking the service

I use memcache to find out how many requests there were in last Y
secs.
If number of requests is lower or equal to X I try to put another
different entry to cache which contains current date (current app
instance date).

Subsequential requests retrieve this date from memcache and use it to
compute remaining time to next RESET.
RESET is meant to be time when first cache entry expires and thus
reset number of attemps to request my service.

(more simple)
I put some date to memcache for example (currentDate + 15 mins), next
time I retriev this date, but it can be different app instance than
which made the entry. If I do some computation like
(dateFromMemcache.toMilisecs - currentAppInstanceDate.toMilisecs) this
may
vary for app instance.

If different for different instace is only few milisecs or secs, it's
ok.
But if it is more than 1 min or even more that would be problem.

Any simple idea how to cope with this ?

> On Jul 22, 3:04 am, "Ikai L (Google)" <ika...@google.com> wrote:
> It should just be whatever the date is on the current instance. In general,
> do not ever rely on dates to be synchronized. Clock skew is a reality of
> distributed computing, and you'll have to work around it. What exactly is
> the problem you're trying to solve?
>
>
>
> On Sun, Jul 18, 2010 at 11:23 PM, Marcus Brody <mhrab...@gmail.com> wrote:
> > Good day,
>
> > I would like to ask about following.
>
> > How is java.util.Date synchronized in case there is more than 1
> > instance of my web application.
> > Example:
>
> > WebAppInstance01 : I create somewhere new Date()
>
> > at the same time
> > WebAppInstance02: I create somewhere  new Date()
>
> > Is there some time shift ? Or those both app request some "central
> > authority" ?
>
> > Thank you,
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blog:http://googleappengine.blogspot.com
> Twitter:http://twitter.com/app_engine
> Reddit:http://www.reddit.com/r/appengine

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to