A dB is a RELATIVE measure of two different POWER levels. There's also dB relative to VOLTAGE levels, but I won't go into those, as we're mostly concerned with POWER levels in our discussions here. 3dB is twice (or half) as much, 6dB is four times, 10dB is ten times, and so on. The formula for calculating gain or loss in dB is: 10log P1/P2. It's used for stating the gain or loss of one device (P1) IN RELATION to another (P2). Thus, I can say that an amplifier has “30 dB of gain”, or I have “6dB total feedline loss”. I CANNOT say, “My amp puts out 30 dB”, or “I have a 24dB antenna”, as you must state what you're referencing it to, which is where the subscript comes in. The dB by itself is not an absolute number, but a ratio.
For amplifiers, a common reference unit is the dBm, with 0dBm being equal to 1 milliwatt. Thus, an amp with an output of 30dBm puts out 1 Watt. How much gain it has is a different matter entirely, and you can have two different amps, each with an output of 30dBm (1Watt), that have different gains, and require different levels of drive power to achieve their outputs. You can also have two different amps with the same gain that have different output powers.
There's also dBW (Referenced to 1 WATT), but you generally only use those when dealing with “Big Stuff”, as 30dBW is 1000w, and way beyond what we deal with here!
For antennas, a common reference unit is the dBi, which states the gain of an antenna as referenced to an ISOTROPIC source. An Isotropic source is the perfect omnidirectional radiator, a true “Point Source”, and does not exist in nature. It's useful for comparing antennas, as since it’s theoretical, it’s always the same. It's also 2.41 dB BIGGER than the next common unit of antenna gain, the dBd, and makes your antennas sound better in advertising. The dBd is the amount of gain an antenna has referenced to a DIPOLE antenna. A simple dipole antenna has a gain of 2.41dBi, and a gain of 0dBd, since we're comparing it to itself.
If I say I have a “24dB antenna”, it means nothing, as I haven't told you what I referenced it to. It could be a 26.41dBi antenna (also 24dBd), or a 21.59dBd (also 24dBi) antenna, depending on what my original reference was. The difference is 4.81dB, a significant amount. Most antenna manufacturers have gotten away from playing this game, but the reference will be different in different fields.