Jump to content

MySQL or .JSON saving systems


trolovecro

Recommended Posts

Just so title say, what you guys thinks is better for some simple gamemode. MySQL or .JSON type of storing data. I tried to use one and another.

Must say that MySQL is more safer for storing data and more organized (my opinion). But I chose .JSON because it's much easier to get use to work with it, and much simpler for coding then mySQL.

What do you guys think?  

Link to comment
Share on other sites

@LeonMrBonnie what about if i use "file system" asynchronised writing and reading so my code work with that but actually move on other lines of code.

https://stackabuse.com/reading-and-writing-json-files-with-node-js/ >>>

Quote

As I mentioned earlier, the writeFile function executes in asynchronous manner, which means our code is not blocked while data is written to the file. And just like the asynchronous methods from before, we need to pass a callback to this function.

What you think about this? Is it safer to use this type of writing and reading? 

Link to comment
Share on other sites

Your real question should be whether to use a relational database(SQL) or a document oriented database(NoSQL), because what you're suggesting - serializing data to JSON files, is basically an ad-hoc document database. There are industrial grade document database such as MongoDB, CouchDB, and even PostgreSQL has pretty good support for JSON, and of course there are plenty of high quality libraries and drivers to interact with these databases via JS/C#.

 

Which is better depends on your usecase. Using NoSQL is good for prototyping/experimentation, there's no need to define a schema, there isn't really a need to use a complex ORM since objects map naturally to documents. But if you already have a good idea of how your data looks like, and its relations, then using a SQL database would be better.

 

Anyway, you can google "SQL vs NoSQL" to see much more in-depth explanations. Anyway, using a real database would be better than making your own file database, and if you're already familiar with MySQL, that would be a good choice.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...