Feedback on my Custom DataStore Wrapper using MemoryStoreService for Session-Locking

i was bored and was just scrolling about when I saw Suphi’s DataStore Module (SDM); it seems like a good resource but the API style is not in my liking; so i made my own, with a twist

as you saw in the title, it uses Memory Stores to do session-locking which has far less latency

i made this with the goal of faster load time, no session-locking getting stuck, and just a unprofessional personal replacement for profileservice

this uses exponential backoff for all datastore and memory store operations;

im considering on actually using this in my game but before that i need some feedback since i dont know what im doing;
Entry.rbxm (30.4 KB)

example usage:

local DS = require(script.Entry)

DS:Init()

local Schema = DS:GetSchema({
	Name = 'Main';

	Structure = {
		Coins = 0;
	}
})

game.Players.PlayerAdded:Connect(function(player)
	Schema:LoadPlayerModelAsync(player, true):andThen(function(Model)
		print(Model.Data.Coins)
		Model.Data.Coins += 1
		Model.Data.Coins ^= 2
		print(Model.Data.Coins)

		Model:SaveAsync():finallyCall(print, 'saved')
	end):catch(warn)
end)

game.Players.PlayerRemoving:Connect(function(player)
	Schema:FindAndReleaseModelAsync(player)
end)

average load time = ~6.8s ~5.5-7.2s (i forgot i had task.wait while debugging)

oh wait i think suphi’s module already does this? :grimacing:

  • the hell is this
  • ok cool
  • useless!!!
  • erm what the sigma
  • profileservice on top
  • suphi’s module on top

0 voters

3 Likes

just added Object:FindAndReleaseModelAsync(player: Player) so you can release it on player removing

oopsies daisies looks like the reconcile function isnt working properly
updated it

I understand this is meant to be feedback, But the way you sound it and do this makes it look more like a community resource.

You may have admins get confused and take down your post, I don’t know though.

1 Like

Its not really a reliable resource, I intend to gather feedback on stuff that potentially can break my wrapper; and by the time I finished making this, I plan to actually use it in my game; but before that I need to make sure that my wrapper is good enough (and perchance for showing off :wink:)

1 Like

i forgor that SharedDataReferenceSchema is [string]: Model and not [number]: Model; which made FindAndReleaseModelAsync not work properly; (its time for strict typechecking + gdpr userid tracking thing)

1 Like