0

After working with laravel for months, I decided to create a personal project in nodejs/express/angular, but I find difficult to resolve several points in my project for which I would very much like your help/opinions.

I need to somehow give the user the ability to create their own variables and store them in db. I was thinking of using json columns (My db is mysql) to store them, but is that the best method? If yes then how can I do that safely? How can I do that keeping in mind that the column may have to store a large quantity of data.

Many thanks to all.

I want to achieve something like Twine, where users can build interactive stories that will contain many variables.

  • see [Entity–attribute–value model](https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model), search php implementations should find one, its suited for custom form builders or arbitrary fields to values with types, type of thing – Lawrence Cherone Feb 05 '23 at 20:08
  • It should contain all the variables of a story and all the data of a node based interactive interface (Like node position and connections/content), but I just read a json column can store 1gb of data, so it isn't a problem. – Alexandru Ungureanu Feb 05 '23 at 20:30
  • We can list the various options of storing flexible data structures in mysql(see answers to the duplicate question), but we cannot tell you which one of those is the best for you. Particularly not as you have not defined any criterion for determining any ranking between various options. – Shadow Feb 05 '23 at 20:42
  • Having said this, please still bear in mind what Bill Karwin wrote at the end of his excellent answer: "Basically, none of these solutions are easy or efficient in a relational database. The whole idea of having "variable attributes" is fundamentally at odds with relational theory." – Shadow Feb 05 '23 at 20:45
  • I don't know if this is right but I need to be able to store/update/delete parameters rather fast as a large amount of users will do the same at the same time and the response should be realtime. I don't know how to explain better. – Alexandru Ungureanu Feb 05 '23 at 20:47
  • You should use MongoDB for that. It doesn't have any of the rules of relational databases, and it's very fast because it doesn't save data anyway. – Bill Karwin Feb 05 '23 at 22:09

0 Answers0