I have very recently been given the task to maintain one a legacy product. This product is a java application which uses Infinispan version 10.1.1.
After diving into this fascinating task of becoming a champion of a legacy product there are still many things that puzzles me.
One is what determines the number of folders that Infinispan uses for storing data?
I see folder names from "0", "1", ".." all the way to "255" and inside each folder there is a "xxxx.dat" file for each cache.
It is the number of segments (256 by default). Each key is mapped to a segment and each segment is mapped to one or more nodes in the cluster.
A directory per segment allows faster lookups (searching on a small file instead of a larger one) and faster transfers (if the segment is remapped to a different node, only that file is transferred).
There is more info in the chapter 2 of our documentation