Regardless of the context to which it is applied, sharing resources is well-recognized for its considerable benefits. Since 5G networks will be service-oriented, on-demand, and highly heterogeneous, it is utmost important to approach the design and optimization of the network from an end-to-end perspective. In addition, in order to ensure end-to-end performance, this approach has to entail both wireless and optical domains, altogether with the IoT, edge, and cloud paradigms which are an indispensable part of the 5G network architecture. Shifting from the exclusive ownership of network resources toward sharing enables all participants to cope with stringent service requirements in 5G networks, gaining significant performance improvements and cost savings at the same time. The main objective of this paper is to survey the literature on resource sharing, providing an in-depth and comprehensive perspective of sharing by recognizing the main trends, the techniques which enable sharing, and the challenges that need to be addressed. By providing a taxonomy which brings the relevant features of a comprehensive sharing model into focus, we aim to enable the creation of sharing models for more efficient future communication networks. We also summarize and discuss the relevant issues arising from network sharing, that should be properly tackled in the future.