CDN stands for Content Delivery Network. It’s a method of delivering content to your users by hosting it on multiple servers positioned around the globe. Visitors get faster access to content and resources as they are directed to a server that is geographically close to them.
A CDN can be run in-house but more often it is handled by a large third-party hosting company. Good examples of CDN providers are Amazon or Edgecast. The disadvantage of CDNs is one of latency as content takes time to spread across the network. Without proper application design that takes this into consideration users can be requesting content that is not yet downloadable in their region
An index on a database table is similar to an index in a book in that it help the database finds or sort rows on a particular column quickly. Queries run faster if they are searching or sorting on a column that is indexed than if the column were not indexed.
It would however be inefficient to index all the columns in a table as this would slow down the write speed. Every time a new row is created, or an existing one altered, the database server wold have to update the table as well as all the indexes. Usually only the columns most used in queries are indexed.
Sharding is a load management technique used to split databases across multiple servers. Most sharding works on the primary key or some other index being modulus with the number of shards in order to decide where o tore that information.
For example, the primary key may be 7 and there may be three shards. 7 % 3 = 1 (when seven is divided by three there is a remainder of one?) so this record would be stored on the first shard.
Sharding can boost performance dramatically but is heavily disadvantaged when writing complex queries as these may need to have aggregate results from multiple servers. Applications should be designed so that they shard across dimensions that don’t usual mix (e.g. Users of an e-mail system).