We consider a content distribution network (CDN) in which data hubs or servers are established in multiple locations to cater to local demands. The distributions of data to these hubs along with related network design problems (such as hub location and user assignment) are the key decision problems to consider to minimize the total routing cost. A new model for allocation of segments is introduced in Sen, Krishnamoorthy, Rangaraj and Narayanan, Comput Oper 62 (2015), 282–295, in which local preferences guide the database partitioning process, and the servers are fully connected to each other. In this article, we develop a simulated annealing (SA) approach (referred to as SA‐mesh) to solve this problem and compare its performance with the corresponding mixed‐integer linear programming (MILP) formulation. We also formulate a much harder variant of the problem in which servers are interconnected by a tree. We develop a SA algorithm (referred to as SA‐tree) for this variant, in which a local search is incorporated to find a suboptimal tree backbone. We use a customized data structure based on linked lists to represent a solution in our algorithms. This enables our algorithms to scale to much larger instances of the problem. We use optimal solutions and the benchmarks obtained by CPLEX to justify the performance of our algorithms. © 2016 Wiley Periodicals, Inc. NETWORKS, Vol. 68(1), 4–22 2016