× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Brute Force Can Be A Beautiful Thing

Jonathan Eunice
Dec 13, 2014
<p>As engineers and designers, we want to do things things the Right Way. We search for the Elegant Solution. But we’re always also fighting the realities of budget and time pressure.</p> <p>Often, brute force solutions work just fine. Don’t have time for a fancy algorithm? Simple heuristics sometimes give you 90% or 95% solutions with a fraction of the work.</p> <p>Queries start taking to long to execute? You could go in and do DBA-worthy analysis. Get the database to <code>EXPLAIN</code> its query plan. Look at various indexing strategies, pre-materialized views, or query restructurings. You know what we could also do? Buy a bigger server. Get more memory, faster disk, or more CPUs. That used to be hard, time-consuming, and expensive—but in the cloud age, nothing could be simpler.</p> <p>I’m not advocating living an unexamined life, forgetting about deep metrics and efficient algorithms, or failing to optimize. I’m just saying there are always tradeoffs. When it comes to solving problems in the now, on time and under budget, you should seriously consider the brutally simple, brute force alternatives. Even if they’re not the ideal solutions, they can “make space” in your budget and timeline.</p>
comments powered by Disqus