The world's oldest library, at al-Qarawiyyin University in Morocco, has been taking care of books for more than 1,100 years. The oldest bookshop, Lisbon's Livraria Bertrand, has been selling them for less than three centuries. Libraries had a long head start before the printing press made the book trade a real business, but bookshops will always be more ephemeral. As Jorge Carrion writes in Bookshops: A Reader's History: "The Bookshop distributes, the Library preserves."

Who, then, will preserve bookshops, decimated since virtual bookstores and e-books came along? The question floats unanswered through Mr. Carrion's affectionate history, which is full of elegiac descriptions of what a bookshop is. It's "a miniature city," a centre of resistance and a battlefield where commercial value and authorial prestige are contested every day. It's "a condensed version of the world," and a ritual space for "a community of believers."

The believers may not share the same faith, and may even battle against places where the rituals occur. Mr. Carrion celebrates the democratic nature of a space where virtually any published idea can be found, but also notes that German bookshops in the late 1920s did great business with Hitler's Mein Kampf. Stalin did much of his early reading on Marxism in a Georgian bookstore, and Mao actually ran a bookshop and publishing house in the 1920s. Like Hitler, both inflicted harsh controls on publishers and booksellers once they had the power to do so.

Story continues below advertisement

European bookshops in the 18th century were often linked physically to spaces where books were made, similar to bakeries, where loaves move from the ovens in back to the counter in front. The shops also became informal meeting places. When Goethe went looking for a book on architecture in an Italian bookstore in 1786, he was quickly drawn into a conversation with other informed customers. They didn't recognize him as the celebrity author of the first best-selling novel, The Sorrows of Young Werther. They just wanted to talk with a kindred spirit.

In the 19th century, bookshops spread in tandem with the new transportation technology: rail. The first book chains got started by claiming retail space in railway stations. W.H. Smith in Britain, Hachette in France and A.H. Wheeler in India all prospered because almost everyone who entered their track-level shops would soon have time on their hands – time to read a book. When air travel became a thing, booksellers such as Hudson News moved into airports.

Unless you're just about to board, bookshop browsing can be a deeper and more untethered exercise than other kinds of shopping. Just opening a book and reading a few lines can draw you partly into another world, one you might not have planned to visit. According to Vancouver publishing consultant Thad McIlroy, only 40 per cent of bookstore purchases are premeditated. All the rest are decided on impulse.

Knowing this, booksellers and publishers think carefully about how to design the space and arrange the stock. As Mr. Carrion writes, a good bookshop is a house of seduction, created to lure the book lover and keep him or her circulating in the aisles. The sumptuous beauty of shops such as El Ateneo Grand Splendid, in Buenos Aires, is part of the game. Systems for displaying the wares may follow a wonderful, idiosyncratic logic. Altair, a travel bookshop in Barcelona, arranges even its fiction and poetry titles geographically.

Bookshops that rent display space to publishers – a regular practice among the chains – eat away at their own souls, Mr. Carrion writes. He visits an Amazon physical store in Seattle, and finds only about 5,000 books, all of them displayed face up and organized "mathematically."

Some bookshops still emphasize personal community. I recently visited the Neighbourhood Bookstore and Café in Winnipeg, where owner Bill Fugler chatted freely with me about books, films and the state of things around town. His shop, he says, is his living room, and everyone passing through it is family.

In the online trade, only the books circulate, while the readers stay at home in front of their screens. Algorithms make robotic suggestions, following a practice launched by the London bookshop Hatchards (established in 1797), where live, professional readers still select and ship books to subscribers. Hard-copy books are still published by the thousands; it's the transactions that have become ethereal.

Story continues below advertisement

BOOKS: MORE FROM THE GLOBE AND MAIL

The Globe 100 Globe and Mail editors and reviewers offer up their favourite books of 2017.

How the publishing industry is addressing the need for diversity In 2014, the #weneeddiversebooks movement was launched. Dakshana Bascaramurty reports on how the publishing industry is making progress.