Global variables

3 views
Skip to first unread message

kj

unread,
Apr 11, 2008, 5:00:50 PM4/11/08
to Google App Engine
If I create a global variable that is a list - and I add an item to
that list, will the global variable be updated on all of the servers
that the application might be running on? If not, any suggestions on
how to keep global variables in sync across servers?

Thanks,
Keith

Chris Tan

unread,
Apr 11, 2008, 5:17:53 PM4/11/08
to Google App Engine
As I understand it, multiple instances of your app will be distributed
across different servers.
To maintain state across app instances, you can use the DataStore api.

-Chris

kj

unread,
Apr 11, 2008, 6:05:38 PM4/11/08
to Google App Engine
Sure, but what I had in mind is a 'cache' of information that is in
the database.

I can read the info from the db and cache it on each server, but then
when something is added on server A, I need to make sure it gets into
the cache on servers B, C, etc...

Brett Morgan

unread,
Apr 11, 2008, 6:25:31 PM4/11/08
to google-a...@googlegroups.com
But that is what DataStore is designed for. It is a distributed data
store designed for scale. DataStore will replicate out your data as
required by usage. The more often you request a data item, the more
copies there will be of it across the cluster. This is how google file
system works, and thus this flows up the stack through bigtable and
into datastore.

So yes, pre-render your content pages on update, and cache them in
DataStore such that page renders are just retrieving the content and
displaying it. The back end infrastructure will do the right thing.

kj

unread,
Apr 12, 2008, 12:31:26 AM4/12/08
to Google App Engine
OK - so the Datastore is the only way to share global data across
apps. Got it.

On Apr 11, 3:25 pm, "Brett Morgan" <brett.mor...@gmail.com> wrote:
> But that is what DataStore is designed for. It is a distributed data
> store designed for scale. DataStore will replicate out your data as
> required by usage. The more often you request a data item, the more
> copies there will be of it across the cluster. This is how google file
> system works, and thus this flows up the stack through bigtable and
> into datastore.
>
> So yes, pre-render your content pages on update, and cache them in
> DataStore such that page renders are just retrieving the content and
> displaying it. The back end infrastructure will do the right thing.
>
Reply all
Reply to author
Forward
0 new messages