What is a "Microcosm"?

What is a "Microcosm"?

Examples:

1. His classroom had people from all over the world in it: it was a microcosm the multi-cultural city that he lived in.