In 2007, Starbucks CEO Howard Schultz lamented the state of the chain of coffee shops he had founded. Scaling from 1,000 to 13,000 stores, the company had watered down the Starbucks experience. The best parts of Starbucks, like the aroma of roasting coffee, had been filtered out.

It’s one of the more famous recent examples of a company whose efforts to scale turned into a "clusterfug." My colleague Robert Sutton and I used that fanciful name in our book, Scaling Up Excellence, for companies' screwed-up scaling efforts, and in a related, free online course we are offering starting September 15.

There are many other examples of scaling clusterfugs, such as Home Depot's expansion to China. It flopped because the company didn't adjust its "do it yourself" identity to the "do it for me" culture in that country, where labor costs are lower. Here in Silicon Valley, where we teach, the CEO of a large, growing company confided in us the feeling he got when he walked into a room, realized everyone was a new hire, and thought, "Who the hell are these people?"

In these examples, the executives focused on growing their organizations. They focused on the anatomy, including the physical size and corporate structure, and they probably didn't pay enough attention to the other two parts of their companies: first, the psychology, or the culture; and second, the physiology, or the processes that make it run.

To successfully scale, you must think very deliberately about all three--anatomy, psychology, and physiology--and about how to build the stamina to allow your company to grow all three in concert over the long term.

The anatomy of a scaling organization: Achieve the right level of flatness.

Most of us have a love-hate relationship with hierarchies. On the one hand, they can stifle innovation and make people feel powerless. On the other hand, power and status differences within an organization enhance collective effectiveness in many ways. Consider a failed experiment by Google's Larry Page, who got rid of all the company's middle managers and then had to reinstate the old system after trouble erupted. One hundred frustrated engineers were reporting to one overwhelmed senior executive.

The challenge is to weave complexity into a system in a way that does as much good and as little harm as possible. You could take a lesson from an innovative system adopted by Salesforce that struck a balance between placing too much accountability on the shoulders of a few senior executives and spreading accountability too thinly and evenly, as if it were peanut butter. Each of Salesforce's software teams was expected to complete a new software demo every 30 days, but every engineer was free to move to a new team without getting permission, which encouraged leaders to treat people well.

The psychology of a scaling organization: Build accountability.

There may be nothing more crucial to a scaling organization than creating a strong sense of accountability, the idea that "I own the place and the place owns me." You can create urgent, all-hands-on-deck accountability in any number of ways, but the goal is always the same: to bake in that constant pressure to do the right thing. One example: When he was mayor of New York City, Michael Bloomberg jammed himself and his 51 most crucial staff members into a bullpen. They were living and breathing his vision.

At the extremes, accountability is heroic, as in the case of the employees of the Taj Mahal Palace hotel, the target of a terrorist attack in 2008. Mallika Jagad, a 24-year-old banquet manager, led 35 employees to protect guests at a dinner. Elsewhere in the hotel, employees were killed leading evacuations. The general manager stayed at his post even after learning his wife and children had died elsewhere in the hotel.

How did the Taj establish such extreme accountability? The company has a set of very specific practices. It hires people prewired for its mindset, often people from small villages, who are motivated by the compensation. The Taj instills its values through an 18-month training program (compared with the 12 months or less that is typical in the industry), and it has a reward system that reinforces the mindset.

Your specific solutions will depend on your company and the challenges you overcome as you scale. That's what we mean by stamina. Scaling requires consistently taking many small actions that reinforce the qualities you want to scale, and taking those actions over and over again.

The physiology of a scaling organization: Build processes to transmit excellence.

When the CEO of the Silicon Valley company told us about his encounter in a crucial meeting with a room full of people he'd never met, he was describing a problem with his company's processes. He knew instinctively that those people couldn't possibly have been indoctrinated into his company's culture in any meaningful way. His hiring process had broken down.

The hiring and training process are among the most critical to your company's scaling efforts, but they aren't, obviously, the only ones. The leaders of Pulse, a company that sold itself to LinkedIn for $90 million, told us about one process they instituted to reinforce the trust that was important to them. Every Friday, they asked employees to submit anonymous responses to the question: "What are you wondering about?" Many had to do with when people were going to receive tools to make their jobs easier, but some were the subject of confusion, like, "Is Google going to buy us?" By 3 p.m., the founders responded to all of them.

In our research, we also looked into the processes used by the nonprofit Institute for Healthcare Improvement to spread pockets of excellence among hospitals. To spread knowledge, the team did everything from maintaining websites to holding weekly phone-ins for hundreds of people. It identified mentor hospitals with excellence in particular practices and made their staffs available to train others. Eventually, 120,000 fewer preventable deaths occurred because of its campaign.

Does scaling end? Never!

We started researching how companies scaled after some of our Stanford students asked the question after our business lessons, "How do we take this back and scale it?" We didn't have a great answer seven years ago. Now, we've written a book and are offering a massive open online course. We offer many different answers for many different companies and situations, hoping to help entrepreneurs and entrepreneurs-in-waiting avoid their own clusterfugs. At the end of our five-week course, which starts Sept. 15, you will emerge with a specific plan for the situation you want to scale.

Scaling is about transmitting the qualities of your own particular excellence. This was the upbeat, undeniable theme that infused nearly every conversation we had with people about their scaling projects: an unmistakable, irrepressible, and contagious sense of pride. I don't mean conceit or arrogance. Rather, I mean an authentic pride. Scaling is about continuing to move ahead: If we continue to invest the effort, and stick together, then good things will keep happening.

Hayagreeva Rao is the Atholl McBean Professor of Organizational Behavior and Human Resources at Stanford Graduate School of Business. His free online course, Scaling Up Your Venture Without Screwing Up, launches September 15, 2014. This piece was originally published by Stanford Business and is republished with permission. Follow GSB @StanfordBiz