PS: this is the initial tech design doc and part of it is outdated now. We will try to keep it updated later.