The nightclub at the heart of Babylon Berlin, the Weimar Republic-era TV drama that premiered on Sky UK this month, may share period features with the Kit Kat Klub where Liza Minnelli once cocked her bowler hat in Cabaret. However, the frantic flurry of sweaty limbs on its dance floor could equally be inside one of Berlin’s modern-day temples of thumping techno.

In an extraordinary 11-minute song-and-dance sequence in the show’s second episode, an ashen-faced Russian woman in tails performs a Marlene-Dietrich-meets-Kraftwerk routine flanked by semi-naked dancers in banana skirts while an ecstatic crowd jerks in sync to stabbing jazz rhythms: a generation half-reeling, half-dancing on the edge of the abyss.

With a reported production cost of €40m and much advance fanfare, Germany’s most expensive TV series ever has been under pressure to perform. But in Moka Efti – the nightclub-cum-seafood-restaurant-cum-bordello where the show’s story strands weave together – the production’s gargantuan ambition has found an appropriately maximalist setting. One would assume the producers had to invent the place to make their show work – if it hadn’t existed for real.

Wilder than the imagination … Moka Efti, as redesigned by Uli Hanisch. Photograph: Uli Hanisch

The original Moka Efti was a cafe on Leipziger Strasse in central Berlin, named after its Greek-Italian owner, coffee roaster Giovanni Eftimiades. With the help of a group of London-based investors, Efti was able to purchase a much larger two-floor palais on the corner with Friedrichstrasse in April 1929 – the location where Babylon Berlin has the dance hall set, in the same year.

The decor inside the original venue, however, was even wilder than the imagination of the TV producers has allowed. An elevator took visitors from street level to the first floor – a technical invention so new and laden with the promise of social mobility at the time that many Berliners visited Moka Efti merely for the ride.

In the TV series, Berlin’s superclub has stripped-back walls and geometric towers of light. “If it’s hard to tell which elements are modern and which are vintage, that’s because the modernity we know was invented in the 1920s,” says the production designer Uli Hanisch, who created his own Moka Efti inside a former silent cinema in Berlin’s Weissensee district and built a new facade for the venue at the Babelsberg studios outside the city.

There was a barbers, an Egyptian salon, a white marble pastry shop and a room full of typists waiting to take dictation

The original Moka Efti was a fluffier, more backward-looking affair. Pundits could marvel at Moorish arches, panoramic paintings and an “Egyptian salon”, where owners claimed to have sold more than 25,000 cups of coffee on a good day.

There was a billiard hall, a barber shop and correspondence room filled with typists ready to take dictation. A white marble pastry shop connected to a bar via a corridor that was designed to look like a sleeper train on the Orient Express: “You don’t just sit up here, you travel,” wrote the social commentator Siegfried Kracauer at the time.

Along with the Haus Vaterland pleasure palace on Potsdamer Platz, where model trains and miniature planes on strings zipped among the coffee drinkers, Moka Efti was one of the most prominent themed establishments offering exotic entertainment and much-needed opportunities to dance away the memories of the first world war. By 1930, 899 venues with a dancing licence were registered in the German capital, most of them in the central Mitte and western Charlottenburg districts.

Street girl … Lisa Vries as Charlotte Ritter in the show. Photograph: Frédéric Batier/X Filme

Unlike in the series, there was no brothel in the basement at Moka Efti, but the link is hardly far-fetched: as early as 1905 the journalist Hans Ostwald wrote that “most dance halls are nothing but markets for prostitution”. In his 1931 novel Fabian, Erich Kästner describes one nightclub where “street girls” much like Babylon Berlin’s Charlotte Ritter were waved through at the door and given a free shot if they wore “colourful swimwear, rolled-up half stockings and shoes with high heels”. Some clubs also hired men to please female pleasure-seekers: the Austrian-American director Billy Wilder worked for two months as a “taxi dancer” at a Berlin hotel in 1926.

The original Moka Efti was relatively short-lived: the stock market crash of 1929 threw the club’s London-based backers into debt. In keeping with modern-day national prejudices, there were rumours in Berlin newspapers about two Greek investors who had run off with the savings. By 1933, Eftimiades had sold off the premises and bought a new, even grander, venue further west, which he called Moka Efti am Tiergarten.

In February 1934, Moka Efti hosted an event to commemorate the ​first anniversary of the Nazis' seizure of power

The real story of the superclubs behind the series are also a reminder that the image of Berlin’s “golden twenties” has always been at least as much myth as reality. For one, dancing establishments had already been around in the days of the last kaiser: “tango fever” swept the city in the years 1910-14. “The cultural boom of the 1920s didn’t come out of thin air,” says local historian Michael Bienert. “It just wasn’t part of the city’s official culture until after the first world war.”

One reason why we all still know about the decadence of Berlin’s Weimar years, Bienert argues, is that for a brief period of 15 years, underground culture was incorporated into the city’s official image. By 1931, guidebooks like Curt Moreck’s Guide through Depraved Berlin actively marketed the capital’s sinful reputation.

Show me the way to the next whisky bar … a sequence from Babylon Berlin. Photograph: Frédéric Batier/X Filme

An even less convenient truth is that Berliners continued to dance the night away even as the political mood darkened and Jewish musicians began to pack up their instruments. For a while, Berlin’s entertainment industry even signed up to the nationalist cause: on 4 February 1934, Moka Efti hosted a propaganda event to commemorate the first anniversary of the Nazi party’s seizure of power. After a dinner of celeriac soup, roast pork and pear compote, there were “three sieg heils for Germany’s Führer and saviour”.

In the end, however, it was the Nazis who spelled the end of the dance-hall culture to which Babylon Berlin pays tribute. Public dancing faced restrictions after the start of the war and was banned for good in 1942. Soon after, both Moka Eftis were destroyed by bombs.