Is using Amazon s3 as a database (of sorts) for a PHP app a bad decision?
I'm teaching myself JavaScript and PHP by building an app, and I decided I would like to use Amazon EC2 and S3 as the platform. My question is about using S3 as a "database", but I'll start with a bit of background.
The app uses this class to interact with S3 buckets: http://undesigned.org.za/2007/10/22/amazon-s3-php-class/documentation#getObject
When a user logs into the app, the app will download a file from a S3 bucket. Every user has their own file. Using JSON, it will then bring the data client side, and then most of the "interaction" is client side (using JavaScript) and a bit of PHP. Once the user is done (probably after 30 minutes or so), the app will then save/upload and replace the S3 file.
My reasoning behind all of this is that I think the app will be very scalable. My hope is that I can use load balancing,开发者_如何学编程 with each instance being able to interact directly with S3. If lots of users log on, I can simply create lots of "micro" or "small" instances to handle them all. One of the drawbacks of EC2 is if the instance crashes or goes offline, all the data is lost, so my thoughts are that instead of constantly having to back up everything - why not build the app around S3 in the first place?
My question: Does this make sense? Is there a reason I haven't seen many examples of this kind of thing "in the real world"?
Thank you so much for your time!
Cheers,
I just visited this site that has a good description of experiences with using S3 as database
http://petewarden.typepad.com/searchbrowser/2010/10/how-i-ended-up-using-s3-as-my-database.html
Have you seen Amazon SimpleDB?
Creating your own datastore and storing it on S3 doesn't sound that practical, especially as you have to upload and download a file every 30 minuites, that hardly sounds scalable to me! What if your server goes down or the file gets lost?
You can run MySQL and other databases on Amazon, why not back those up (say daily) to S3 instead.
精彩评论