#3: CDNs, DNS and Choosing a Database
What this lesson covers
With a server in place, this lesson looks at how users reach the store's web pages. A web page is a static file of HTML, CSS and JavaScript, and it can be served either from the application server or from a content delivery network. The video favours a CDN such as Akamai or Amazon CloudFront: servers spread across regions return pages with low latency, and a provider serving many customers can do this more cheaply than a team building its own. Only static content such as banners, images, videos and product descriptions goes on the CDN. Dynamic data like stock counts stays on the server as a single source of truth, illustrated by a T-shirt with 50 pieces left that could be oversold if copies in the US and India each accepted orders before reconciling. Files reach the CDN through a file store it watches, and the lesson picks Amazon S3 over self-hosted options such as HDFS or Ceph because it is managed and durable. It then walks through DNS: the browser, via the ISP, asks a domain name server to map the domain to an IP address, and resolution can be delegated from GoDaddy to Route 53 so the domain points at CloudFront. Finally, it advises picking a familiar database, defaulting to SQL for its maturity and ease of analytics, rather than spending days on the choice.
- Serve static assets from a CDN for low latency across regions
- Keep dynamic data such as stock counts on the server as the single source of truth
- Use a managed file store like Amazon S3 as the source for the CDN
- DNS maps a domain to an IP address and can delegate resolution to Route 53
- Early on, choose a familiar database; SQL is a safe default