The 21-year-old joins for an undisclosed fee from Belgian club Lokeren on a four-year deal, with the option of a fifth in the club's favour.
Diaby was born in Senegal then brought up in Spain from the age of four and came through the academy at Cornelia.
He signed for Italian giants Sampdoria aged 18 but never made an appearance and was loaned out to Mantova, Peralada and Girona.
He then moved last summer to Lokeren who finished bottom of the top flight in Belgium, with Diaby playing 17 games and scoring once.
He joins fellow 21-year-olds Aapo Halme and Mads Andersen as well as 20-year-old Toby Sibbick as a quartet of Barnsley centre-backs.