Mid length refers to the gas system and has nothing to do with the length of the barrel. The mid length uses a gas tube that is 2" longer than a carbine gas system. It was originally used by Armalite on 16" barrels and provides the same distance between the front sight base and muzzle as found on a 20" with a rifle length gas system and a 14.5" with a carbine gas system.
As for the question about length on a DMR, I assume you mean the length of the gas system. It really depends on the mission and terrain. The military tends to use 20" barrels for most things although SOCOM used 18" barrels on their SPRs. Anything from a 16" to a 24" could work well depending on what you need it to do.