Question about datastores

I have a few questions about datastores.

  1. Is there a way to see how much MB a key is taking up? (So I can see how close it is to the limit)

  2. Is there a way to make it so a key will start removing the oldest data it stored once it starts reaching the keys limit?

  3. I was told you can have unlimited keys, is this true? Also what is stopping someone from spamming a bunch of keys and filling them with the 4MB max data in an attempt to sabotage roblox. For this reason I assumed all data had some sort of limit applied.

1 Like

You can make a few datastores and not have so much going to one. Also can check over data used and really shouldn’t have a way for that to even happen. Be picky what you choose to place in the datastore. You can also use smaller code like data that is interpreted to mean something larger via script. A simple 3 char code could mean way more, after being read from the datastore. A read like this: A12T04Q11 … could mean volumes. With plenty of room to add a few more. Use a sting split to separate the code. A12, T04, Q11 …

1 Like
  1. Basically you want to serialize the value into a string then count the characters (1 char = 1 byte). Here’s a post on it.

  2. Nothing built-in that I’m aware of. You’d need to implement this yourself in a storage layer.

  3. There’s no limit built in for number of keys… both the number of keys and “spamming a bunch of keys…” issues are well managed by the data store write limits that are imposed. Beyond that, Roblox has very sophisticated ways of dealing with DDOS attacks as they have been the target of them frequently for years.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.