views:

530

answers:

2

I'm reading up on Google App engine and I'm thinking of using it as a CDN for a project I'm working on. As far as I can tell, there's two ways to store data. I could use a datastore or I could put files in a directory.

I was brought up believing it's a bad idea to store large binary data in a database, but according to Google, the datastore isn't an RMDB, it just acts like one.

So my gut is telling me to upload files to a directory. However, I thought I'd best canvas an opinion on here before making my mind up.

Has anyone used GAE for stuff like this? And if so, what method did you choose for storing files, and why?

+3  A: 

You cannot write to the file system in App Engine. You need to use the Datastore to store any data.

Note that if your "large binary files" are actually large, you're going to run in to the 1MB limit on all API calls. An API for storing larger blobs is on the roadmap, but there's no way of knowing when it will be released. At present, you need to split blobs larger than 1MB into multiple datastore entities.

Wooble
I just spotted the 1mb limit. That throws a spanner in the works. I need to store MP3s which will usually be between 3 and 6 mb. So it's back to the drawing board.
gargantaun
The Blob API is coming out soon, which will make it possible to store and retrieve much bigger files.
Nick Johnson
I hope Nick is right because even if you are under the 1MB limit, you will hit the "data retrieved from DB" quota limit too. That is a more insidious problem, blobs or no.
jhs
Just an update, this is no longer true. There's Blobstore which can store files up to 50MB.
intgr
+1  A: 

The blobstore API lets you store files upto 50 mb ,though its an experimental api and requires billing be enabled.Also its its different from bigtable.

http://code.google.com/appengine/docs/java/blobstore/

Bunny Rabbit