Dwight Merriman and Kevin Ryan are quietly building the most important tech companies in New York.

KEVIN RYAN AND Dwight Merriman have built three billion-dollar companies together--a task easier, apparently, than explaining how they've done it. Seated in plush leather chairs in a glass-walled conference room at Gilt Groupe's Park Avenue headquarters, the duo reaches for analogies. "It's like one of us is a running back and one is a wide receiver," offers Ryan, a lean, crisply dressed 49-year-old, and consummate operations guy. "Or you're the defensive coordinator and I just don't touch that stuff," counters Merriman, a 44 year-old tech virtuoso. Maybe they're like two strands of the double helix that complement each other but don't get entangled.

Whatever the secret of their 17-year alliance, it has produced some eye-bulging successes. DoubleClick, cofounded by Merriman and headed by Ryan, more or less invented online ad serving; it was acquired in 2005 by private equity investors for $1.1 billion (and sold three years later to Google for $3.1 billion). Since then the duo has launched five companies together, two of them standouts: Gilt Groupe, specializing in high-end fashion, home decor and local deals online, and 10gen, which sells software and services to the likes of Cisco, MTV and Salesforce.com. If you believe private market valuations, then both companies are worth $1 billion or so.

There have been misfires. The partners lost money on Panther Express, a video tech outfit, which merged with CDNetworks in 2009. E-commerce search engine ShopWiki.com sold for a small profit a couple of years ago. Business Insider--the online news outlet run by Henry Blodget, a controversial former stock analyst turned blogger--is still more hype than hunk: Last year it lost $3 million on $12 million in revenue, though it recently posted a profit and raised $5 million from Amazon CEO Jeff Bezos.

A mighty confluence of tech and media brought these guys together. The son of a Caterpillar executive, Ryan grew up in Rome and Geneva before the family settled in Chagrin Falls, Ohio. His résumé was engineered for the C-suite: B.A. in economics from Yale; investment banking in London; M.B.A. from Insead in France. After finance work at Disney he spearhead a turnaround at United Media, a syndicator of columnists and comic strips, in 1995. Chief among his accomplishments: creating the hugely popular website Dilbert.com.

Merriman, meanwhile, has been hardwired for programming since adolescence. He bought his first computer, a TI-99/4A, as a 14-year-old in Middletown, Ohio. He was hooked on coding that day. “All of a sudden it was 3 a.m. and I was still going,” he laughs. “It was pretty clear that’s what I wanted to do for the rest of my life.” After studying computer science at nearby Miami University, he joined Intercomputer Communications, a networking company in Cincinnati founded by Kevin O'Connor. When that was sold to Digital Communications Associates, Merriman followed O'Connor to the new office in Atlanta.

Three years later, in 1995, DoubleClick was born in O'Connor's basement. He and Merriman created a system to display banner ads across a network of 30 sites and track their performance to precision-target visitors. It caught the attention of Ryan, who wanted to launch his own online ad business. He thought better after meeting with the DoubleClick team in New York: "I walked out and thought, 'I should just join them.'"

While the founders refined the platform, Ryan--as CFO, then president--managed finances, recruited talent and set up internal systems. DoubleClick went public in 1998. By the time Ryan became CEO, in 2000, shares had soared eightfold to $135; revenue jumped to $500 million.

Then the crash. DoubleClick's stock tumbled to $11 by the end of 2000. Losses peaked at $266 million in 2001, while sales plunged to $270 million two years later. In seven rounds of layoffs Ryan slashed 700 employees. Consumer complaints about privacy triggered one probe by the Federal Trade Commission and another led by then New York Attorney General Eliot Spitzer. While the FTC turned up zilch, DoubleClick settled with ten states for $450,000, without admitting wrongdoing. Merriman and Ryan sold it off in July 2005, each pocketing $29 million.

How do the partners' ideas turn into startups? A little haphazardly. "Because they've worked together for so long, they have very high-bandwidth conversations," says Chip Hazard, a partner at Flybridge Capital Partners, an investor in 10gen. The two often start by mapping out long-term trends on whiteboard, then work backwards to spot an opportunity. "We might not come into the room on the same page," says Merriman. "But we get there quickly.'"

And pounce, with each always kicking in $250,000 in seed funding, a strategy Ryan concedes has locked them out of more lucrative later-stage venture rounds. The two settled on the idea for Gilt--adopting the flash-sales model pioneered by Vente-Privee, a French e-commerce site --in April 2007. They hired a team that summer and then launched in November with $5 million in venture funding. Gilt zoomed from $25 million in sales in 2008 to $450 million in 2011, when it raised another $138 million for a $1 billion valuation.

The company has since slipped. Even though Gilt turned a profit last year, Ryan laid off 10% of the staff after failed attempts at selling full-price goods. Both Gilt Taste (a gourmet food site) and Park & Bond (men's clothing) were shuttered. Its travel-package business, Jetsetter, was sold to TripAdvisor for an undisclosed sum. "Gilt's fallen out of favor with pretty much everyone who held it up as the next generation of fashion retail," says Sucharita Mulpuru, an e-commerce analyst at Forrester Research. But with revenue galloping it could still be worth upwards of $1 billion.

Ryan and Merriman agree that 10gen is the jewel in their portfolio. Cofounded with ShopWiki veteran Eliot Horowitz, 10gen manages an open-source database, MongoDB, that helps developers integrate huge pools of data more easily into software applications. Researchers at CERN relied on MongoDB in their hunt for the Higgs boson, and MetLife used it to combine millions of stats into a tool for customer-service agents. Charging $5,000 per server each year for security and backup tools, plus training and consulting, 10gen will rack up a few tens of millions in sales this year. "They're in a very good place," says Merv Adrian, a database analyst at Gartner. "A number of significant deals could be sizable wins." A multibillion-dollar company one day? "Plausible," Adrian opines.

With Merriman spending "99.9%" of his time at 10gen and Ryan considering new ventures in education, IT security, e-commerce, maybe even nonprofit, is the duo finally splitting up? "Since there's no official partnership, there's nothing to change," says Ryan. "We don't start with the premise that we have to do everything together."