More connectivity, higher data rates, more reliability, massive network capacity, higher performance and fewer delays are required in the fifth generation (5G) of cellular networks. The last ten years have contained explosive growth in mobile data traffic due to the rapid proliferation of Internetconnected smart devices. For 5G mobile and wireless networks, one of the challenges is to discover how to solve the dilemma between capacity requirements and spectrum shortage. Millimeter-wave communication is therefore a key enabler for 5G technologies. Due to the high path and penetration losses at millimeter wavelengths, antenna beamforming assumes a pivotal role in establishing and maintaining a robust communication link. Recently, codebook-based beamforming has been proposed to achieve a fair balance between complexity and performance and to eliminate the overheads. In this paper, we track the techniques of codebook-based beamforming for millimeter-wave communications in the context of the distinct requirements for low-mobility channel and high-mobility channel scenarios. Subsequently, we will provide a comparison of existing codebook-based beamforming techniques in terms of their respective benefits and shortcomings. Finally, some open directions of research are discussed, and challenges that need to be met are pointed out.