VLANs vs. Subnets
If you're trying to understand the concepts behind VLANs and subnets, you have my sympathy. There are some common misconceptions around these two terms that confuse a lot of people. Friends, it needn't be so. The difference between a VLANs and subnets is very simple.
VLANs and subnets are the same thing.
A VLAN is a virtual LAN, and a LAN is a subnetwork, a.k.a. a subnet. It's a layer 2 (data link layer) concept.
VLAN = subnet = broadcast domain (in Ethernet).
To understand this, refer to the ISO/IEC papers on the OSI model. People used the term "subnet" to refer to Ethernet LANs years before IP even existed. Also, if layer 3 is the network layer, then a subnetwork would logically exist at layer 2. In his book Patterns in Network Architecture John Day wrote of the OSI model:
[T]he primary function of the network layer was to make the transition between the subnetwork-dependent protocols and provide a service that was independent of the subnetwork technology.
The subnetwork is a layer 2 concept in OSI. Not layer 3.
Subnetting and a subnet are different things.
What people call "subnetting" is formally called classless addressing. At layer 3, we have IP networks that can be subnetted, divided into contiguous blocks. The size of each block is determined by a subnet mask. For example, the network 10.1.2.0 with the subnet mask 255.255.255.0 would together be what's colloquially called an "IP subnet". A L2 subnet is not the same as an IP subnet.
The subnet mask determines whether a given IP address is in the same broadcast domain or a different one. Using the preceding example, 10.1.2.1 and 10.1.2.2 would be in the same subnet (i.e. the same VLAN or broadcast domain). 10.1.2.1 and 10.9.9.9 would be in different subnets (a.k.a. VLANs).
Having too many devices in a subnet/VLAN can cause performance problems. One badly behaving NIC or misconfigured switch can bring down the whole subnet. Devices in different subnets (VLANs) can communicate at layer 3 if the subnets are connected via a router. Routing allows you to scale a network beyond a few hundred devices. In a small office network, you may be fine having everything in one subnet (switching). In a medium sized office network, using multiple small VLANs connected via routers (routing) is best.