Homogeneous quantum system is very rare in nature due to decoherence, thermal fluctuations, impurities, etc. Hence, inhomogeneous quantum many-body systems form a more practical ground to implement quantum information protocols. Equilibrium and non-equilibrium dynamics of quantum correlations in homogeneous spin systems is well studied in literature. We have investigated the static and dynamical patterns of entanglement in an anisotropic XY model with an alternating transverse magnetic field. Apart from the antiferromagnetic and paramagnetic phases, the model possesses a dimer phase which is not present in the homogeneous transverse field XY model. At zero temperature, we find that the first derivative of bipartite entanglement can detect all the three phases. Next, we introduce more inhomogeneity in the transverse field in the same system and study the behaviour of entanglement in a random-field quantum XY model under quenched disorder. I will show that the quantum discord length is significantly enhanced by the introduction of disorder while entanglement length show no significant enhancement.