Edo, (old Tokyo 16th/17th-late 19th c.) had a clever system to administrate half a million townspeople and keep the security at the same time: by delegation, to jishinban (left) and kidoban (right), a double set of guard posts at the entrance of each of the 994 town districts.
The jishinban (here illustrated as a book cover) was manned by the major landowner and his deputies, 3-5 at a time, answered for security and fire detection. It doubled as liaison office for civic administration: if you needed a birth certificate for ex., this was were you went.
The kidoban on the other side was manned by retired old men who lived there and kept the town gate closed from 10 P.M. to 6 A.M. Anyone wanting to enter after closing needed permission and kidoban guards would communicate comings and goings across the city using wooden clappers.