In case of ionic BeSO4, the hydration enthalpy is much more than its lattice enthalpy. Hence, it is water soluble.
BaSO4 is insoluble in water due to high lattice energy and low hydration energy. Lower the lattice energy and higher the hydration energy more is the solubility.
BaSO4 (It is the Exception of Fajan’s rule).