Live data from Hacker News

Build your next app with a graph database

dgraph.io

41–50 of 58 posts

Re: Build your next app with a graph database

#41

I have never used a graph database but I can say there is one truth in the article: I find I have to stop and structure my app around the tables I need, and have had to stop and reorganize my code and data to fit a proper table structure when I realize my existing table structure doesn't make sense or hits the database too hard. I have no idea if graph databases are the answer to that problem, but I do get tired of b…

Could you say more about some of these times? I'm curious what it means in more concrete terms.

I only say this because I am a UI engineer who has been in some scrappy situations, so obviously I don't get to change the data model. What kind of structures do you find that "hit the database too hard" or otherwise invoke performance penalties?

Re: Build your next app with a graph database

#42

Earlier quoted context omitted.

Is this really so hard to believe? Lots of things that are "Default" are just that way for historic purposes. One example, and I say this as someone who's generally a fan of the language, would be Java - it's taught in so many schools, because it's taught in so many schools . Everyone says things like "You don't need a graphdb" because their default assumption is that there is a cost relative to rdbms, that's the bia…

Historical entrenchment is not a chance occurrence.

I didn't say it was.

Re: Build your next app with a graph database

#43

Earlier quoted context omitted.

Is this really so hard to believe? Lots of things that are "Default" are just that way for historic purposes. One example, and I say this as someone who's generally a fan of the language, would be Java - it's taught in so many schools, because it's taught in so many schools . Everyone says things like "You don't need a graphdb" because their default assumption is that there is a cost relative to rdbms, that's the bia…

There were two lines held up for mocking. The first one described relational DBs as a software engineering fail. That's patently absurd. (If that's failure, what would success look like?) You addressed the second one, which is slightly less absurd. You were taught relational DBs because they are enormously widely used. And why are they used so widely? Because they work. What the article should be saying is, "Here's t…

Yes, I only addressed the part I agreed with. I'm not the author or trying to defend the entire article, just saying that I strongly agree with entrenched technologies being entrenched for very weak reasons. Do I think relational databases have no merit? IDK, probably not, though I haven't chosen to use one in a very long time.

Re: Build your next app with a graph database

#45

Earlier quoted context omitted.

There were two lines held up for mocking. The first one described relational DBs as a software engineering fail. That's patently absurd. (If that's failure, what would success look like?) You addressed the second one, which is slightly less absurd. You were taught relational DBs because they are enormously widely used. And why are they used so widely? Because they work. What the article should be saying is, "Here's t…

Yes, I only addressed the part I agreed with. I'm not the author or trying to defend the entire article, just saying that I strongly agree with entrenched technologies being entrenched for very weak reasons. Do I think relational databases have no merit? IDK, probably not, though I haven't chosen to use one in a very long time.

Well... entrenched technologies can be entrenched for very weak (or, if you prefer, path-dependent) reasons, over other technologies that are approximately as good. I'm not sure that lesser technology gets entrenched against clearly superior technology very often. (I mean, there's COBOL...)

Graph databases may be as good as relational DBs. They may be better for some use cases. Are they significantly better for many (say, the majority) of use cases? No? Well then, it's really not an issue that they're what became entrenched, is it?

(And if your answer was "yes" instead of "no": That takes some evidence to believe. And the way this article was written leads me to think that they don't actually have any such evidence.)

Re: Build your next app with a graph database

#46

Earlier quoted context omitted.

Yes, I only addressed the part I agreed with. I'm not the author or trying to defend the entire article, just saying that I strongly agree with entrenched technologies being entrenched for very weak reasons. Do I think relational databases have no merit? IDK, probably not, though I haven't chosen to use one in a very long time.

Well... entrenched technologies can be entrenched for very weak (or, if you prefer, path-dependent) reasons, over other technologies that are approximately as good . I'm not sure that lesser technology gets entrenched against clearly superior technology very often. (I mean, there's COBOL...) Graph databases may be as good as relational DBs. They may be better for some use cases. Are they significantly better for many…

I think the problem is that we have a very weak understanding of "better" or "worse" or "use cases". What would a better database look like? Maybe it's faster, or more stable, etc. But if what makes it better is that it is a better model, you end up with religious wars - it's the same reason why no one can really agree on whether a static or dynamic language will lead to "better" code, it's just too hard to tell.

As a user of KV stores and graphdbs myself I would have to use a traditional rdbms. It's been an absolute breath of fresh air being able to express queries in a graph-oriented way. For me the combination has been totally "better", but of course, that's not evidence based! Nor, really, could it be.

Re: Build your next app with a graph database

#47

Earlier quoted context omitted.

Well... entrenched technologies can be entrenched for very weak (or, if you prefer, path-dependent) reasons, over other technologies that are approximately as good . I'm not sure that lesser technology gets entrenched against clearly superior technology very often. (I mean, there's COBOL...) Graph databases may be as good as relational DBs. They may be better for some use cases. Are they significantly better for many…

I think the problem is that we have a very weak understanding of "better" or "worse" or "use cases". What would a better database look like? Maybe it's faster, or more stable, etc. But if what makes it better is that it is a better model , you end up with religious wars - it's the same reason why no one can really agree on whether a static or dynamic language will lead to "better" code, it's just too hard to tell. As…

> As a user of KV stores and graphdbs myself I would have to use a traditional rdbms. It's been an absolute breath of fresh air being able to express queries in a graph-oriented way. For me the combination has been totally "better", but of course, that's not evidence based! Nor, really, could it be.

Well, it's anecdote. But if a statistically-significant number of people feel that it's "an absolute breath of fresh air", that's totally "better" in a very concrete sense.

Re: Build your next app with a graph database

#48
post #41

I have never used a graph database but I can say there is one truth in the article: I find I have to stop and structure my app around the tables I need, and have had to stop and reorganize my code and data to fit a proper table structure when I realize my existing table structure doesn't make sense or hits the database too hard. I have no idea if graph databases are the answer to that problem, but I do get tired of b…

Could you say more about some of these times? I'm curious what it means in more concrete terms. I only say this because I am a UI engineer who has been in some scrappy situations, so obviously I don't get to change the data model. What kind of structures do you find that "hit the database too hard" or otherwise invoke performance penalties?

When I say "hit the database too hard" what I actually mean is making too many calls to the database. If I have to make three or four calls just to get all the data I need, performance is going to take a hit. And databases are often the worst-performing part of the tech stack, so you have to craft your queries around the performance bottleneck of the database.

So you have to balance your table structure around getting the data you need in as few calls as possible while also only returning exactly as much data as you need and no more. Because pulling extra data out puts more load on the database and shipping more data across the network is slower.

In general, relational databases (RBDs) like Postgres or MySQL are great for making sure your data follows the correct structure (this field is a string, this is an integer, this field in table1 has to be the same as this field in table2, etc) but make it hard to make changes to the data structure later. What happens if that int should actually be a float? Now you have to write a migration that makes fundamental changes to the structure of the data and hope there are no negative side effects.

Someone else mentioned NoSQL databases, which offer a lot more flexibility at the cost of the data integrity that RDBs enforce. If you suddenly want to store a float instead of an int, go ahead. No one is stopping you, you just need to make sure your code is updated to handle the possibility of getting back an int or float (or coerce the value to the right type and pray).

Basically a database is integral to almost all applications but they're complex monsters with their own structure and rules and performance implications. If you're building an application you really have to know the data structure of the final product before you even _start_ configuring the database.

Re: Build your next app with a graph database

#49
post #41

Earlier quoted context omitted.

Could you say more about some of these times? I'm curious what it means in more concrete terms. I only say this because I am a UI engineer who has been in some scrappy situations, so obviously I don't get to change the data model. What kind of structures do you find that "hit the database too hard" or otherwise invoke performance penalties?

When I say "hit the database too hard" what I actually mean is making too many calls to the database. If I have to make three or four calls just to get all the data I need, performance is going to take a hit. And databases are often the worst-performing part of the tech stack, so you have to craft your queries around the performance bottleneck of the database. So you have to balance your table structure around gettin…

> but make it hard to make changes to the data structure later. What happens if that int should actually be a float? Now you have to write a migration that makes fundamental changes to the structure of the data and hope there are no negative side effects.

This is often stated, but it's not true. RDBMS make it easier to make changes to the data structure precisely because you only have to write migration and after that you are guaranteed to only ever get the data out of database in the new format. Which means your application code doesn't accumulate the cruft of dealing with two possible database data formats.

Re: Build your next app with a graph database

#50
post #41

Earlier quoted context omitted.

Could you say more about some of these times? I'm curious what it means in more concrete terms. I only say this because I am a UI engineer who has been in some scrappy situations, so obviously I don't get to change the data model. What kind of structures do you find that "hit the database too hard" or otherwise invoke performance penalties?

When I say "hit the database too hard" what I actually mean is making too many calls to the database. If I have to make three or four calls just to get all the data I need, performance is going to take a hit. And databases are often the worst-performing part of the tech stack, so you have to craft your queries around the performance bottleneck of the database. So you have to balance your table structure around gettin…

Well, this was maybe a bit entry level description.

Q: "databases are often the worst-performing part of the tech stack" - compared to what? nginx throughput? I find this to be a bit of a strange view, surely business logic is always the slowest part of the tech stack

Q: "What happens if that int should actually be a float?" - how often do you actually need to run migrations versus just extending the data? From my end, I have a small idempotent database schema-maintaining tool, and if I need a new column or a new table there's no need for a migration, and you know your whole stack will interact with the new schema or old schema identically assuming you set sane defaults etc. I've built a lot of medium-quality low-traffic apps so I'm yet to encounter a real-world case where a migration wasn't just bad planning

Post reply on HN