A comparison of the differential cross sections for the processes Z/gamma* + jets and photon (gamma)+ jets is presented. The measurements are based on data collected with the CMS detector at root s = 8TeV corresponding to an integrated luminosity of 19.7 fb(-1). The differential cross sections and their ratios are presented as functions of p(T). The measurements are also shown as functions of the jet multiplicity. Differential cross sections are obtained as functions of the ratio of the Z/gamma* p(T) to the sum of all jet transverse momenta and of the ratio of the Z/gamma* p(T) to the leading jet transverse momentum. The data are corrected for detector effects and are compared to simulations based on several QCD calculations.