In 1750, Japan had only 3% of the world's population, but had 8% of the world's urban population. They also had 3 of the world's largest cities. Each of these huge cities started as a small jokamachi (village) near a castle. The primary purpose of a jokamachi was to supply the samurai of the castle with lodging and food.
In 1590, Emperor Tokugawa Ieyasu moved his military headquarters to Edo, and began construction on an amazing castle. Before long, Ieyasu made Edo his capital city. As a result, thousands of his vassals moved there and the population of the town exploded. After the town exploded in size Ieyasu constructed an elaborate water and sewage system throughout the city. Edo was now Japan's largest jokamachi with a population of 30,000 people. Consequently, Ieyasu divided the city into administrative, commercial, and residential areas. Each residential area or machi was populated by a particular profession. At the same time chonin (city dwellers) were encouraged to marry within their own profession. Arranged marriages were very popular.
The population of Edo would explode again when the bakafu(military government) implemented an alternate attendance program. Under this program the daiymo(war lords) were required to spend half of their time in Edo, and the other half of the year living in their home castle. Their families were required to stay in Edo all year, as hostages, because the bakafu trusted no one. The cost of moving from one's castle to Edo each year was extremely expensive. The average daiymo traveled with an entourage of 500 samurai, and some traveled with as many as 4,000. The daiymo also needed a large number of servants to support them. The attendance program eventually pushed the population of Edo to over 1 million by the year 1700AD. About 50% of their population were samurai.
At this time the average person lived in individual apartments in blockhouses that shared common facilities, or they lived in the back of a shop. Only wealthy merchants could afford to construct their own homes. Every machi (neighborhood) had its own shrines and Buddhist temples. Another result of the alternate attendance program was that hundreds of thousands of samurai were now traveling back and forth from their homes to Edo. Soon new towns sprang up everywhere to serve the saumurai's travel needs. Many of these towns located on harbors, crossroads, and river crossings. There were 25 cities at this time with populations of over 25,000, and another 250 jokamachi that were located around castles.
Fires in Edo were very common, so common that they were called Edo blossoms. Houses were made of wood and paper and they were crammed together. Every machi had its own fire patrol, and every house had pails of water on the roof. Fire patrols reminded people to put out their candles at night, and everyone had a turn as a volunteer fireman. Fires were fought by disassembling a house and getting it out of the way of the fire. The Edo mansion for the daiymo of Tamba burned 16 times. Then in 1657, an enormous fire killed over 100,000 people and left half of the city homeless. Another fire in 1788 destroyed over 357,000 homes and burned down 80% of the city. Finally, the government decided that homes would have to be built out of clay roofs and mud walls.