DocumentService - A powerful, schematised DataStore library

I hope the docs and module can be updated to be more beginner-friendly! This seems very promising, but as a rookie DataStore programmer this is extremely hard to understand as the docs seem incomplete and/or hard to understand, plus the module itself seems hard to use. I have not used this too much though, and again, I am not too good with DataStores, so this could most likely be an issue on my part.

4 Likes

Will be checking this out! Great release.

2 Likes

Would be great to see something like replica service implemented for this.

1 Like

I do agree they aren’t the most comprehensive, but writing docs is time-consuming! Pull requests for improvements are always welcome though :slight_smile:

1 Like

Nezuo has a good one afaik, you could check that out

1 Like

how do I learn how to use documentservice?

1 Like

Version 1.1.2 release

Right now, the documentation (albeit lackluster) is all it has; you should be able to get a general idea of how to use it though. I’m in the process of improving the documentation, but it’ll take a while.

If you have any questions, feel free to ask.

Though you’re able to view the Tutorial page on my fork. Granted, it’s still being worked on; it should still be useful one way or another.

The Tutorial page is now available on the documentation page

1 Like

Happy to hear you want to help - please do get in touch on OSS discord or present your ideas to me somehow!

Important Fix - Version 1.1.3

Fixes a bug where cancelling a hook would cause a future hook to be skipped over, and exports some more types.

Documentation update

I have heard your feedback and received your contributions! I have now published two more pages of in-depth usage information.

General tutorial for player data
Hooks

You mention why to use this over ProfileService, but wondering if stuff on that list is still comparable to the new ProfileStore As I was tempted to switch over to ProfileStore, but I really need a DataStore library that can not just handle session locked player data, but also shared data that players can access across servers

ProfileStore is certainly an improvement over ProfileService and fixes several problems that ProfileService had. It will also be easier to use for beginners and I agree with all the changes loleris has made! However, ProfileStore is still lacking in several places compared to DocumentService - which still has far superior error handling, better type support, better debugging features (validation), migrations, immutably editing, and supports both player data and non-player data. It also is fairly lacking in unit tests and real-world testing compared to DocumentService. For a new project I would of course go with DocumentService but I’m a bit biased!

1 Like

If you want to use the same library for shared and player data definitely go with DocumentService - that’s one of the main reasons I had for making it!

1 Like

Do you have metrics on how well it performs/etc.

I’m wanting to implement a clan system similar to what Pet Simulator 99 has, and at the moment am just using Roblox’s DataStoreService and MemoryStoreService, but I’m sure I’m not doing it 100% efficiently, and I am very concerned about reaching data limits quickly, as it’s having to retrieve clan data for top 100 clans, etc. constantly. Curious if this would be a valid use case for DocumentService.

In particular, using MemoryStoreService to handle data getting across servers, saving it once, vs every server. And keeping a valid cache constantly, without data limits being reached.

For example

  • Get Clan data
    • If cached (MemoryStoreService) return cache
    • else load from data store + store cache

But if let’s say 2 differnet servers, player leaves clan on 1 server, needs to update to other server (obviously not immediately) and update the data, but if you go constant players joining/leaving/etc. data stores can reach limits super quickly, especially with hundreds of clans. So ideally there’d be a way to store the update, and just do 1 big update once every minute or so

Hey, sorry for the late reply!

I’m using DocumentService for a clan-style system. The main benefits are migrations and type checking.

To be honest, I don’t think you will get any performance benefit from switching to DocumentService. It’s more about DX - the only optimisation DocumentService provides is caching session-locked data.

Your use of MemoryStoreService for clans is very interesting, and sounds a lot more promising for performance than switching to this library. I personally just impose ratelimits and caches for now - the DataStore limits are pretty high to be honest. Depending on the complexity of your projects, if you want complex migrations it might be worth it, but if you only need simple reconciliations you probably don’t need this library.

Hi everyone!

If you would like a say on the new signals API for v1.2.0, please comment on my pull request!

Version 1.2.0 Release

Update

v1.2.1 has released and DocumentService is now stable in a production game! See README.md for more infromation.

Important Fix

1 Like

Hello! It seems pretty good datastore library module and i want to use it in my project but i have a few questions to try to migrate it over profileservice module.

  1. is it possible to read old versions of data like in profileservice?
  2. i don’t use wally or any frameworks cause i don’t want to migrate my projects to frameworks, its too hard for me and my project uses a lot nested instances, is it possible to use it without using frameworks and Guard?

thanks.