0

Say I was creating a hosted application like wordpress, where people manage their blog.

The key point I am focusing on is sychronizing the template pages between all my servers.

So each customer would have 5-10 templates, and say I am running 10 servers.

Any time a customer modifies a template, it would have to be synch'd to the 10 servers.

10000 customers * 10 templates = 100K files.

Say I keep a backup of the templates so they can revert to a previous version, that is now 200K files.

I want to avoid having the template files on a NAS or something because I want to use ec2 for this.

Anyhow, my real question is, is keeping 200K files synchronized between servers something that is manageable or is that allot of files?

I don't have experience with managing files as I normally put this sort of thing at the database.

My initial idea is to do this:

  1. save the template in the database
  2. keep a local copy of the templates on each server so I don't have to fetch the template from the database as that will too much kb flying around that i want to have.

In reality the templates won't be changed that often, but really I have no idea at this point how often they will be changed but I would imagine early on people will change them until they get their layout setup as they want it.

Thoughts?

Blankman
  • 2,841
  • 10
  • 38
  • 65
  • possible duplicate of [Can you help me with my capacity planning?](http://serverfault.com/questions/384686/can-you-help-me-with-my-capacity-planning) – Tim Brigham Mar 17 '14 at 02:03
  • Why are you synchronizing the files amongst 10 servers? Are they load balanced, or are they backups or ....? – Slartibartfast Mar 17 '14 at 02:09

1 Answers1

1

Have you looked at using version control for the templates? Users would update their templates and commit their changes. Then either periodically, or via a triggered process, the templates would be updated.

Given the size of your infrastructure, it might be appropriate to provide a development server where users can edit and test their templates.

This would making tracing which changes were made simpler and provide better reversion capabilities than a singe backup file. It could also be used to scan for some code injection issues on the production servers.

This should scale better than copying files as only changes are transferred.

BillThor
  • 27,354
  • 3
  • 35
  • 69