We establish a canonical correspondence between connected quandles and certain configurations in transitive groups, called quandle envelopes. This correspondence allows us to efficiently enumerate connected quandles of small orders, and present new proofs concerning connected quandles of order p and 2p. We also present a new characterization of connected quandles that are affine.2000 Mathematics Subject Classification. Primary: 57M27. Secondary: 20N02, 20B10. Key words and phrases. Quandle, connected quandle, homogeneous quandle, affine quandle, enumeration of quandles, quandle envelope, transitive group of degree 2p. results on connected quandles in a simpler and faster way. We focus on enumeration of "small" connected quandles, namely those of order less than 48 (see Section 8 and Algorithm 8.1) and those with p or 2p elements (see Section 9). Our proof of non-existence of connected quandles with 2p elements, for any prime p > 5, is based on a new group-theoretical result for transitive groups of degree 2p, Theorem 10.1.The modern theory of quandles originated with Joyce's paper [24] and the introduction of the knot quandle, a complete invariant of oriented knots. Subsequently, quandles have been used as the basis of various knot invariants [4,5,6] and in algorithms on knot recognition [6,14].But the roots of quandle theory are much older, going back to self-distributive quasigroups, or latin quandles in today's terminology, see [38] for a comprehensive survey of results on latin quandles and their relation to the modern theory. Another vein of results has been motivated by the abstract properties of reflections on differentiable manifolds [27,30], resulting in what is now called involutory quandles [39]. Yet another source of historical examples is furnished by conjugation in groups, which eventually led to the discovery of the above-mentioned knot quandle by Joyce and Matveev [24,31].