Which is the best to use? (DataStore)

Which is the best to use?

-- 1
local DataStoreService = game:GetService('DataStoreService')
local DataStore = DataStoreService:GetDataStore('MyData')

or

-- 2
local DataStore = game:GetService('DataStoreService'):GetDataStore('MyData')

Depends. If you’re going to use multiple data stores, use the first one. Otherwise the second one if you’re only going to use one data store. Performance-wise doesn’t affect anything.

2 Likes