Is there a possibility to compress the contents of a directory in Unix (especially AIX) on the fly, while still being able to read and write in the directory? Like the Windows EFS encryption does?
There are a few options. If you can choose the filesystem of the system, then just use Btrfs filesystem and enable compression for the required directories by using chattr:
chattr +c /myfolder
If choosing the filesystem is not an option, then look into fusecompress https://github.com/tex/fusecompress
Edit: AIX specific solution would be to use JFS1 filesystem with compression which would compress the whole filesystem or use fusecompress mentioned above which works on AIX