DocumentService - A powerful, schematised DataStore library

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.