Announcing DataStore v2.0 - Automatic Versioning, Data Tagging, & Listing!

Is this some sort of dream? No words can express my excitement to see this image:

I needed this badly due to my tendency to break things after experimentation.

@loleris I would like to see ProfileService updated to use Datastore 2.0

4 Likes

I’m happy but sad at the same time xD I will have to update my DataBase v6 and include DataStore v2.

What’s the use of an open source module when you don’t have the latest updates, right? xD
:grinning_face_with_smiling_eyes:

3 Likes

It seems there’s a typo on the line right after it too where SetMetaData() should be SetMetadata().

2 Likes

This is easily my favourite Roblox update for a long time and fixes a number of my major pain points for the entire platform. I hope this functionality will be integrated into existing DataStore wrappers people have developed!

3 Likes

Another question: What is the point of setting Metadata? Can anyone explain that to me? Why shouldn’t I just store the metadata as normal data, where I have more memory to work with? Is there an advantage of storing it in such a way?

3 Likes

Supporting migration code can be a pain point for long-term projects. I have hundreds of lines of legacy deserialization code that I still need to upkeep; Most of it is over 5 years old.

I felt clever implementing an extremely compact save format for inventory data that encodes using the inventory’s length, but now I need to pass the length of the legacy global inventory when deserializing characters so that I can properly skip the old equipment data.

I’m okay with keeping old code like this around for a while, years even, but it’s a huge relief to know that I don’t need to support it forever.

13 Likes

Because in the future we’ll be getting features to query by properties inside metadata. You’re fine doing it inside your normal data partition, meta data should be for small things.

5 Likes

I don’t think that’s the best option, but it has to consider what kind of script it is. As roblox continues to update things, older scripts end up not working or some other reason. I had a game from 2015 and everything doesn’t work anymore, but before it did. Just update the script occasionally just to keep it working.

Off note: I am a huge fan of your game, keep up the great development! Nice meeting you, Tomarty!

4 Likes

What benefits does this have vs DataStore 2 made by @Kampfkarren . I made the switch to DataStore 2 last Saturday in my game, and do not plan to switch back unless there is a good reason for me to use this. I can also access versions just fine with DataStore2, and it says there forever and not just temporarily.

2 Likes

Is there an ETA on binary string support for DataStores? string.pack was added, but we still can’t use packed strings for saves without expensive base64 / ascii85 conversions. JSON is great for beginners, but it’s unnecessarily slow, and is honestly horrible to have set as a default; DataStores only ever needed to support strings, because developers can easily use JSONEncode / JSONDecode. I have the same criticism for MessagingService.

I’m hoping to switch to using binary strings for save data someday (instead of bit buffers), so that I can efficiently skip through data and find specific information without needing to deserialize the entire thing. If I need to redirect them to another server, I could just skip to their active character’s data, read its current zone, and send them on their way. Players can have potentially hundreds of individual characters with stats, items, quest progress, perks, etc., so deserializing between intermediate formats can take milliseconds of execution time from an already busy server. With a packed string format it’s very fast.

I’m also planning a house system with furniture customization, and string.pack is the obvious solution for storing these object. “{X:-61.20931480293841,Y:-13.1213440189129,Z:21.10298308140293}” has horrible efficiency compared to string.pack("fff", x, y, z) which uses only 12 bytes. Compact formats like this will reduce network overheads, reduce server overheads, and reduce data storage costs. It should be supported properly.

26 Likes

Honestly one of the best updates we’ve had in awhile, all of these features are gonna make developing much easier.

3 Likes

What is the advantage of having metadata tags over simply saving a table with said info in?

4 Likes

give us the power to make actual SQL queries

9 Likes

Is there any reason to use data store2 now?

1 Like

Answer is simple, it will give you ability to query and index based on attributes in the future.

1 Like

Great improvements, I’m working on a new game and this will be very helpful!

3 Likes

Will this be automated by Roblox, or will we still be required to use our code to do the system.

1 Like

Roblox expects you use the new 2.0 to save and to delete user data upon request. Not automated.

1 Like

I thought it would be automated since there is literally a way to attach a UserId to a key.

1 Like

Right now, listing keys only allow you set the prefix of the keys, we’re considering to support sorted listing so that you can select a range of keys with ascending or descending order. This can help you build in-game search based on the key structure.

4 Likes