Is my datastore2 method ok for my game?

Is my function reliable?

Essentially, I'm making a datastore system for players to buy vehicles using DataStore2.
This function that I made saves the aircraftName into a table once bought, so there is no need to save anything after the player leaves, and there's no need to load anything when the player joins.
function module:BuyAircraft(player ,aircraftName)
	local airCraft = aircraftModule[aircraftName]
	if not airCraft then return end
	
	local aircraftStore = DataStore2("PlayerAircraft", player)
	aircraftStore:Get({})
	
	local currentAircrafts = table.clone(aircraftStore.value)
	
	-- This returns if player cant buy the aircraft or already owns it.
	if not currencyModule:ableToBuy(player, airCraft.Costs.CostType, airCraft.Costs.Cost) or module:ownsAircraft(player, aircraftName) then return end
	
	-- essentially just subtracts the currency. 
	currencyModule:subtractCurrency(player, airCraft.Costs.CostType, airCraft.Costs.Cost)
	
	-- adds the name of the aircraft to the duplicated aircraft table.
	table.insert(currentAircrafts, aircraftName)
	
	aircraftStore:Set(currentAircrafts)
end

Datastore2 is reliable, but not very versatile. I would say it’s sufficient for games that don’t have much to save. If you wish to have a more versatile framework, I would recommend ProfileService. It’s not hard to learn and you get much more freedom with it.

Yeah you’re right about that. I had other games that needed a specific way to save data that datastore2 couldn’t provide. I’ve heard of profile service but I never thought to use it since I don’t have much issues with datastore2. If ProfileService could help me then I have no reason not to try it.

DataStore2 shoulnd’t be used anymore it will most likely kill your game after few times. The new storage limit is 1MB per lifetime players not per key, and because of how the bereeza methods works that will somehow exceeds this amount. You should use ProfileService or the newer version ProfilteStore (used in Grow a Garden).