• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Which type of database should I pick? Relational vs NoSQL?

I have no idea about databases...

What I want to do is store a username and password for each user for my web application. Also I want to store what they ate on a certain day and this will need to be updated each day but without overwriting any data, for example it should keep what the user ate yesterday so they can look back, I thought storing the food data in a List object and serializing it then stuffing it in a column might work. Don't know how else I would do that.

Im tinkering and researching how to use MySQL right now, the more I tinker and read the more it seems like a legacy PITA technology to use.

Should I use one of the newer NoSQL databases? This looks rather nice:
http://www.mkyong.com/mongodb/java-mongodb-hello-world-example/

I like how its all java code. So which is easier to use? Which will support storing an object better? MySQL and relational databases or MongoDB and its equivalents? For a complete beginner remember, this isnt an enterprise class application or anything!
 
postgresql and don't turn back. If you need to store schema-less data you can use their JSONB column, it's pretty awesome.
 
Personally I've found Mongo slow and hard to work with. But the one time I used it involved Ruby on Rails, and that might have been part of the problem.

Also I want to store what they ate on a certain day and this will need to be updated each day but without overwriting any data, for example it should keep what the user ate yesterday so they can look back.... Don't know how else I would do that.

Alright, here's how I'd do that in a traditional SQL database:

Table 1: users. Each user has an integer UID. What else you put in there is your business. 😉

Table 2: foods. Each food has an integer FID (Food ID).

Table 3: foodlog. These three columns are essential: UID, FID, and a date/timestamp. You probably also want a FLID (Food Log ID) index. I guess you might add a quantity column too.
 
Another vote for SQL database (admittedly I've never used NoSQL), and Ken g6's suggestion is how I'd do it.

I'm partial to Microsoft SQL but you may not have access to it. Don't they have a free version though?
 
Im tinkering and researching how to use MySQL right now, the more I tinker and read the more it seems like a legacy PITA technology to use.

What are you even talking about here?

I have no idea about databases...

Oh this might explain what you are talking about 😕


Any half decent relational database under the sun would work for you. MYSQL is fine Postgre would be better
 
i've used sql and mongo for professional webapps, and i'd pick mongo over sql any day of the week as long as the db does not need to be scalable and won't be a HUGE db with many types of queries that relational DB's benefit you from.

it's just so easy to be able to put data in as json and get it out as json.
 
i've used sql and mongo for professional webapps, and i'd pick mongo over sql any day of the week as long as the db does not need to be scalable and won't be a HUGE db with many types of queries that relational DB's benefit you from.

it's just so easy to be able to put data in as json and get it out as json.

Might go in and out as Json but it might not have been the same data you put in when it comes out. :whiste:
 
Might go in and out as Json but it might not have been the same data you put in when it comes out. :whiste:

What exactly do you mean by this? 😕 Are you saying that there's a problem with the Java-object-to-JSON conversion and back? Or are you saying that Mongo is buggy?
 
The latter.

been using mongo for about 1.5 years now professionally and have never experienced this. any data issues is always our (engineers) faults for writing faulty code.

we use a groovy backend so it's really easy to go to/from the client -> server -> db -> server -> client with hardly any data transformation.
 
postgresql and don't turn back. If you need to store schema-less data you can use their JSONB column, it's pretty awesome.

this. JSONB feature of PostgreSQL basically made any NoSQL obsolete.

/end thread

NoSQL might have it's uses in certain niches which include being a web site with traffic in the 10k+ requests per second category. And even then I would go with a relational DB first. Note that Wikipedia runs on MySQL (+ memcached) and has no speed issues at all.
 
Back
Top