The massive connectivity is among other unprecedented requirements which are expected to be satisfied in order to follow the perpetual increase of connected devices in the era of internet of things. In contrast to the family of conventional orthogonal multiple access schemes, the key distinguishing feature of non-orthogonal multiple access (NOMA) is its capacity to support the massive connectivity. Sparse code multiple access (SCMA) is one of the powerful schemes of code-domain NOMA (CD-NOMA) and is among the promising candidates of multiple access techniques to be employed in future generations of wireless communication systems thanks to the sparsity pattern of its codebooks. This technique has been actively investigated in recent years. In this paper, we provide a comprehensive survey of the state-of-the-art of SCMA. First, we will pinpoint SCMA place in the NOMA landscape including power-domain NOMA and CD-NOMA with the aim of justifying why SCMA is prominent. Then, its system architecture is highlighted and its basic principles are presented, afterwards a review of exiting codebook designs and available SCMA detectors is provided, before showing how resources are expected to be assigned, and how SCMA can be combined with other existing and emerging technologies. Finally, we present a range of future research trends and challenging open issues that should be addressed to optimize SCMA performance.