Skip navigation

Category Archives: Uncategorized

General requirements for

  • Store jacket file structure in S3 and metadata in SimpleDB fronted by memcached
  • Register jacket S3 bucket for use in CloudFront (for speed for our users)
  • Auto cluster EC2 instances will provide application to users
  • javascript based plugins for all browsers we support talk to backend cluster
  • php backend to act as web service answering calls from javascript frontend

More details

Create jackets bucket in S3 and store by jacket id, i.e.,

Use a hierarchy within the S3 jackets bucket for jacket assets:


Create New Jacket (theme):

  1. user uploads a new picture
  2. system generates a new facebook theme (css) from the given picture
  3. user can tweak the following generated parameters; palette color, background attributes
  4. user can also tweak the css directly
  5. user saves final jacket (public or private)

Create New Jacket from existing:

  1. user chooses jacket to tweak
  2. goto step 3 of “Create New Jacket” above

Trying to figure out how to solve the “eventual consistency” problem with Amazon’s SimpleDB.  Putting an attribute in SimpleDB and immediately reading it can bring back old/stale data and might not reflect the attribute we just “put”. Good reading:

A layer of memcached servers can solve the issue. Here’s the strategy to use for the memcache layer:

  1. readers and writers read from memcache first to determine if something in cache
  2. if reader and nothing in cache (becomes a memcache writer) or if writer, lock the item for writing using add() function (wait until successful add)
  3. once you have lock, get or write from db and write to memcache, then remove the lock

This strategy should insure only one writer at a time to memcache.  The memcache data can then be reliably used by writers.