The Beanstalk contract is a Diamond – a multi-facet proxy defined in EIP-2535 that can implement functionality from numerous different Facet contracts.
All the Facets share a common storage through the
AppStoragepattern. Functionality is shared between Facets through internal Libraries.
Understanding EIP-2535 really helps to understand Beanstalk. This page serves as a resource hub for EIP-2535.