Welcome Guest, Not a member yet? Register   Sign In
Deliver views from Amazon S3? Thoughts?
#1

[eluser]otherjohn[/eluser]
Hi all,
As I am building this SaaS cms I am looking at cost and filesize management. With the potential of thousands of client view pages to store (custom designs, templates, etc) I am looking at storing those views on amazon S3 storage.

Is this possible (I think it would be) and are there any concerns with this?
The site itself will be on a an amazon e3 server.

John
#2

[eluser]Joël Cox[/eluser]
Hi John,

S3 only serves static files and thus can not be used to run your PHP files. You can offload things like avatars, attachments etc though.
#3

[eluser]T I[/eluser]
Hi John

You can manage your static files through amazon s3. very simple to upload from a php script. You can set your region so that it takes faster to be downloaded from the client end.

for more info, please look at there: http://www.haughin.com/2008/02/02/amazon...age-needs/
#4

[eluser]ccachor[/eluser]
John,

It sounds like it's much better to store these templates in a database rather than flat files. I'd also suggest some common template language/parser as well. That way you could even save revisions of a page/view. I'd only use S3 as a generic file server.
#5

[eluser]otherjohn[/eluser]
ccachor,
Your right, its funny how I am making this so much more complicated than it really is!
#6

[eluser]simpleCoder[/eluser]
I too have been thinking on minimizing the load on my database for my SAAS CMS and am thinking on a numbers of approaches

1.Store the content of the pages/articles as JSON documents on S3 . when the users requests the page , the CMS simply queries the JSON content file in s3 and uses it to display content to page instead of reading from the database. This is also couple by page caching on client

2.Cache the whole page in S3 and serve when user requests the page . When user modifies the page in the CMS, rebuild the cache on s3 and use this to serve pages . This might only be feasible for small sites . or you can write a cron to manage this in downtimes or commission another server to do this things.

Im keen to hear all other ideas .
#7

[eluser]Joël Cox[/eluser]
Hi John (Kevin),

Are you currently experiencing this kind of load on your DB? If not, leave it for later. Don't invest time on these things when you're not sure you will actually need them. Back to your proposed architecture, this system has few cons.

1) Slow. Compared to a local database, there is a lot of overhead. You first need to lookup the key in your database, make a request to S3, wait for it to return and decode the JSON.
2) Cost. For this kind of system, you look at almost twice the bandwidth costs, depending on your hosting provider. You have the incoming request from the client to your application, the request to S3, back to your application. Unless you host your platform within the AWS (let's say using EC2 or a third party) this can get quite costly.

When you really start running in to problems, I would start looking into a PHP cache, a document oriented database (I like MongoDB) or a front-end cache like Varnish.
#8

[eluser]simpleCoder[/eluser]
Joel ,
You have put it very well . Thanks for your feedback. Sometimes as developers we spend soo much time anticipating doom instead of just getting the app going then focusing on scalability as demand grows . Mongodb is great but am more of a couchdb guy .
I will try Varnish .




Theme © iAndrew 2016 - Forum software by © MyBB