trolovecro 3 Posted October 8 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
LeonMrBonnie 5 Posted October 8 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. 1 Share this post Link to post Share on other sites
trolovecro 3 Posted October 8 @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
LeonMrBonnie 5 Posted October 8 (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 October 8 by LeonMrBonnie Share this post Link to post Share on other sites
trolovecro 3 Posted October 8 @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
LeonMrBonnie 5 Posted October 8 That would be asynchronous like a mysql query, but still slower. 1 Share this post Link to post Share on other sites
trolovecro 3 Posted October 8 @LeonMrBonnie Thanks for your time and for helpful informations! I learned something new 😀 Share this post Link to post Share on other sites
NMDanny 0 Posted October 9 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
Kar 12 Posted October 9 Mongo ❤️ Cassandra ❤️ MariaDB ❤️ Share this post Link to post Share on other sites
xForcer 14 Posted October 9 I would choose MySQL over JSON anytime, anyday Share this post Link to post Share on other sites