Store layouts in database