Secrets of a High Performance Application
Unlike my previous article, this one is slightly technical as I delve deep into the basic IT infrastructure that makes an application solid (does not crash, loads up fast, etc). This will all be explained in Lyman terms, hence, I hope you can find this interesting even if you do not have a technical background.
Nobody notices a highly performing system. But when a system is not performing well enough, users quickly start complaining. We usually take performance for granted in applications like LinkedIn, Facebook, YouTube, etc. Statistics show that 65% of 18-24 year-old expect a site to load in two seconds or less. There is 90% chance of you closing the website if it takes more than 3 seconds to load.
The question is: What happens behind the scenes? What makes these websites so powerful?
1. Application Performance: How well is the code written?
80% of performance issues are due to badly behaving applications. There are things like task prioritization, working from memory as much as possible (rather than working with data on disk), and making good use of queues.
2. Caching (stored in cache memory)
Cache: A place where active data is stored for faster access. It is a temporary storage area. The files you request by looking at a web page (like your crush' Facebook picture) are stored on your hard disk in a cache.
This improves performance by retaining frequently used data in high speed memory, reducing access times to data.
Time it takes to retrieve MB of data from various sources:
- Hard disk (15k rpm, 4KB disk blocks): 105ms
- RAM: 0.2ms
- CPU L1 Cache: 0.016ms
It is clear why caching is often one of the best solutions for increasing the performance of systems
3. Web proxies
When users browse the internet, instead of fetching all the requested data from the Internet each time, earlier accessed data can be cached (stored in cache memory) in a proxy server and fetched from there.
That way, users get their data faster than when it would be retrieved from a distant web server.
Web Proxies are also used for security reasons since proxy servers hide your internal network from the Public (Internet). Clients do not access the main server, they access the Web Proxy server.
4. Operational data store
A read-only replica of a part of a database for specific use. Instead of accessing the main database for retrieving information, often used information is retrieved from a separate small ODS database.
5. Scalability
Vertical scaling: Typically adding more CPUs or memory to a server making it stronger, hence faster. But there is always a limit.
Horizontal scaling: Means adding more servers to the infrastructure or adding disks in a storage system.
6. Load Balancing
It checks the load on each server and sends incoming requests to the least busy server. It makes the system highly available (website doesn't go down) because when a server is unavailable, the Load Balancer notices this and ensures no requests are sent to the unavailable server until it is back online again.
That's a perfect manual to start up a Data storage centre! =D
Nice article :)