Driven by the emergence of new compute-intensive applications and the vision of the Internet of Things (IoT), it is foreseen that the emerging 5G network will face an unprecedented increase in traffic volume and computation demands. However, end users mostly have limited storage capacities and finite processing capabilities, thus how to run compute-intensive applications on resource-constrained users has recently become a natural concern. Mobile edge computing (MEC), a key technology in the emerging 5G network, can optimize mobile resources by hosting compute-intensive applications, process large data before sending to the cloud, provide the cloud-computing capabilities within the radio access network (RAN) in close proximity to mobile users, and offer context-aware services with the help of RAN information. Therefore, MEC enables a wide variety of applications, where the real-time response is strictly required, e.g., driverless vehicles, augmented reality, robotics, and immerse media. The 5G network is broadly characterized by three service types: extremely high data rate, massive connectivity, and low latency and ultra-high reliability. Indeed, the paradigm shift from 4G to 5G could become a reality with the advent of new technologies. The successful realization of MEC in the 5G network is still in its infancy and demands for constant efforts from both academic and industry communities. In this survey, we first provide a holistic overview of MEC technology and its potential use cases and applications. Then, the main part of this paper surveys up-to-date researches on the integration of MEC with 5G and beyond technologies including non-orthogonal multiple access, wireless power transfer and energy harvesting, unmanned aerial vehicle, IoT, network densification, and machine learning. Furthermore, we briefly summarize the existing literature that integrates MEC with other 5G technologies and that focus on developing testbeds and experimental evaluations for edge computing. We further summarize lessons learned from state-of-the-art research works as well as discuss challenges and potential future directions for MEC research.