These datasets and code support research on the community assemblage of aquatic macroinvertebrates in ephemeral microhabitats, specifically water-filled tree holes (WTH), in three biogeographically and climatically distinct old-growth forests: Temperate-Mediterranean (France), Neotropical (Brazil) and Palaeotropical (India). By integrating standardised biological sampling, detailed environmental measurements and spatial analysis, the dataset allows for an in-depth examination of how local habitat conditions and spatial configuration influence taxonomic and functional beta-diversity patterns. The data capture the variation in species composition and ecological traits in 35 WTH per forest site and are particularly important for understanding how environmental filtering and spatial processes shape beta-diversity in natural forest ecosystems.