The Bose-Hubbard model with disorder in low-dimensional lattices