What's ~/Library/Containers for?

Thanks to the awesome TimeTracker, I just found out one app I have saves its caches (not strictly a cache I suppose, but similar) there. Within the app’s folder ~/Library/Containers/com.whatever/, there’s a folder labeled “Data” and that seems to contain a replica of my ~/ including its contents where most items are just symlinks to the real ~/ items, but those items that contain actual data saved by the app are actual folders.

Does somebody understand what the idea behind this is? The data saved there used to be in something like either ~/Library/Preferences or ~/Library/ApplicationSupport. Is this a replacement for that? Has there been any Apple guidance to devs as to when to choose which method? And finally, what’s up with the odd file structure replicating the existing user home with symlinks?

That’s used by the System to conduct Sandboxing of applications. It’s been that way since at least High Sierra. Developers don’t control that area. Symlinks are so the app is able to find those folders when operating from there.

Goes back at least to El Capitan, I just checked.

Interesting. This is an app from the app store so I guess this doesn’t come as a surprise.