« first day (1606 days earlier)      last day (1052 days later) » 

2:04 AM
@user3781180 If you think of the top layer as a document that contains many children, then a NoSQL document store seems the logical choice
But in my opinion the correct way to think of those nested arrays of children is as the parent having a relationship to multiple children
So you have a player table, holding rows that represent players
And you have a game table, where each row represents a game
And the games have a player_id, which means that a player can have many games
Which is a one-to-many relationship (one player can have many games, but one game can only have one player)
ah, reading your example a bit more closely you're saying that it's actually a many-to-many relationship
Where a player can belong to many games, and a game can have many players
 
ah yup,
 
You can represent this relationship in a relational database with a third table - player_game or something like that. You give this third table a unique key made up of two columns, player_id,game_id
 
Since that time I've shifted more towards mongodb, but I'm still interested in the mysql approach
ooh
so you mean a middle table to connect?
 
Yup, that's the way to represent many-to-many relationships in a relational database
I don't want to diss document stores, they have their place, and I use them frequently
sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb is a good read, though the title is a bit clickbaity
A relational database is very appropriate for your needs. You can get MongoDB to work but it will be difficult and if you see any level of success you will need to switch to something that can better represent your data.
 
hmmm
I understand your point
 
2:14 AM
I tell you these things as someone who just deployed a site backed by a key-value store :-)
 
Ah, well, to be honest, I'm doing this out of pure interest in learning
so if you(who obviously has more wisdom than me on this matter) think it's better to use SQL
I think it'll be better for me to learn sql to make this project instead ^_^
@TehShrike thank you by the way!
 
SQL is pretty great. It's not perfect, but it's a better tool for interacting with databases than JavaScript (and I love JavaScript)
@user3781180 You're welcome! Feel free to stop back to talk over your schema if you want
 
haha truee, I use java as the backend
I'm making a project which takes json information from the popular League of Legends' API
 
I use Java at work. I'm not a big fan
 
and storing some processed data into my database
 
2:19 AM
Functions are where it's at, and all Java cares about are classes
 
doing some data analysis with it
 
Cool!
 
ah I see, to be honest I don't really see much difference, maybe it's because I didn't go deep enough yet haha
except for the fact that javascript seems a LOT weaker typed than java
 
Sure, the type checking is the easiest thing to notice
 
yep haha
 
2:20 AM
in JavaScript you have to check for types yourself, or decide how you want to roll with duck typing
 
by the way, if you use java at work, any experience in servlets by any chance?
 
For a great and highly entertaining explanation of what makes Java different, you should read steve-yegge.blogspot.com/2006/03/…
I've fiddled with some aspects of Java servers, but don't think I've written anything that would strictly be called a servlet
I'm comfortable/proficient with Java the language, but Java the ecosystem, I haven't put the effort in
 
HAHA
"TrashDisposalPlanExecutor.doIt()"
This article is entertaining to say the least
And I see, gotcha no problem!
 
Steve Yegge is not only dangerously smart, he's also a great writer
 
for sure, I'll read all of this after I get the SQL/mongodb set up for my servlet :)
bookmarked for now!
Hey by the way, any chance you'll be staying around for a while?
 
2:36 AM
@user3781180 Probably another hour or two, yeah
 
ah gotcha
@TehShrike i just have a question regarding databases in general, and how they work with a server/servlet
like, should it run by itself in its own project?
 
The Java server?
Your database will be running in its own process, whatever it is
 
or should it be a class within the dynamic web project, say in eclipse and make the servlet contact the database layer
yeah the java server
 
Your application will run in its own process, and connect to the database as a client
 
ah okay, thanks!
I've taken an oracle class from community college
 
2:39 AM
Unless you're only running one query at a time, you'll want to use a connection pool
 
but it only taught me how to execute sql script commands haha
 
From what I've heard, HikariCP is the one to use now
 
right
O_O i've never seen this before haha
oh huh
@TehShrike so is this a wrapper for the jdbc?
 
@user3781180 yeah, that's my understanding
 
@TehShrike ooh interesting, seems a bit advanced for me though haha
I think I'll run a connection pool either way though
@TehShrike oh and no harsh feelings if I use mongo? I just feel it's currently the most logical way to store this data
since I doubt it'll scale to ginormous amounts of data
and the data I receive is in json form
 
2:44 AM
@user3781180 No, I understand
 
turning it into bson and storing it sounds best
 
It's not the amount of data that matters at all really
It's dealing with the different ways you'll need to interact with the data eventually
 
oh?
 
MySQL may technically be able to scale better to billions of rows, but that's not really a concern of mine in the apps I build on my own time
Or for money most of the time, honestly
Did you read the clickbaity article I linked above?
It's that honestly, the data becomes very difficult to work with
 
ah yeah
i skimmed through it
bookmarked for deeper read later
it seems like the data has lots of duplicates and
might loop back on itself
 
2:54 AM
The fact that your data has many-to-many relationships makes document stores even more difficult to work with
!!summon
!!summon demon
:-x
 
haha truee...
 
!!swag
 
3:12 AM
hey by the way, for nosql would you just
@TehShrike throw json objects into the document?
 
@user3781180 I believe most of the NoSQL-branded document stores would let you insert documents that way, yeah
 
@TehShrike sweet, time to make future organizing a pain in the butt
 
:-P
So you'll give up on sanitizing the data before inserting it?
 
@TehShrike haha no I was just kidding xD
@TehShrike but to be fair most of the sanitizing is already done by league of legend's own API, they send out uniform JSON
all I have to do is clip some of the unnecessary parts of the json and just throw it in :)
 
If you want to have your schema not tied to the LoL API, you'll have to convert it into your own data structures and then serialize it into JSON again
with any sanitizing/translation steps inbetween
 
3:18 AM
what do you mean by tied to the API?
 
@user3781180 you don't want to be forced to change all your code if LoL's API changes
Your data-reading code should stay all the same
 
oh you have a point there
 
The only code that should change is the code that takes data from LoL and puts it into your own schema
 
hmmm right, thanks for catching that actually haha
 
Whether you store your data in "NoSQL" or a relational database, you have a schema that you write your application to
And when you insert data into it you need to make sure that the data conforms to the schema
 
3:21 AM
ahh i see
 
It's just that a NoSQL database won't tell you that you did something wrong if you try to insert data that isn't valid for your implicit schema
 
schema in nosql though? I didn't know that was necessary
ah i see
 
It's all implicit
Your queries would fail because your assumptions wouldn't hold
Explicit schemas are like Java's type-checking
You fail early if you do something wrong
 
right
 
Instead of at the last minute when things turn out to be all wrong
 
3:59 AM
wow this java bean is taking an awfully long time to make haha
too many entries
 
 
16 hours later…

« first day (1606 days earlier)      last day (1052 days later) »