Target is building new supply chain software to better align inventory availability with consumer demands. To better position the retailer for online and mobile shopping, the retailer’s IT team is writing custom software to quicken the pace with which merchandise gets from its stores to consumers.

"We need to get the fundamentals in place and that's because the stress and strain we put on our supply chain today is very different to what was the case four or five years ago," says Target CIO Mike McNamara, who spoke to CIO.com at the Forbes CIO Summit earlier this month.

Target's plans are comparable to other big box retailers trying to keep afloat in the vast digital retail sea ruled by Amazon.com. Wal-Mart Stores has overhauled its ecommerce platform and built custom cloud infrastructure and online search capabilities, some of which it has released to the open source community.

Why Target is tidying up its supply chain

Target, which last year allocated $1 billion for its digital business transformation, is modernizing an outdated supply chain predicated on a linear model in which goods went from the manufacturer to a distribution center and then one of its 1,800 stores for purchase.

Applying agile and DevOps principles to develop software in iterative bursts with the blessing of the business lines, the retailer is writing supply chain apps for assortment planning, digital merchandising, store ordering and forecasting as well as supplier ordering and demand forecasting. Developers track projects in Jira, share code in GitHub and configure applications with Chef.

The chief challenges? McNamara says Target's inventory lens has widened to include more products from countries such as China and perishable groceries for which timely arrival is a critical factor. He also says Target is now shipping products directly from fulfillment centers, distribution centers and local storesto consumers' homes to accommodate preferences for online and mobile ordering. In Target's fourth quarter, one third of its online orders were picked up in store or filled from inventory in stores.

These factors have led Target to own a "longer bit of the supply chain," McNamara says. "We're using the whole enterprise inventory to service our guests in a way we never did before." The new apps are designed to better streamline increasingly complex operations.

Target naturally generates a lot of data, so it relies on several open source databases and data management tools, including Cassandra, Kafka, Couchbase, MongoDB and Hadoop. "If you want a really sophisticated supply chain, you have to have super systems and technology," says McNamara, who joined Target in June 2015 from U.K. grocery giant Tesco.

Target back tracks on IT outsourcing

Updating a supply chain built for an older era is challenging enough. But McNamara is also reversing course, bringing in-house the 65 percent of technology capabilities that had been outsourced to U.S. and Indian vendors, which deployed commercial software on behalf of the retailer.

The in-sourcing and custom development is a painstaking process, but one McNamara says is necessary before the retailer can begin analyzing its supply chain for sales and customer trends and better allocate resources across the enterprise. "The world of packaged software just doesn't serve big businesses well," he says. "We're recruiting engineering talent as fast as we can and replacing third parties," he says.

McNamara isn't opposed to working with vendors -- Target still relies heavily on several -- but he says it's vital that Target build smarter software, including forecasting engines and allocation algorithms, to leverage insights from its store and logistics operations. But he needs help. McNamara is recruiting a mix of seasoned software engineers, as well as recent college graduates.

"I absolutely believe that we need to be able to plot and create our own technology future," says McNamara.

Target continues to recover from a major cybersecurity breach in which hackers stole credit card numbers from millions of the retailer's customers in 2013. The company has spent the last few years bolstering its digital defenses and shoring up leaky IT systems.

For his part, McNamara says he hopes to build technology capabilities and a flexible architecture that "will be there long after I'm gone."