Roasting is the final processing step before the [[Species and Varieties]] can be finally consumed, after [[Coffee Fruit Processing]]. It plays a major role on the final flavor profile of the [[Coffee Extract]], as though beans will naturally have their different characteristics, their chemical composition is dramatically affected by the roasting process (pyrolysis).
For example, roasting affects the solubility of carbohydrates. Increased degrees of roasting increase the solubility of galactomannans, but too much roasting leads to degradation of arabinogalactans. These two are the main polysaccharides present in a coffee brew and are theorized to define the brew [[Sweetness]]. Sugar compounds like sucrose don't survive even the lightest roasts.
More roasting also means less acidity.
Too little roasting means less aroma because the gas is not created, so less aroma.
Too much roasting rips the cellulose containing the formed gases and these are lost, so less aroma.
Same thing with body. Too little roasting, little body. Too much roasting, little body.
Too much roasting pretty much destroys everything and leaves only bitterness.
#TODO Maillard reaction/components
However, the darker the roast doesn't mean the better the brew as this is a common misconception. The beans should be roasted to a point where the preferred flavor profiles are highlighted and this generally happens between in a light to medium roast.
Pitch-black coffee roasted is usually an indicative of low-quality beans, as the roasting process had no intent of preserving flavor.
The life expectancy of roasted coffee can be anywhere from 2 weeks to 2 months from the roast date, after which the beans starts to go stale and there's noticeable deterioration in quality, usually in the form of sour, dull/flat flavors.
The expectancy varies across roast profile and storage (oxygen, light, moisture, extreme temperature). Darker roasts release CO2 faster and stale quicker due to the weakening of the beans cellulose structures. Oxygen and light cause oxidation, while moisture might react with the grounds and extreme temperatures will break down important components.