RBXDatabase | Easy JSON Local Machine Storage

DISCLAIMER

This is my first NodeJS VSCode Extension so please dont tear me apart in the replies, I just wanted to give small hobbyist developers a simple way to store and retrieve data using JSON

WDID

Basically it allows you to read and also write to json files through a local web server that uses HTTP requests that is held on your local machine, and it allows you to pick any JSON file from your computer and read and write data too it!

HTI

This requires you have to Visual Studio Code installed if you don’t already have it.
Get the extension through the Visual Studio Marketplace:

OR you can also just search it up in your vscode extensions

image

SETUP

Once you have the extension installed you can do CTRL+SHIFT+P to open the command pallete and type in RBX and it should autocomplete, then press enter

image

It will open up this extension tab

Now you cant start the local server without having a JSON file loaded, so click Choose File and then locate the JSON file that you want to use as your database!

Also make sure that your JSON file has some data, dont leave it blank.
I’m just putting in an emtpy table for simplicity purposes!

Now that your JSON file is loaded, you can press that START button to allow your local server to recieve https requests, and press it again to pause the local server!

USAGE

Now that your local server is up and running and you’ve given it a JSON file to read and write too, now it’s time to setup the roblox side of things (which is really simple)

The url will always be : http://127.0.0.1:3000

Get Request


image

POST Request


image

image

PROS

  • Simple and fast setup
  • No limits (it’s on your local computer :P)
  • Allows you to switch JSON files
  • Start and Stop functionality

CONS

  • It’s on your local machine (so technically you can use it for larger games but I advise you not too because, you always have to have your computer open)
  • Extension must be open/running through VSCode
  • Only supports POST and GET requests (probably might change)

HAHA

This is more tailored too small hobbyist developers that create small or single-player games that want to setup a super simple database on their local computer with ease, and don’t always need the local server running!

This could also be used for developers who make private / close community games, and want to be able to save and load data from their local machine, and also don’t always need the local server running!

Thanks so much, I put alot of effort into this extension so hopefully someone will find a use for it, if you have any questions or conerns just reply to this thread below!

9 Likes

I love this concept! It’s a great alternative if you choose to host off of your computer but that sometimes slows your computer down, personally, I use 000webhost to host my jsons and to convert mysql database fields to a readable json. this is a great plugin and I see a lot of opened up potential!

1 Like

thanks so much man, also i didnt know it could slow down the machine though… OOF
again thanks so much i hope at least someone can use this in some way :smile:

Yeah, too many things connecting to a local machine can slow performance, for example, a server, there’s so many requests it can handle before coming slow, your local machine is functioning as a server and depending on your computers specs, you won’t be able to handle a lot of requests at once. For someone doing the request script, they only need to make 1 request about every 1-5 seconds depending on how many servers there are. if you have a wide enough game then it will start to take a toll on how many hits are being put on your IP. This is great for small scale work like multi game ban systems, and will easily support so.

1 Like

This can’t really be used for live games as it is hosted on your computer, that would require opening your firewall to the public which is generally a bad idea.

I did say this was more tailored to smaller/private games for small developers

The point still stands: it doesn’t matter how big the game is, what matters is whether the game is run on studio or on roblox servers. Roblox servers can’t communicate with localhost (127.0.0.1) unless they use your computer IP and you open the firewall on your PC.

1 Like

Yes your right, I just tried to test this to work on a roblox game I published and it denied the request, so it seems to only work on roblox studio. Which makes sense because when you play on studio it’s your own servers

Turns out this actually only works on studio… I didn’t really understand this stuff but yeah thanks @NinjaFurfante07 for explaining it

I mean it’s still not completely useless but maybe if someone can find a way to make it work on a live game that’d be cool

Thank you!

1 Like

Exactly, what you tried could work if you set up a web server which the game would communicate with and your computer would listen to but at that point it would be much easier to just use a database.

1 Like

There’s no practical use for this and it is terrible practice, never save player data on a JSON file and as a matter of fact simply don’t use JSON as any form of database. The first resource that pops up when you google about using JSON as a database:

Summary

"JSON files are not intended to be used as a database because they lack many of the features that are typically associated with databases, such as query languages, indexing, and efficient handling of large datasets.

While JSON is a popular format for storing data, it was originally designed as a lightweight data interchange format rather than a full-fledged database format. As a result, it lacks many of the critical features required for database management, including support for transactions, concurrency control, and security features.

Additionally, JSON files may not provide efficient storage and retrieval of complex data structures or relationships between data points, which can result in poor performance and scalability issues. Therefore, it is generally recommended to use a dedicated database management system designed for the scale, complexity, and security requirements of your application."

There is no use case to having a “JSON Local Machine Storage”. If you want to use datastores offline you can use MockDataStoreService - seamless local development & testing with datastores

Before publishing a resource at least do some minimal research about the resource itself as you’re encouraging bad practices

Also unless you need something very specific that Roblox’s datastores are not capable of there’s no reason to use an external database, it is also a waste of money.

1 Like

This is exactly what I needed. For months I have been trying to do small roblox projects using JSON files but every online website’s JSON hosting service I could find doesn’t support what I wanted to do. Now with this, I don’t have the restrictions websites have given me. Thank you.

1 Like