Sign in to follow this  
trolovecro

MySQL or .JSON saving systems

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?  

Share this post


Link to post
Share on other sites

It depends on what data exactly you want to store. For static things that don't change on runtime, I use JSON, for things that CAN change during runtime I use MySQL.

  • Like 1

Share this post


Link to post
Share on other sites

@LeonMrBonnie something like player level? It can be changed during runtime? But actually it's also possible to change it during runtime with .json. But you thinks its better to use MySQL because it's faster then .json?

Share this post


Link to post
Share on other sites
Posted (edited)

Yes, I know that it is possible to change a JSON file during runtime, but it is much slower compared to mysql. MySQL also offers way more scalability than JSON.

Edited by LeonMrBonnie

Share this post


Link to post
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? 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Mongo ❤️ Cassandra ❤️ MariaDB ❤️ 

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.