There was a four tier system.
1) samurai: wielded enormous power
2)farmer/ peasant: produced all the food
3)artisan: produced necessary goods (clothes, ect.)
4( lowest class): merchants: traders, shopkeepers
shogun, buddist & shino priest were above all of the classes.
The family name was important as the Tokugawa Clan ruled Japan for a while. The family rank was important. If you're born in a family of low rank, you can expect not being able to get a high rank position.