Scalability Flashcards

1
Q

Primary Bottlenecks that hurt the scalability of your app

A

database, application architecture, not using cache wisely, insufficient configuration and setup of load balancers, adding business logic to the database, not picking the right database, inefficient and poorly written code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can a database hinder the scalability of your app?

A

if the application has its workload running on multiple nodes and has the ability to horizontally scale… but there’s only one database to handle all data requests from all server nodes, the database is a bottleneck this will increase the response time of requests and the latency of the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to ensure the database is not a bottleneck hindering the scalability of your application?

A

leverage database partitioning, sharding, and multiple database servers to make the module efficient and scalable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can poorly design application architecture hinder the scalability of an app?

A

a common architectural mistake is scheduling all processes sequentially instead of using asynchronous processes and modules wherever required.

example: if a user uploads an image on a social network, tasks such as sending a notification to that user’s followers to the upload event should be done asynchronously

These tasks should be forwarded to a messaging server instead of doing it all sequentially and making users wait for everything to be completed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you use a cache to improve scalability?

A

Caching can be used at several layers of the application and it speeds up response time by notches. It intercepts all requests going to the database, reducing the overall load.

Use caching exhaustively throughout the application to speed up things significantly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What impact do load balancers have on scalability?

A

Load balancers are the gateway to the application, using too many or too few has significant impacts on the latency of the application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why is it bad practice to add business logic to a database and how does it impact scalability?

A

this makes the whole application tightly coupled which directly reduces scalability, and it adds unnecessary load on the application

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does picking the wrong database hinder scalability?

A

any time you try to pull things off using ‘not-so-suitable’ tech, you will impact the latency of the application in negative ways.

if you need transactions and consistency, use a relational database

if strong consistency isn’t a priority but horizontal salability is, use a non-relational database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does inefficient and poorly written code negatively impact scalability?

A

Inefficient and poorly written code has the ability to take down an entire service during in production, which includes:

1) using unnecessary loops or nested loops
2) writing tightly coupled code
3) not paying attention to the Big-O complexity while writing the code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are ways to tune the performance of your application to make is scale bettter?

A

Profiling, Caching, CDN, Data Compression, Avoid unneccesary client-server requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is profiling and how does profiling help improve scalability of your application?

A

Profiling is the dynamic analysis of code. It measures the time and space complexity, and enables us to figure out issues like concurrency errors, memory errors, and robustness and safety of the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Caching to improve scalability

A

cache wisely, and cache everywhere. Cache all static content.
Hit the database only when it is really required.
Try to serve all the read requests from the cache. Use a write-through cache.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a CDN (Content Delivery Network) and how does it improve scalability?

A

A CDN (content delivery network) is a geographically distributed group of proxy servers, and their data centers, that work together to provide fast delivery of internet content.

CDNs were introduced as a way to alleviate the performance bottlenecks of the internet

Using a CDN improves scalability as a CDN reduces latency of an application due to the proximity of the data from the end user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Data Compression and how does it improve scalability of an application?

A

the process of modifying data in a way that allows it to consume less disk space. By taking up less spcae, the data takes up less bandwidth. By taking up less bandwidth, the download speed of the data on the client will be faster

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Avoid unneccesary client requests to improve scalabilty

A

Avoid unneccesary round trips between the client and server. Try to club multiple requests into one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly