开发者

Google AppEngine database

开发者 https://www.devze.com 2023-02-15 12:34 出处:网络
I\'ve been reading a little about Google\'s AppEngine that provides application hosting. I\'ve been trying it out as I think it looks quite interesting but I\'m a bit concerned about the database part

I've been reading a little about Google's AppEngine that provides application hosting. I've been trying it out as I think it looks quite interesting but I'm a bit concerned about the database part.

Say I'm developing my Java app locally. I don't want to deploy to Google every time I make change to the code, so I setup a nice little Servlet container on my development machine to test things easily. With AppEngine you store things using their datastore API, which basically lets you model your data using Java objects - which is nice.

However, it seems like this data is embedded in the app开发者_运维问答lication code itself (inside the .war that is deployed to Google). Can I simply use their datastore api locally? How will it be stored on my local machine? Is this all handled by them so that I just have to worry about using the datastore API and when I deploy it to Google the data will just be stored in a different way than how it's stored on my local machine?

I'm just a little confused because I'm used to having the data part layered out of my application code.

I hope I'm clear enough. Thanks.


Development datastore and Production datastore are two different and separated things:

Development datastore is tipically a file based datastore named local_db.bin that it's just useful to store your data in your testing environment; the data is not replicated to the production environment when you deploy your application.
This kind of datastore is meant to be used with a fairly small number of entities and its performance has nothing to do with the powerful Production datastore beast based on Big Table.

All you need to do is to use the Datastore API that creates a level of abstraction between your code and the underlying datastore; in testing your data will be stored in the local datastore file, in production the created data will be saved to the Google App Engine datastore with all the features and limitations that this implies.

0

精彩评论

暂无评论...
验证码 换一张
取 消