In This Essay:
1, Coffee Cultivation and Exchange, 1400-1800
Coffee has emerged from obscure origins in eastern Africa to become a major globally-traded commodity. During the six centuries historians are able to trace of its history, coffee has always been an object of commerce. From a relatively closed circuit of distribution in the Red Sea area, it spread across the Islamic world in the sixteenth century. From there, it spread to Europe in the seventeenth century and became a truly global entity when Europeans started coffee cultivation in their colonies in Latin America, Africa, and Asia. As the world underwent the "modern revolution" in the nineteenth century, coffee both fueled the workday of the emerging industrial working classes in western Europe and tied slaves and wage laborers to the land in tropical regions throughout the world. In the twentieth century, coffee continued to be exported from relatively poor nations to relatively rich ones, usually to the benefit of the latter, a tendency that culminated in the newly deregulated markets of the post-1989 global economy.
Thus, coffee provides a lens through which to view many of the most important world-historical processes of the last several centuries. Coffee was a point of contact between the Middle East and Europe in the early modern period, being traded by European and Muslim merchants alike in the Indian Ocean trade. After Europeans had secured their own coffee crops, coffee was part of both the slave system and colonialism, being cultivated in far-flung colonies from Indonesia to Mexico. Coffee almost literally fueled the human side of industrialization in Europe, helping to break the ties of sleep and wakefullness to natural cycles and substituting clock time, the working day, and caffeination. Finally, coffee was at the center of Cold War and post-Cold War policies of global capital, which first sought to regulate prices in order to prevent social unrest in producing nations, then abandoned them to the mercies of the free market when the collapse of communism obviated the necessity of insuring the welfare of the third world.
There is scant documentary evidence of coffee use before the early 1500s, but historians have found that there was a small-scale trade in coffee between Ethiopia and Yemen starting in the middle of the fifteenth century. Apparently, coffee was harvested from wild bushes in Ethiopia and transported across the Red Sea. The first documented use of coffee was among Sufi religious societies in the late fifteenth century. There, coffee was used as a devotional aid in Sufi dhikr ceremonies, in which Sufi devotees would meet a night and perform rituals meant to elevate their consciousness toward the divine.  In these ceremonies, coffee was regarded as a useful aid to worship since it allowed the devotee to perform the rituals well into the night.
Coffee seems to have spread rapidly in the Near East; it was established in the Muslim holy city of Mecca by 1511. By the time the Ottoman Turks conquered Egypt from the Mamelukes in 1517, coffee-drinking was already widespread in Cairo. It spread equally quickly across the Ottoman Empire after the Egyptian conquest; the court physician to Suleiman the Magnificient approved its use for medicinal purposes in 1522.  Within a few decades, coffee was enjoyed across the entire Islamic world, from North Africa to the Mughal Empire in India. From being a ceremonial drink of Sufi mystics, in the course of about a century coffee became a part of the social fabric of the Muslim nations.
For the first few decades of the sixteenth century, the vast majority of coffee cultivation was still carried out in Ethiopia. In 1544, however, the Imam of Yemen insisted that coffee be cultivated in place of qat, a mildly intoxicating herb that was grown locally, and from then on the majority of middle eastern coffee cultivation took place in the highlands of Yemen.  There, perched atop rocky mountain ridges, farmers built dwellings literally stacked on top of one another to maximize the space available for growing coffee. They dug deep terraces into the mountains and for the next century or so produced most of the world's coffee. Likewise, at this time the Yemeni port of Mocha came to have a monopoly on coffee distribution to the Islamic world; coffee was transported by pack animals down from the mountains, purchased by merchants in Mocha, and distributed from there throughout the Ottoman Empire, Persia, and to the Muslim kingdoms in Africa and India accessible via the Indian Ocean trade. Until the middle of the seventeenth century, coffee was cultivated, traded, and consumed almost exclusively in the Islamic world; it would not arrive in Europe for another century.
The spread of coffee to the rest of the world took place in the seventeenth century. To maintain their monopoly on its control, coffee merchants in Mocha prohibited the distribution of live seeds or seedlings of the coffee plant. This technique worked to restrict coffee production to Yemen (and to restrict coffee distribution to Mocha) until late in the seventeenth century. This is not to say, however, that other people were unaware of coffee's existence. The British East India company was founded in 1600 to facilitate trade in luxury goods from Asia, particularly spices. By 1620 the British were trading in coffee.  It did not, however, spread to Europe initially; the British joined Muslim traders in buying coffee at Mocha and selling it elsewhere in the Islamic world. Coffee was thus one of the commodities the British sold to the Mughal empire in India (of course, starting from these trading contacts, the British would eventually come to dominate the Indian sub-continent.)
Coffee was, however, eventually transported back to Europe, and it spread as rapidly there as it had a century earlier in the Middle East. The first British coffee house was opened in Oxford in 1651 and it enjoyed immediate success, particularly among university faculty and students.  Soon, coffee houses spread across continental Europe as well, although until the end of the century all coffee had to be imported from the Middle East. The first coffee shop established in Paris was next to the famous Comédie Français in 1689, and the first in Germany appeared in 1670.  Coffee thus joined with commodities like spices and tea in the long-range trade in luxuries from Asia to Europe.
The Yemeni monopoly on coffee production broke down at the end of the seventeenth century. Coffee cultivation's spread to Europe is often tied to the last Ottoman siege of Vienna in 1683; as they retreated, the Ottomans supposedly left behind large stores of coffee, both in the form of coffee beans and as raw seeds and seedlings. Whether or not the story is true (it seems just as likely that smugglers had made off with seedlings earlier than 1683), coffee cultivation did spread to Europe (or, more precisely, to European colonies) at the end of the seventeenth century. The Dutch VOC, their equivalent of the East India Company, established a coffee plantation on the Indonesian island of Java in 1699 and other European powers soon followed: the British brought it to their possessions in the Carribean and the French to theirs in the early eighteenth century: Jamaica in 1730, Cuba in 1748, and Mexico in 1790.  Coffee was not as important as sugar to the European powers in the eighteenth century, but European colonial coffee production skyrocketed nevertheless. By 1788, for instance, French colonies, especially St. Dominique (soon to become the independent nation of Haiti), produced fully two-thirds of the world's coffee. 
(As an aside, it is interesting to note that as coffee production became globalized, coffees were sold according to their port of origin. Thus, "Mocha" and "Java" were specific varieties of coffee sold from the ports that bore their name, a nominal legacy that has remained with coffee ever since in the form of nicknames. It was not until the nineteenth century that coffee merchants began to consolidate a grading and naming scheme distinct from the port-of-origin technique.)
The labor systems in coffee-growing regions varied considerably. In the old coffee country of Yemen, farmers continued to grow coffee on their own plots in the highlands and merchants continued to purchase it directly from them. In the Portugese colony of Brazil and in the various colonies of the Carribean, coffee was grown on large plantations almost exclusively with slave labor. While Latin American production was relatively small until the nineteenth century, its labor systems were already regionally divided: where Brazil employed slave-labor, Guatamela and Mexico relied on both small farmers and on wage laborers working the plantations of large estates. Finally, on the Dutch-controlled Indonesian island of Java, coffee was extorted from Javanese peasants as a tax in kind (i.e. peasants were required to grow coffee and submit it as a form of taxation, rather than being required to pay in currency.) 
Under the European powers of the eighteenth century, coffee was intimately embedded in colonialism and slavery. The eighteenth century was the height of the slave trade between Africa and the New World, and slaves were forced to cultivate coffee on plantations throughout the Caribbean and parts of Latin America alongside other cash crops like sugar. However, while coffee cultivation spread rapidly in the late eighteenth century, supplying coffee-drinkers in Europe and the United States, it still remained something of a luxury item. Coffee prices were not yet low enough for it to be consumed regularly with meals, and most coffee consumption still took place in public coffee houses and taverns and was associated with a degree of upper-class (or at least bourgeois) respectability. Much was at stake in the future diet of the world in the last few decades of the eighteenth century, as the British gravitated toward tea over coffee, the United States rejected tea in obstinance to British tastes, and the foundations were laid for coffee to become an item of mass consumption, rather than the centerpiece of a respectable social ritual.
It was in the nineteenth century that coffee underwent a fundamental shift, fueling the new industrial economies of the west and becoming the centerpiece of the agricultural economies of various emerging nations in Latin America and certain areas in Asia and Africa. Nevertheless, the fundamental pattern of coffee production and consumption that has survived to the present was established by the late eighteenth century: tropical regions produced coffee and exported it to the wealthy nations of Europe and North America, largely for the economic benefit of the latter. Likewise, from being produced in the formal colonies of imperial powers, coffee came to be grown as a cash crop by nominally independent nations, albeit ones who were frequently dominated politically and economically by their neighbors to the north.
2, Coffee And Societies, 1400-1800
One of the most interesting elements of coffee's history is the impact that coffee-based socializing had on various societies. This is a factor that is easy to overlook when considering only the large-scale commercial exchange of coffee. After all, demand for coffee sprung up in the Ottoman Empire almost immediately after it was introduced in the early sixteenth century. About 150 years later, demand for coffee exploded in Europe as well, shortly after it was introduced in the manner described above. The question is thus why was coffee in demand, and what impact did coffee consumption have on the societies in which it was consumed?
One answer has to do with the social settings in which coffee was served. From the beginning, in both the Middle East and Europe, coffee was a social drink. The coffee house quickly became a social gathering place outside of the immediate purview of state or religious authorities. People, largely men, gathered in coffee houses to read and to discuss news, religion, politics, and just to chat. Coffee was cooked in large vats, pots, or cauldrons and was distributed to the patrons while they talked and read. None of this seems exceptional today, but at the time there were potentially revolutionary implications for the social context of the coffee house.
In both the Middle East and in Europe, there were relatively few places for people to meet socially outside of the workplace and the place of worship. In the Ottoman Empire, for instance, in which alcohol was banned due to the strictures of Islam, the coffee house rapidly became a socially-acceptable place for men to meet and talk outside of the mosque.  Not only were coffee houses new in that they provided an acceptable social gathering spot, but there is considerable evidence that members of different social classes and backgrounds gathered in coffee shops and conversed with one another (although it also seems clear that coffee-drinking was a Muslim pastime; the Christian and Jewish subjects of the Ottomans were expected to socialize among themselves elsewhere.) 
The Ottoman authorities were quick to diagnose the potential problems this introduced: without the guiding hand of state or religious authorities present, after all, coffee houses might serve as hotbeds of sedition. Almost immediately, the Ottoman Empire introduced a series of measures meant to counteract the dangers of the coffee house. In 1544 the first of many bans was issued on coffee houses.  More followed over the years; the most serious was issued by Sultan Murat IV in 1623, who ordered the coffee houses of Istanbul torn down completely. They remained closed for the time of his reign (1623 - 1640) but were reopened afterward.  In every case, even when the penalty for coffee consumption was execution by drowning, coffee consumption continued and the bans had to be rescinded.  Meanwhile, in neighboring Persia, Shah Abbas dispatched official orators to the coffee houses of the major cities to lecture on religion and history (naturally, the lessons were designed to inculcate loyalty to the regime.) 
In the Islamic world, one of the most important debates was whether or not coffee was an intoxicant, and should thus be forbidden according to Islamic law. As early as 1511 in the holy city of Mecca, religious scholars (ulema) issued an anti-coffee polemic, since coffee was being consumed for pleasure rather than as an aid to religious devotion as it had been earlier by the Yemeni Sufi orders.  Likewise, in 1535 in Cairo, following a series of anti-coffee sermons by a religious leader, anti-coffee rioters attacked coffee houses, and were promptly engaged in street combat by pro-coffee mobs. The authorities had to restore order and a legal decision was rendered confirming the legality of coffee.  In the end, the bans and conflicts were never successful because religious leaders themselves were divided on the issue: coffee was thought by many to be harmless, if not actually beneficial to both health and religious piety. With a lack of consensus among religious leaders, the coffee shops stayed open.
In Europe and, later, the United States, coffee had a huge social impact. As it had in the Ottoman Empire, the coffee house quickly became a social gathering spot. London coffee houses were called "penny universities" because admittance cost a penny and the houses were packed with people discussing the latest news and the latest ideas. As in Ottoman coffee houses, in Europe coffee was served to patrons communally and discussion and education were the major purposes of being there. The impact of this cannot be overstated; from coffee houses many of the major social and political movements and institutions that were to shape European history emerged; Lloyd’s of London, The London Stock Exchange, and the East India Company were started in coffee houses as the result of discussions between patrons.  The Declaration of Independence was first read in front of The Bunch of Grapes, a Boston coffee house, and many of the revolutionary leaders met regularly at the Green Dragon, a coffee house / tavern.  In short, coffee houses were the intellectual and political centers of their day outside of the courts, palaces, and other official organs of political life.
The German philosopher Jurgen Habermas has argued that coffee shops were both an important site and a constitutent element of what he calls the emergence of the "public sphere."  Habermas claimed that the eighteenth century saw the beginning of a public discourse about politics, society, and the proper role of both citizens and government, all topics which had been the more-or-less exclusive domain of elites in the past. Just as it had provided a social setting for discussion in the Islamic World, coffee shops in Europe were some of the most fertile locales for the discussion of new political and social ideas. The well-known aristocratic salon had its bourgeois counterpart in the coffee shop, where discussions were fueled as much by caffeine as by the excitement of discussing new ideas. This aspect of coffee and the coffee shop as social center-point faded in the nineteenth century, to be replaced by coffee as the fuel of industry and casual conversation, but both of these roles can be explained in part by coffee's identity as the carrier of a powerful drug: caffeine.
One fascinating aspect of the coffee story to consider in this context is the role of caffeine in shaping world history. As mentioned above, a major debate quickly emerged in the Ottoman Empire as to whether coffee was "intoxicating," and thus expressly forbidden by the Quran. The initial decision was that it was not intoxicating, and thus coffee consumption, and coffee houses, were acceptable under Ottoman rule. As noted above, however, the Ottoman regime vacillated in its attitudes toward coffee and coffee shops over the years, and religious leaders sometimes argued that coffee was unhealthy and that it led to the spread of vice and should be banned as a result.
In Europe and the United States, it was a different story. Europeans had long consumed alcohol as their major source of liquid refreshment: water was often unsafe to drink, and as a result the daily drink of everyone (children, women, and men) was beer and wine, albeit with a lower alcohol content than their present-day equivalents. Some historians have noted that most Europeans were always at least slightly intoxicated as a result.  Coffee (and, of course, tea) changed the drinking habits of Europeans not only by providing an alternative to alcohol, but by providing an alternative with a dramatically different drug-effect.
Where alcohol is a depressant, lending itself to sociability but not to coherence, caffeine is a stimulant, a fact that contemporary coffee-drinkers were quick to realize. The enthusiasm for coffee in the Islamic World was due, at least at first, to its ability to sustain religious devotion. Likewise, Pope Clement VIII supposedly blessed coffee for its invigorating effects, just as literary coffee-drinkers praised its ability to heighten their focus and provide energy. In the midst of the eighteenth-century Enlightenment, caffeine helped contribute to the intellectual ferment of the age (and justified the fears of authorities that coffee houses were potential hotbeds for pernicious political agitation.) Numerous writers and thinkers at the time were not only coffee-house aficionados, but caffeine-addicts; many took advantage of coffee and tea to stay up well into the night. Simultaneously, Europeans began to consume sugar in ever-increasing amounts. Thus, the diet of Europeans of all classes came to include powerful stimulants and easily-digestible simple sugars, which provided short-term energy boosts. 
There was still another side to the advent of coffee and other caffeinated drinks. As the industrial revolution began to stir in the second half of the eighteenth century, caffeinated drinks helped the new industrial working class adjust to the demands of a work-day that no longer conformed to natural cycles: instead of rising with the sun, working during the day, then going to sleep as night fell, increasing numbers of people were obliged to follow "clock time" instead. The same writers who praised coffee and tea for enabling them to focus their thoughts and write for longer hours also suffered from horrendous sleep-deprivation. Some historians have even argued that insomnia began with caffeinated beverages: freed from natural cycles and under the influence of a powerful stimulant, eighteenth-century Europeans began to have a profoundly different relationship to sleep than any before them. 
Coffee from 1400 to 1800 was at the center of two major movements of world history: the growth of global commerce and the beginnings of the modern revolution. From an obscure stimulant traded in the Red Sea region, it came to be grown, transported, and consumed from Brazil to Java. European colonialism brought coffee to tropical regions and Africans enslaved by Europeans grew it, often on the same plantations on which they grew sugar. Elsewhere, independent farmers continued to grow coffee for their own subsistence (and/or profit.) Everywhere that coffee was consumed - largely in the Islamic World, in Europe, and in North America - it fueled social ferment by creating social spaces that lent themselves to relatively open conversation. It also, along with tea, introduced a powerful stimulant into the regular diets of millions of people around the world, playing a part in the break from natural cycles to the systemization of time that was concomitant with modernity.