In order to write a language down, we need to choose a writing system. Many writing systems are used for languages around the world, and can be based on images (pictograms on stone; road signs), ideas or concepts (like Chinese and Japanese ideograms), syllables (like Cree syllabics), or sounds (alphabets, like the Roman alphabet). These choices stem as much from the history of a linguistic community as they do from the structure of the language itself.
Writing is a global system of visual representations for an oral language.
The writing system is comprised of the way in which a language is visually or graphically represented, with the use of graphic symbols. The alphabet is a type of writing system.
Spelling is on another, more social, level, because it is a linguistic standard.
Spelling originates in choices made in the graphic transcription of a language. It reflects sociolinguistic norms that have generated rules to describe the “correct” way of writing a language.
The development of spelling allows for the standardization of writing in a language: with it as a base, speakers agree to write in a uniform manner and that becomes the standard spelling.