Both designs will work and its downto what current the TRANSISTOR will see and what supplies are being used.
In this topology the main BJT will sink 3Amps and thus the source to the BASE will need to be capable of driving TBD mA into it to ensure conduction. The Transistor will dissipate more power
In this topology the current the BJT has to sink is considerably less and it is purely the energising current of the relay. However, you need to source a relay.
The 1st is advantageous from a partcount but the 2nd is advantageous from a power dissipation in the BJT and thus current sourcing capability from the GPIO pin.
An improvement could be to use a FET instead of a BJT as the gate drive requirements would be less.
There is a 3rd option and that is using the 1st topology, with a FET but PWM the FET. Solenoids have two current requirements
Pull-in is ALWAYS higher than hold as it has to produce enough magnetic force to close the airgap and move the plunger. Hold is lower as you need less amp-turns to produce the same MMF with a vastly smaller airgap. Thus you can have higher duty for PWM (ie higher current) and lower duty for hold (ie lower current == lower losses)
HOWEVER, this is dependent on alot more infomation about the solenoid: change in inductance, current change.