wminghao
BAN USER
Comments (3)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
1. Web server scalability, too much traffic(measure average processing time) must bring more web servers
2. Web server failure, allow load balancer to detect failure and remove it from the nodes.
3. Database server scalability, too big data requires the db to be sharded vertically.
4. Database failure, allow replication.
5. If there are too many transactions, merge all transactions into one request on the web server and send it over to the database. (batch write)
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Use the following mechanism.
- wminghao November 23, 2015There is a lock manager node and bunch of other nodes
1. Each node, if it wants to acquire a lock, sends a lock request to the lock manager and wait for async callback from the lock manager
2. Lock manager has lock request queue checks if the queue is empty, it sends a lockAcquired notification to the caller node, then it puts the lock request in a queue. If the queue is not empty, it just pushes the lock request to the queue.
3. When a node receives the lockAcquired notification, it can process data. (Meaning lock is acquired)
4. When a node finishes processing, it will call unlock to the node manager.
5. When unlock call is received from the node manager, it pops the data from the queue and if the queue is not empty, sends a lockAcquired notification to the next node in the queue.