Step By Step

Share ideas and interesting findings in my life.

I am a software engineer focus on backend service and architecture design.


Formerly works for Microsoft and now Senior Software Engineer for Skytap.

Distrubute locker with Container

One common issue with distrubuted locker is that if the process die somehow, who/how/when should we release the lock.

A noraml approach will be have a timeout and if the process doesn’t hand back the lock within a period of time, the serivce just thanks that the process is dead.

But it is not always the case: for some long running operation, it could take a while.

One way to fix it is having the process update the lock service every few seconds to renew the lock. But it introduces additional cost for the communication.

With Container

With kubernete and container, now there is another approach:

  • progress grab a lock from service and the service remember the spot-container_name as the owner of the lock
  • service can talk to Kubernete and check whether the container is still alive.
  • if it no longer exists, just release the lock
Early Article

Behavioral Patterns - Chain of Responsibility, Command

CHAIN OF PESPONSIBILITYWhen a request comes, chain the receiving objects and pass the request along the chain until an object handles it.Scenario more than one object may handle a request set of objects that can handle the rest should be specifi...…

design patternContinue Reading