My experience is that a combination works best. Bungee cords can fasten into hooks and keep things held fast to the wall. Bar magnets are nice for utensils against the wall. Little round magnets can hold things like cups in place on a countertop. A rope can serve as a flexible boundary line for boxes kept under the bed, to prevent them from sliding out, but the rope can be pressed down to remove the box when you want to. And for many items that won't ever need to move, it makes sense to do something like screw it in place.
When in doubt, it would be fruitful to see what they do on sailboats. My impression is that things like spice racks are common. Ideally, a container can be custom made to hold whatever the thing is.