Amy Tan jokingly refers to her forthcoming novel, The Valley of Amazement (Ecco, November) as “Fifty Shades of Tan”; it’s the first of her books to include sex scenes. Given the novel’s subject matter, she didn’t have much of a choice. Over the course of more than two decades and almost 590 pages, Tan follows the lives of a group of courtesans in early-20th-century Shanghai, set against the backdrop of a changing world.

We’re in the office of Tan’s new home in Marin County, Calif., on the other side of the Golden Gate Bridge from San Francisco. Tan, 61, and her husband Lou DeMattei (whom she met on a blind date and married in 1974) recently had the house built—one of the projects that filled the eight years between books. The grand piano stands out, calling to mind the author’s oft-repeated comment, upon publishing The Joy Luck Club, her bestselling debut novel, that her mother wanted her to be a doctor by day and a concert pianist on the side. Tan says she still feels that her mother is with her every day, particularly when she writes; she refers to her mom as her personal “bullshit detector.”

Though Tan has mined the subject in the past, the mother/daughter theme is given new treatment in The Valley of Amazement. The story opens in 1905 and is told through the eyes of Violet, a half-American, half-Chinese girl being raised by her mother, Lulu, the only American female proprietor of a courtesan house in Shanghai’s International Settlement. Tricked by a lover, Lulu abandons Violet to the courtesan life, even though Violet thought her mixed heritage rescued her from that fate.

According to the journals that Tan keeps, the book differs greatly from her initial idea for the story. Only Moon Pond Village, a rural settlement in a remote province of China, which Tan visited several times and wrote about on assignment for National Geographic, remains—but not as the central setting, as she had once envisioned. A creative shift took place when Tan discovered a series of photographs taken of her grandmother in Shanghai circa 1910.

“You see a woman posed like this,” says Tan, haughtily jutting out her hip and placing an elbow on her desk, “and you think that whatever they say, she certainly was not a quiet, old-fashioned woman.” The images “blasted a hole in the family myth” and set Tan in a completely different direction. She was inspired by the possibility that, like one in 100 women in Shanghai at the time, her grandmother might have been a courtesan.

When Tan consulted historians—she did a great deal of research to write The Valley of Amazement—they said the fact that her grandmother was taken to a Western studio for photo sessions makes the images very shocking. As a result, Tan scrapped almost the entire work in progress and dove into the courtesan world. More than anything, Tan says, The Valley of Amazement is about identity. “It has to do with the circumstances that determine who you are, and how what you do in your life determines your future,” she explains. Her research revealed very sad stories, many of which are similar: girls taken as young as age five—often by family members—and sold either to courtesan houses or to brothels (which were deemed less prestigious than the former in the sex-trade pecking order). While courtesan culture provides a rich backdrop for her story, Tan says she is afraid that people will think The Valley of Amazement glamorizes prostitution. She believes that sexual slavery is one of the biggest problems facing the world today.

In the eight years since she published her last novel, Saving Fish from Drowning, Tan has written a libretto for an opera based on The Bonesetter’s Daughter, worked on a PBS television series based on her children’s book Sagwa, the Chinese Siamese Cat, and taken horseback-riding lessons. Tan has also kept up with the technological changes sweeping the publishing industry (she has written for Byliner and Kindle Singles), as well as changes in subject matter. While it did not influence her writing, Tan says she has not been immune to the Fifty Shades phenomenon. “We were the women’s libbers in the 1960s and ’70s, fighting for equality and not submission; fighting to take off our bras and not wear handcuffs,” she observes. “And I’m thinking, wow, we’ve gone 180 degrees here.” She notes that what makes Fifty Shades different is that it’s about “controlled fantasy.” Mostly, Tan thinks the success of the books has to do with a lot of women not getting lucky in their own bedrooms.

Tan has always been sensitive to the dangers of writing about sex. She says members of her writers’ group have long teased her about her reluctance to tackle bedroom scenes. Tan notes that she relied on Dan Halpern, her editor at Ecco, to save her from making a fool of herself. When writing about sex, she explains, “people always assume you are writing from your own life.” She adds, “You feel as though you’ve invited people into your bedroom.” But a lot of the sex in The Valley of Amazement is contrived and unromantic; courtesans practice the illusions of love, Tan notes.

Tan’s agent, Sandy Dijkstra, wanted her to provide a synopsis of the new book for submission, but instead the author wrote a 4,000-word essay “about the about” of The Valley of Amazement; in it, she explains what motivates her to write. “I think Dan was the only one who read it,” Tan says. “Or maybe he was the only one who loved it.” That essay will now be the centerpiece of a nonfiction collection that she also plans to publish with Ecco. “I just feel very lucky to be able to write fiction because I think, otherwise, I would have had to spend a fortune on a psychiatrist—and I still wouldn’t get 1/100th of what I get writing fiction,” Tan notes.

The Valley of Amazement is an entrée to the courtesan world of Shanghai and highlights that, although “we’ve come a long way, baby,” women are still trying to live up to men’s perceptions of them, and still inflating their egos as lovers, as can be seen in the Fifty Shades books. But Tan thinks that the stories of women who help each other, like those at the heart of The Valley of Amazement, have something to teach people of all genders, and in all cultures.