4 uses for optimization in software

Optimization is often highlighted in supply chain contexts – routing, scheduling, inventory, and other tangible, visible problems. This post explores a few use cases in computing and software.

I had the privilege of organizing a cluster on optimization solvers for the INFORMS Computing Society (ICS) meeting back in March (great conference!). If you’re not familiar with ICS, it “addresses the interface of OR and computing,” by which it means “software and systems capable of solving industrial-scale problems.” Lots of solver development, computing techniques, and other work that lets us actually solve optimization problems instead of merely modeling them.

One thing I’ve always found interesting is the direction of the relationship between “computing” and “operations research.” In the overwhelming majority of cases this means using computing to accomplish optimization. So computing → optimization. But what about the other direction?

That may seem entirely right, but as someone who came to Operations Research (OR) from software engineering, I wish we talked a bit more about how OR impacts software and computing (it does! a lot!). So optimization → computing. 

This post highlights some of the use cases in the digital realm. We pose a few problems both well known and less well known that don’t involve people, trucks, or goods. These, instead, hail entirely from the silicon wafer flatlands.

SQL query optimization

Structured Query Language (SQL) is a great success of Human-Computer Interaction. As a user, you can write queries to interact with structured databases that look almost like plain English, and the database will run off and get all the data that you need in as timely a manner as possible.


SELECT	first_name,
	last_name,       
        email 
FROM   	users
WHERE  	user_id = 42

This looks really simple, but under the hood the database has to do a lot of work to create a query “execution plan” (or just “plan”) for how it actually scans, filters, joins, and identifies which data to look at. A good plan can keep an online ecommerce site up and accepting orders or help fill out an analytics report in time for tomorrow’s board meeting, while a bad plan might result in a service outage or a lack of actionable insights at the board meeting.

To understand what this means, take a look at the following query. This should look pretty normal to anyone who has ever worked with databases.


SELECT  u.first_name,
        u.last_name,
        u.email,
        o.order_id,
        o.order_date,
        o.total_amount
FROM    users u,
        orders o 
WHERE   u.user_id == o.user_id
AND     u.email LIKE '%hacker%'
AND     o.order_date = '2025-06-30'

Even though it’s a simple query, there are a number of questions the database has to answer before it can find the right records.

  • Is it better to scan the users table or the orders table first?
  • How many records need to be examined in each table?
  • Are there indexes to leverage, and what impact will they have on record count?
  • What algorithm should it use to join records from the two tables together?

Most databases take this information and try to estimate the cost of different plans. They then run a quick search procedure over the space of execution plans to determine the best order of operations. This all has to be done in milliseconds to be usable in an online database. Basically every time someone runs a SQL query, they’re using a type of optimization — and they probably have no idea!

You can read more about SQL query optimization in this post from CockroachDB and this paper from Microsoft Research.

Network routing for real-time internet applications

If you play online video games like Fortnite or World of Warcraft, or use the internet for any other tasks like financial trading or video chat, you know the value of low latency and high network resilience. This is another area you probably use optimization without even knowing it. The internet (like communications networks in general) is a pretty chaotic place. Users drop and join unpredictably, nodes go down, traffic piles up.

This unpredictability means that you might get stuck with an unresponsive King Kong at level 86 after 10 hours playing Rampage. That is, unless your service provider has some mechanism to resolve and re-optimize network paths as they occur in real time.

That’s pretty tough! To handle this effectively, they have to:

  • Continually monitor network performance, detecting congestion, failures, and other issues.
  • Keep a topological model of that network up-to-date as it changes.
  • Dynamically reroute paths for users in aggregate, while respecting capacity constraints of network nodes and arcs, to minimize latency and maximize reliability.

You can read more about network optimization in this post from Subspace.

Cloud service resource allocation

Before cloud computing, if you needed a database set up you had to go talk to a database or systems administrator. They might give you a schema on an existing server, which you would share with other people, or possibly even rack a new one for you. It was a manual process with physical boxes sitting in air conditioned space somewhere.

Cloud computing has completely changed all that. Now you just log into your service provider, provision a new database, and poof! Now you have a completely fresh schema, tables, and everything you need to build the next awesome thing. It’s magic.

Or at least it seems like magic. But that’s really just an abstraction. In reality, that shiny new serverless database is actually sitting on a very physical server in a massive data center somewhere. And that server has very physical limits to memory, CPU, and storage. And you’re sharing it with a bunch of people you’ve never met before. And if that’s not scary enough, should your cloud provider allocate your database instance somewhere inconvenient, then you’ll get bad performance.

When we put it like that, this sounds more like the software development version of a Sartre play. So how does your cloud provider keep things running smoothly when they don’t know what services you want and when you’ll want them? 

Optimization! At Microsoft, for example, researchers have looked at making “placement decisions” (what hardware a database gets assigned to, essentially) in their cluster manager using integer programming. This lets them minimize service disruptions while respecting resource constraints. Importantly, it also allows them to maintain a certain level of over-subscription, which pretends hardware has more resources than it actually does.

You can read more about resource management in cloud databases in this article from Microsoft, and about their “solver-in-the-loop” approach to cluster management in this paper.

Planning and scheduling cybersecurity controls and mitigations

We all regularly hear about the complexities of today’s industrial and production supply chain in the news, and it’s well known that organizations in that space rely on optimization for all kinds of operations. Our information technology supply chain has gotten every bit as complex. This involves everything from hardware and software we use to vendors we work with, cloud providers, our network topology, where we store data, and how we train employees.

The potential scale of cybersecurity supply chain failures is every bit as drastic as physical supply chain disruptions. Think of the massive data breaches at Equifax in 2017 or the US Office of Personnel Management in 2015.

There are many attack vectors to these supply chains, and it is impossible to secure them completely. So the question becomes: what investments do we make to minimize risk, and what can we afford? Just like in physical supply chain management, that is an optimization problem.

Optimization has been applied to a number of problems in cybersecurity infrastructure, as you can read in this survey. Additionally, Prof. Laura Albert at University of Wisconsin-Madison uses optimization to plan security controls in this paper.

Optimization ← → Computing

After touring these few example areas of optimization → computing I hope I’ve got you thinking about quieter areas where optimization lives and breathes. (It’s also possible I’ve only prompted you to ready player one or change your password.) Optimization is a powerful tool in many applications — and as computing advancements continue to make giant strides and headlines, more often than not, optimization will play a role in its success. If you pay attention, you can find it just about everywhere.

Video by:
No items found.