I've always built on land and underground. My bases were like 100x50x20 and I only got raided due to human mistakes.
I always turn all lights off before leaving, and, we don't ever leave any trails on the surface.
Also, don't mine around your base, once chuncks got loaded it's easier to detect if someone has been around if the glitch thing happens.