Understanding and Improving Database-Backed Applications