Coffee’s Variety Problem

How to Get Your Hands on the World’s Best Coffee Beans

Freshly roasted coffee beans from central Mexico.

Spaghetti Sauce Origins

During the 1970s consumers had a limited number of spaghetti sauces that they could purchase at their local supermarket. Each store-bought sauce tasted the same, developed in test kitchens from the average flavor preferences of focus groups.

During this time, Prego brand spaghetti sauce was new to the market and was having a difficult time competing against the more established spaghetti sauce brands like Ragu. Prego tasted the same as all of the other brands so capturing loyal customers from other brands was a challenge.

Struggling to become competitive, Prego brought on board Howard Moskowitz. Today some consider Moskowitz the godfather of food-testing and market research, but during the 1970s Moskowitz’s beliefs on product-design were contrary to the mainstream establishment. Moskowitz believed that using the average preferences of focus groups to develop a product lead to an average tasting spaghetti sauce: acceptable by most, loved by none.

Instead of giving focus groups similar tasting sauces, Moskowitz decided to test the extremes: have groups compare smooth pureed sauces with sauces that have chunks of vegetables in them, compare mild tasting sauces with ones with lots of spice, and so forth.

The results of this type of testing may seem obvious today, but at the time they were unheard of: people prefer different kinds of spaghetti sauce. It was better for a food company to have a portfolio of niche flavors rather than try to make one product that appealed to everybody.

Today spaghetti sauce no longer has a variety problem.

After all of this initial research Prego made Extra-Chunky spaghetti sauce, which instantly became a hit with all of the people who prefer a thicker type of tomato sauce. In the years since, spaghetti sauce manufactures have caught on to the technique and supermarket shelves today are lined with regular, thick and chunky, three-cheese, garlic, and many other types of sauces that appeal to a wide-array of consumer flavor preferences.

Coffee’s Variety Problem

Coffee today has the same problem that spaghetti sauce did a quarter-century ago.

The average supermarket’s coffee aisle may look like it has a wide variety of choices: whole beans versus ground coffee versus coffee pods, arabica versus robusta beans, caffeinated versus decaf, medium versus dark roast, etc…

However, once you take a look at what coffee a particular individual may drink — let’s say whole bean, medium-roast caffeinated arabica beans -the amount of variety found at a super market is surprisingly small, maybe only 2 or 3 different types.

The limited selection for whole bean, medium roasted coffee at my local super market.

Additionally, it is nearly impossible to know how long the coffee has been sitting unsold on the shelves, it’s difficult to find a variety of coffee from different geographic regions around the world, and only if you are extremely lucky can you find a coffee that has been lightly roasted.

Independent coffee shops, especially those that roast their own coffee, offer slightly better options in terms of variety, however they come at a steep price: it is not unusual to see these coffees selling for $16-$28 per pound.

I understand these small-batch roasters experience higher costs due to lack of scale, availability of beans, and a slowly developing market to third-wave premium coffee, however paying $20 for a pound of coffee beans (or even worse, the standard 12oz bag) is not something I can justify doing regularly.

This is what caused me to set out on my quest to get premium quality coffee beans at an affordable price.

The Internet Cafe

While the internet offers advantages in buying premium roasted coffee beans, there are still issues with unknown freshness and high prices, especially when the cost of shipping is included.

Shipping costs and price per pound can be reduced when buying in bulk, but buying in bulk means I’ll have roasted beans sitting around for a long time before being consumed, therefore affecting freshness and taste. Short of finding friends who want to split a large coffee order, buying roasted coffee beans online isn’t a great option.

What is a great option is buying green, or un-roasted, coffee beans. The shelf life of green beans is up to one year if stored properly and green beans are significantly cheaper than roasted beans because there is less processing involved.

Green, un-roasted coffee beans.

Not only are green beans fresher and cheaper, there is significantly more variety available. Commercial roasters need to buy beans in large quantities in order to be able to sell to coffee shops and supermarkets. This means they are sourcing coffee beans from large commercial farms that are able to supply such a large amount of coffee beans.

If we buy green beans for personal consumption at home, the number of farms that we can buy from is hugely expanded since we only need to buy in small quantities. A farm that only produces a few hundred pounds of beans each year is now within our grasp since commercial roasters would never be able to purchase from them.

There are many retailers online that cater to the home roasting market. My favorite is http://sweetmarias.com and they always have a huge selection of premium beans from all over the world, many for under $6/pound.

Home Roasting

Roasting beans at home used to be the norm in the early nineteenth century. Roasting coffee beans is similar to making popcorn and can be done over a fire, in a stove, or in the oven. While these methods work, they are messy and involved. Fortunately, cleaner and more scientific options exist.

Commercially available home roasters are one such option, however they cost several hundred to thousands of dollars — well out of my price range.

The most easily obtainable and easy to use home coffee roaster is an electric air-powered popcorn popper. These retail for between $15–$25 new. If you decide to try this route, get one without a mesh screen on the bottom.

Once you have an air popcorn popper, roasting coffee beans is as easy as pouring them in, turning on the heat, and waiting until they turn the brown color you are accustomed to seeing.

Although roasting beans can be as easy as turning on the popcorn popper and waiting until the beans reach a desired color, there is a scientific rabbit hole that roasting geeks like me eventually wander down…

Home Roasting 2.0: Web Roast

When I first started roasting coffee beans at home, I started with the air popper method. I soon wanted to start experimenting more with how to make the process more automated, as well as how I could become more precise and play with different variables in order to change the flavors of my roasted coffee.

There are some mods you can make to a regular air popcorn popper to give you more control in how your roast your beans, but ultimately I wanted more control.

I present to you, Web Roast:

The home-made, Internet of Things (IoT) coffee roaster.

The finished project with all code can be found on my project’s GitHub page: https://github.com/bertwagner/Coffee-Roaster/

Essentially, this is still an air popper but with much more control. The key features include:

  • Air temperature probe
  • Ability to switch the fan and heat source on/off independently
  • Holding a constant temperature
  • Automatic graphing of roast profiles
  • Ability to run saved roast profiles

Now instead of standing at my kitchen counter turning the air popper on and off, holding a digital temperature probe, and shaking the whole roaster to circulate and cool the beans between “on” cycles, I can simply control all of these conditions from my iPhone.

Screen shot of the web app user interface.

From my phone I decide when to heat the beans, when to maintain a certain temperature, how quickly or slowly to hit certain roasting stages or “cracks”, and logging to make sure I can reproduce results in future runs.

Beans develop different flavors based on how quickly or slowly they go through different phases of roasting. Some beans might be better suited for quick roasts that will maintain acidic fruit flavors. Other beans might need to be roasted more slowly to bring out nutty and cocoa flavors. The moisture content of a bean will also have an effect on roasting times, as well as beans that are sourced from different regions of the world.

Next Steps

Although I’m extremely satisfied with how my roaster has turned out, there’s still a lot on the to-do list.

I’m currently adding functionality to save roast profiles, so after an initial run of desired results, reproducing those results for the same batch of green beans is easy.

In the future, I’d like to build a second, bigger drum-style roaster for being able to roast larger batches at a time.

Follow my Github coffee roaster project page to keep up with any future updates. Also I would love to hear from anyone who has built similar projects of their own.

Good luck and happy roasting!

Thanks for reading. You might also enjoy following me on Twitter.

Want to learn even more SQL?

Sign up for my newsletter to receive weekly SQL tips!

3 Things I Wish I Knew When I Started Using Entity Framework

Entity Framework (EF) is Microsoft’s object-relational-mapping tool (ORM) that allows programmers to easily map database objects to C# object models. What attracts developers to Entity Framework is the automatic mapping of SQL tables to C# model classes, a feature that removes a lot of the tedious boiler plate code that developers would otherwise have to write.

The quickest way to see why developers love Entity Framework is with an example. Without Entity Framework, the code needed to SELECT some data from SQL looks something like this:

With Entity Framework and LINQ (Language Integrated Query), I can instead write something like this:

As a developer I want to be writing code like the latter example — look at how clear and concise it is! However, when I first started using Entity Framework I quickly came across specific scenarios where the ORM was not working like I would have expected. Below are my top 3 insights about Entity Framework that I had to learn the hard way.

1. Select() is your friend

When I first started using Entity Framework I was enamored by the idea of never having to write boring SQL connection and mapping code again. During that time, I was frequently writing quick concise LINQ queries like this all over the place:

All things were great for a while until I moved my code to production, where there was a lot more data, and my webpage started taking a very long time to return results. What was the problem?

My customer summary webpage was only displaying 4 columns from the Customer table to display summary information about customers: “State”, “Name”, “Address”, and “Email”. However, my Customer table had 50 columns in it. I foolishly thought since I was only using 4 columns from the table, Entity Framework would be smart enough to only bring those 4 columns of data back from the SQL server. Turns out I was wrong — what really was running behind the scenes was this:

Egad! I was running a SELECT *, which all SQL practitioners know is a big no-no both for performance as well as future maintainability of your queries!

One of the issues (features?) with Entity Framework is that by default the queries all run as SELECT *. Instead of bringing back all of the columns in a table, I figured I could limit my results by using Select() to choose which columns I wanted to return:

And there was much rejoicing amongst the DBAs.

2. Lazy Loading can be great or terrible

Lazy Loading is the idea that data isn’t pulled from the database until it is needed (hence the term “lazy”). This is a great feature if used correctly since it minimizes the amount of data that is transferred over the network. However, if you use lazy loading (which is often the default) unknowingly, you might be querying the SQL server more than is necessary.

Let’s say our Customer and Order models looks like this, where every Customer has many associated Orders:

If we write a LINQ query to bring back our Customer data and only use Customer data in our view, SQL just executes 1 query and things are efficient:

Controller:

View:

Result:

Bringing back fields exclusive to the Customer model.

SQL Trace:

One “SQL:BatchCompleted” means only a single query ran.

As you can see, Entity Framework only ran one query against the database and we are getting good performance. Very nice!

If we go ahead and change our View to display some Order data though:

View:

Result:

Now EF nows to bring dollar amounts back from our Order model.

SQL Trace:

The Order query is executed once for every customer — this could result in horrible performance.

Because of Lazy Loading, entity framework runs a query to retrieve an order for each customer! In my example data with 5 Customers with 1 Order each, Entity Framework runs 6 queries: 1 query to retrieve our Customers, and then 5 queries to retrieve orders for each of customers! Imagine if we were display more than 5 customer records — our SQL server would be getting slammed with queries!

The solution to this is to Eager Load the data. This means all of the data will be brought back in our initial query via a SQL JOIN. In order to do this, we just use the Include() method to retrieve all of the data up front:

Controller:

Trace:

EF generated SQL might be ugly, but it is efficient in this case.

Entity Framework only executes 1 query. This causes a little bit more upfront overhead since it transfers the Order data all at once, which would be a waste if we didn’t use that Order data in our View, but if we do plan to use Order data in our View, then using Include() reduces the number of queries that will run against the SQL server.

3. Sometimes it’s OK to not use Entity Framework LINQ queries

By default, Entity Framework generates some pretty interesting queries (interesting at least in the sense that no normal human being would structure a query like this). For example, in SQL I could write:

And the query generated by Entity Framework might look something like this:

Extents? Parameters? Aliases? What’s all of this extra junk in my query? Although the latter SQL statement works, it isn’t the prettiest on the eyes. And this is the example of simple query. Once you start writing complex LINQ queries using Entity Framework that involve the likes of Join(), GroupBy(), etc… the raw SQL that gets generated can get hairy and inefficient. In those cases, I’ve learned that it is perfectly to rely on good old t-sql stored procedures:

At the end of the day, we are using Entity Framework to make our lives easier. If a LINQ query gets too complicated or is generating inefficient queries, it is always fine to fall back on an old standby.

Thanks for reading. You might also enjoy following me on Twitter.

Want to learn even more SQL?

Sign up for my newsletter to receive weekly SQL tips!

Book Notes: The Personal MBA: Master the Art of Business — by Josh Kaufman

I highlight and take notes when I read nonfiction books. Once I finish a book, I format and edit my notes so that I can easily remind myself of what I learned without having to reread the book. These notes are not a substitute for reading the book, they only serve as a reminder of key concepts.


The man who grasps principles can successfully select his own methods. The man who tries methods, ignoring principles, is sure to have trouble. — RALPH WALDO EMERSON

If you put the same amount of time and energy you’d spend completing an MBA into doing good work and improving your skills, you’ll do just as well.

Whoever best describes the problem is the one most likely to solve it. — DAN ROAM, AUTHOR OF THE BACK OF THE NAPKIN

What you need is a latticework of mental models in your head. And, with that system, things gradually fit together in a way that enhances cognition.

Every successful business (1) creates or provides something of value that (2) other people want or need (3) at a price they’re willing to pay, in a way that (4) satisfies the purchaser’s needs and expectations and (5) provides the business sufficient revenue to make it worthwhile for the owners to continue operation.

At the core, every business is a collection of processes that can be reliably repeated to produce a particular result. By understanding the essentials of how complex systems work, it’s possible to find ways to improve existing systems, whether you’re dealing with a marketing campaign or an automotive assembly line.

There is a difference between (A) what an MBA does to help you prove your abilities to others and (B) what getting an MBA actually does to improve your abilities. They are two different things. — SCOTT BERKUN, AUTHOR OF MAKING THINGS HAPPEN AND THE MYTHS OF INNOVATION

College: two hundred people reading the same book. An obvious mistake. Two hundred people can read two hundred books. — JOHN CAGE, SELF-TAUGHT WRITER AND COMPOSER

3 problems about MBA programs:

  1. Often times not worth the cost.
  2. Too much theory, not enough real world problems.
  3. MBA programs don’t guarantee high paying jobs.

Business schools don’t create successful people. They simply accept them, then take credit for their success.

Business school is a big risk. Should you choose to enroll, the only certainty is that you will shell out about $125,000. Such a figure correlates to a $1,500/month non-deductible loan repayment and a ten-year period of time in which you will not be able to save a red cent.

According to Pfeffer and Fong’s study, it doesn’t matter if you graduate at the top of your class with a perfect 4.0 or at the bottom with a barely passing grade — getting an MBA has zero correlation with long-term career success. None.

The quickest and easiest way to screw up your life is to take on too much debt.

Financial stress can destroy relationships, threaten your health, and jeopardize your sanity.

When you first start to study a field, it seems like you have to memorize a zillion things. You don’t. What you need is to identify the core principles — generally three to twelve of them — that govern the field. The million things you thought you had to memorize are simply various combinations of the core principles. — JOHN T. REED, REAL ESTATE INVESTMENT EXPERT AND AUTHOR OF SUCCEEDING

Your job as a businessperson is to identify things that people don’t have enough of, then find a way to provide them.

Some businesses thrive by providing a little value to many, and others focus on providing a lot of value to only a few people.

So often people are working hard at the wrong thing. Working on the right thing is probably more important than working hard. — CATERINA FAKE, FOUNDER OF FLICKR.COM AND HUNCH.COM

10 ways to evaluate a potential market for a new business. Rate on scale of 0–10. Sum of 75+ is potential for an idea.

  1. Urgency
  2. Market size
  3. Pricing potential
  4. Cost of customer acquisition
  5. Cost of value delivery
  6. Uniqueness of Offer
  7. Speed to market
  8. Up-front investment
  9. Upsell potential
  10. Evergreen potential

The competitor to be feared is one who never bothers about you at all, but goes on making his own business better all the time. — HENRY FORD, FOUNDER OF THE FORD MOTOR COMPANY AND ASSEMBLY-LINE PIONEER

When any two markets are equally attractive in other respects, you’re better off choosing to enter the one with competition. Here’s why: it means you know from the start there’s a market of paying customers for this idea, eliminating your biggest risk.

Some ideas don’t have enough of a market behind them to support a business, and that’s perfectly okay. That doesn’t mean you should ignore them: side projects can help you expand your knowledge, improve your skills, and experiment with new methods and techniques.

Don’t be shy about showing potential customers your work in progress.

Nobody — no matter how smart or talented they are — gets it right the first time.

Pick three key attributes or features, get those things very, very right, and then forget about everything else… By focusing on only a few core features in the first version, you are forced to find the true essence and value of the product. — PAUL BUCHHEIT, CREATOR OF GMAIL AND GOOGLE ADSENSE

Any engineer that doesn’t need to wash his hands at least three times a day is a failure. — SHOICHIRO TOYODA, FORMER CHAIRMAN OF THE TOYOTA MOTOR CORPORATION

People don’t buy quarter-inch drills; they buy quarter-inch holes. — THEODORE LEVITT, ECONOMIST AND FORMER PROFESSOR AT HARVARD BUSINESS SCHOOL

Most drivers don’t buy expensive off-road-capable vehicles because they actually drive off the road. They buy them because off-road capability makes them feel adventurous and bold, capable of meeting any driving challenge.

Believe it or not, it’s often wise to turn away paying customers. Not every customer is a good customer: customers who require more time, energy, attention, or risk than they’re worth to your bottom line aren’t worth attracting in the first place.

Your job as a marketer isn’t to convince people to want what you’re offering: it’s to help your prospects convince themselves that what you’re offering will help them get what they really want.

Raising your prices can increase demand by appealing to a more attractive type of customer.

The best salespeople are the ones who can listen intently for the things the customer really wants.

If you discover why, how, and how much your offer will benefit the customer, you’ll be able to explain that value in terms they’ll understand and appreciate. Understanding the value you can provide your customers is the golden path to a profitable sale.

Present yourself to the prospect as an “assistant buyer.” Your job is not to sell the prospect a bill of goods: it’s to help them make an informed decision about what’s best for them.

Accepting this small offer creates a psychological need to Reciprocate, subtly stacking the deck in the salesman’s favor. Prospective car buyers who accepted this free offer were far more likely to purchase a vehicle, add optional accessories, and agree to less attractive financing terms. As a result, these customers spent thousands of dollars more than the people who did not accept anything from the salesman while negotiating. That doesn’t make rational sense, because the coffee or cookies cost the dealer very little, but Reciprocation makes it more likely that the buyer will “pay back” the favor with a much larger concession.

Colloquially, this approach is sometimes called the “take the puppy home” strategy. If you visit a pet store and meet an adorable puppy, but you’re not sure whether or not you’re ready to commit, the pet store will tell you to take the puppy home on a trial basis. “If it doesn’t work out,” the salesman says, “you can always bring it back.”

Do whatever you can do to provide something that unexpectedly delights your customers.

Finance is the art and science of watching the money flowing into and out of a business, then deciding how to allocate it and determining whether or not what you’re doing is producing the results you want.

Accounting is the process of ensuring the data you use to make financial decisions is as complete and accurate as possible.

The Cash Flow Statement is straightforward: it’s an examination of a company’s bank account over a certain period of time.

The Income Statement contains an estimate of the business’s Profit over a certain period of time, once revenue is matched with the related expenses.

A Balance Sheet is a snapshot of what a business owns and what it owes at a particular moment in time. You can think of it as an estimate of the company’s net worth at the time the Balance Sheet was created.

Believe it or not, there are only four ways to increase your business’s revenue: Increase the number of customers you serve. Increase the average size of each Transaction by selling more. Increase the frequency of transactions per customer. Raise your prices.

If you want to do good work, taking care of yourself isn’t optional. Nutrition, exercise, and rest are the inputs your body converts into productive energy. Poor (or too little) input inevitably reduces the quantity and quality of your output.

People respond twice as strongly to potential loss as they do to the opportunity of an equivalent gain. Eliminate this perception of risk by offering a money-back guarantee or similar Risk Reversal offer, and people will feel the decision is less risky, resulting in more sales.

Great management is boring — and often unrewarding. The hallmark of an effective manager is anticipating likely issues and resolving them in advance, before they become an issue.

Some of the best managers in the world look like they’re not doing much, but everything gets done on time and under budget.

The problem is, no one sees all of the bad things that the great manager prevents. Less skilled managers are actually more likely to be rewarded, since everyone can see them “making things happen” and “moving heaven and earth” to resolve issues — issues they may have created themselves via poor management.

Limit scarcity by:

  1. Limited Quantities
  2. Price Increases
  3. Price Decreases
  4. Deadlines

It’s perfectly okay to change your Goals. Sometimes we think we want something, only to find out later that we don’t want it so much anymore. Don’t feel bad about that — it’s called learning.

The more people know your capabilities and respect the Reputation you’ve built, the more Power you will have.

Comparative Advantage also explains why diverse teams consistently outperform homogenous teams. Having a wide variety of team members with different skills and backgrounds is a major asset: it increases the probability that one of your teammates will know what to do in any given circumstance. If every team member has the same skills and the same background, it’s far more likely the team will get stuck or make a preventable error.

There’s a reason high-performing surgical teams, military units, and sports teams tend to be small and focused: too much time spent in communication and coordination can kill a team’s effectiveness.

Everyone has a fundamental need to feel Important. The more Important you make them feel, the more they’ll value their relationship with you.

People will be more receptive to any request if you give them a reason why. Any reason will do.

The most effective testimonials tend to follow this format: “I was interested in this offer, but skeptical. I decided to purchase anyway, and I’m very pleased with the end result.”

Dale Carnegie recommends “Giving others a great reputation to live up to.” He was a wise man — raise your expectations of others, and they’ll naturally do their best to satisfy those expectations.

Here’s the golden rule of hiring: the best predictor of future behavior is past performance.

Checking references at this point is a good use of time. Question should be simple: Would they work with the candidate again? If they hesitate or talk around the question, it’s a no. If you can’t reach a reference when you call, leave a message and ask them to contact you if the candidate is extraordinary. If they are, you’ll receive a return call. If they aren’t, you won’t.

Finally, give promising candidates a short-turnaround project or scenario to see how they think, work, and communicate firsthand. Small projects tend to work best for skilled technical employees, while scenarios work best for candidates who will be responsible for product creation, marketing, sales, business development, finance, and management roles. The outcome of the assignment should be a deliverable of some kind: a report, a pitch, an asset, or a process.

If you want to build a system that works, the best approach is to build a simple system that meets the Environment’s current selection tests first, then improve it over time. Over time, you’ll build a complex system that works.

The more tightly coupled the processes in a system are, the more likely failures or delays will affect other parts of the system.

Self-education, whether it’s about business or anything else, is a never-ending process.

Thanks for reading. You might also enjoy following me on Twitter.

Want to learn even more SQL?

Sign up for my newsletter to receive weekly SQL tips!