Software extensibility: Experience from Starbucks

Source: Internet
Author: User

The author of this article, Weronika Abaj, is the developer of particular software. She focuses on delivering business value through software, exploring new models, and meeting challenges. At Starbucks, she always ordered a cup of caramel macchiato.

The article is a domestic ITOM management platform OneAPM compiled rendering, the following is the text:

Starbucks has avoided longer customer wait times by expanding its operating mechanism and workforce. Coincidentally, developers can do the same!

In 2004, Gregor Hohpe published a great article-"Starbucks Does not use two-phase Commit. (Starbucks does not believe in two-phase submissions) "When I was reading, I suddenly thought about my career at Starbucks in college. Over the years, I've come to realize that programmers can learn more from this well-known coffee chain company.

Many developers want to build extensible software, but in practice it is difficult to implement. When we are dealing with a variety of tasks, we often fall into a trap, thinking that each job is equally important, requires equal resources, and should be done synchronously in a predefined sequence.

That is not true-at least not in an extensible system, nor in Starbucks.

How to make coffee

At Starbucks, making a coffee involves four steps. First, the customer queue, at the counter orders, based on the first-come-first service principle. Second, the employee (barista) helps the customer to order and accepts the payment. Third, start preparing drinks. After the beverage is finished, place it on the bar and call the customer's name.

Although the whole model sounds reasonable, it will soon lead to a very long team. An employee can only handle one task at a time, so the customer can only wait in line when the barista makes a drink in order. If you want to serve more customers, you need to expand. Let's take a look at how Starbucks does it.

Expanded barista

One of the ways Starbucks can choose to expand is to hire a "super barista"-a very capable, highly efficient and very intelligent barista. Starbucks needs to invest heavily in their development, optimize all aspects of their work, and continuously improve their efficiency. In software, this scenario is called scaling up (vertical scaling).

The problem with this expansion is that employees ' speed (and working hours) are limited. One day, even the super barista won't be able to meet all the needs. Once this happens, the customer leaves the store in frustration and may never come back.

In the same way, the degree to which we optimize our software is limited. We can't buy a CPU at a GHz. Even if the largest CPU is multicore, the maximum rate for each chip is only 3 to 4 GHz.

Another way that Starbucks can expand is to change the structure of the work and add more ordinary employees, such as parallel processing in the software. When a barista receives an order, another begins to prepare. This allows the first barista to process the next order, while the first order is in parallel preparation.

You might think that parallel processing should be considered only when the demand reaches a certain level. In fact, it's not that simple. It's impossible to switch to parallel processing as soon as we need it. We must be prepared beforehand.

Starbucks is well aware of this. Every new store opens, even if there is only one employee per shift, but everything in parallel is ready from the very beginning. They can add their hands at any time.

Experience: If we build a system that does not support parallel processing, it is not easy to implement parallel processing.

Now, let's see how Starbucks has done it all.

Start with message delivery

If you've ever ordered coffee at Starbucks, you'll notice that the small boxes on the cups are always marked with certain symbols. These symbols are shorthand to help the barista quickly understand the type of drink and other additional requirements (such as cream, milk foam, etc.).

Cups, or information, are the basis of communication between employees. It tells the barista what to drink, and the symbol above provides the details of the drink. Even if the store is not busy, and only one employee serves the customer, the symbol will still be marked on the cup.

At first glance, it seems a little superfluous. However, if a large number of customers suddenly enter the store, then the backup staff can provide immediate help. Without any additional communication, they can start making drinks based on the information.

Experience: A sudden increase in demand is not scary, as long as we can add more employees at any time, to do division. Using a message is one of the methods.

Division of work

As mentioned earlier, the entire coffee production process can be done by an employee-the barista. However, the default process for Starbucks is to place a single employee (i.e. the cashier) and accept payment, and another employee (barista) to make a drink.

In general, the slowest part of the process is making coffee, which is why many coffee makers make coffee at the same time when the store is busy. They often take cups from a stack of cups and share the task equally. And this is the embodiment of the "competing consumers (competitive consumer)" model.

In some scenarios, however, this approach can also cause trouble. For example, there are three barista who use a coffee machine together with a star ice machine. Three customers ordered the coffee, while the fourth place ordered a glass of star ice music. The employees who placed the orders arranged the cups, which were respectively marked with corresponding symbols. Each barista takes a cup ready to make a drink. The first person to start using the coffee mechanism for drinks, the other two people can only wait.

We can avoid this situation by division of labor. One way is to further refine the information, classification processing. For example, we all know that Starbucks uses the information on the cup to indicate the type of drink that needs to be prepared. However, the system also distinguishes between hot and cold drinks: use a paper cup for hot drinks, and a plastic cup for cold drinks. When we received three hot coffee orders and then received an order for star ice, we had three cups and a plastic cup. The first barista takes one from a paper cup and starts making it. The second barista sees the coffee machine in use, so take the plastic cup and use the Star ice machine. In this way, two drinks are produced in parallel.

This division of labor allows the barista to split the task and complete it in parallel, known as "subdivision."

Experience: It turns out that segmentation is a key factor in effective scaling strategies. Not all jobs require the same level of expansion. Small tasks that can be done quickly can be done by a single employee, while high demand and more time-consuming tasks can be done together by multiple employees. By subdividing, we are able to scale independently for each task.

Not every job is equally important

One of the reasons for Starbucks ' success is to train its employees to recognize the importance of remembering regulars. For example, every morning, the man who buys two cups of oversized American and two large latte for his team. Also, every Wednesday, the point of the Cup caramel macchiato, and sit in the store for one hours to read the lady.

If the barista sees the "medium-cup caramel macchiato lady" in the store in Wednesday, they will start preparing her favorite drink before she arrives at the counter. Customers don't have to say anything, they get the drinks they want and they'll be happy. The cashier already knew what drink she had, so she could have a few words and then accept the payment. Before the payment is complete, her coffee is ready and on the bar.

You can not imagine that the percentage of customers in Starbucks is very high. It's important to bring them the best experience. Usually, they get a drink faster than other customers. This gives them a sense of importance and encourages them to continue to come and to bring more value to the company.

Experience: Some tasks are more important than other tasks. By building standard tasks into reusable, stand-alone modules, we can easily modify processes to provide better service for more valuable tasks.

Not all mistakes are worth preventing.

In all of the above examples, Starbucks employees are required to confirm that they have paid before they get their coffee. To ensure this, the barista can ask the customer to show a small ticket before delivering the coffee. However, in fact, they did not do so.

Starbucks has found that few customers will be eligible for a drink without payment. Their analysis shows that the focus of the barista is to focus on completing the order, rather than the occasional loss of coffee. If someone happens to take the coffee you ordered (usually unintentional), the barista prepares a new one for you.

Experience: To build a scalable system, we must accept certain unavoidable errors. It is too expensive to avoid these errors altogether. We should quickly detect problems when they occur and make up for them in time.

Summarize

The seemingly simple four-step process of making coffee has evolved into an interesting business flow. The seemingly unique and rare tasks are the necessary elements in the business.

Sudden growth in demand, or error, can happen many times a day. Designing a system that can cope well with these conditions requires a variety of common situations. Often, the first thought of a model does not solve these problems. There is also a need to consider unexpected situations. For example, cancel an order.

As we can see from the Starbucks example, if we adopt a simple solution, the business will not expand and serve more customers. As the number of customers increases, our level of service will continue to decline, ultimately leading to customer no longer access. Therefore, we must change the way we work to meet the growing demand. Finally, the built system can be expanded not only technically, but also as the business process continues.

OneAPM can provide you with an end-to-end Java application Performance solution, and we support all common Java frameworks and application servers to quickly discover system bottlenecks and pinpoint the root cause of the anomalies. Minute-level deployment, instant experience, Java monitoring has never been easier. To read more technical articles, please visit the OneAPM Official technology blog.

This article was transferred from OneAPM official blog

Original address: Https://dzone.com/articles/what-starbucks-can-teach-us-about-software-scalabi

Software extensibility: Experience from Starbucks

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.