amazon s3 – Storing files (videos/images/music) in CouchDB/Cloudant vs CDN (CloudFront)? – Education Career Blog

I am new to CouchDB/Cloudant and CDN (CloudFront).

I am about to build an application using CouchDB as database.

This web application will handle a lot of files.

I know that CouchDB can store files in the database as attachments. But then I have heard about leveraging CDN to store and distribute the files all over the world.

My questions:

  1. How is storing files in CouchDB compared to CDN (CloudFront)?
  2. How is Cloudant’s service compared to CDN (CloudFront)?
  3. Is Google storage also a CDN?
  4. What is the difference between Amazon CloudFront and S3?
  5. Do I have to choose to store files either in CouchDB/Cloudant or CDN, or could/should I actually combine them?
  6. What are best practices for storing files when using CouchDB?

,

Some of these questions are based on your specific implementation, but here’s a generalization (not in any particular order):

  • Unless they have Cloudant mirrored on numerous servers around the world (effectively a CDN in its own right, just sans static files), a true CDN would probably have better response time, depending mostly on how you used Cloudant (eg, you might get good response times, but if you load the entire file into memory before outputting it, you’re losing the CDN battle).

  • CouchDB has to process more data server-side before it can output an attachment.

  • CloudFront (and CDNs in general) are optimized for the fastest possible response time with the closest server.

  • S3 is only storage; CloudFront uses that storage and distributes it across many servers that serve the content based upon which one is closer to the user requesting that content.

  • Yes, you have to choose between Cloudant or the CDN; one stores them in the filesystem verbatim, the other stores them in the filesystem within the database.

I don’t know the answer to some of these, eg, how CouchDB actually handles attachment storage at a low level, nor its best practices, however, this should give you enough of an idea to at least start thinking about which suits your needs best.

Leave a Comment