Hi Kamil - A database-backed blog enables you to easily integrate the content into your existing website -- for example, dynamically displaying the latest entry on the home page, and it makes it easy to style the blog with the site's existing templating system rather than maintaining a separate system.
I wanted the benefits of a dynamic app, but I wasn't willing to exchange Emacs for a Web-based editor so I created a hybrid engine.
I chose Neo4j because graphs are an elegant way of storing relational data. There are no tables to mess with and no joins (everything is explicitly joined). And if your blog's auth/commenting system uses data from the social graph, such as Facebook or Twitter, a graph database provides a clean way of storing the data.
Also, I am the author of Bulbs (https://github.com/espeed/bulbs), a graph-database framework written in Python, so using it was a natural choice.
> I chose Neo4j because graphs are an elegant way of storing relational data.
As opposed to, say, a Relational DBMS?
What you've done might be very interesting and rewarding to you, but it feels like you wasted three paragraphs in your response with something that falls right into the "just because I could" camp.
"Elegance" is one of those empty words that's great for polarizing a debate without really adding any meaningful information.
Neo4j is neat and underutilized. I think rglullis is just saying, if that's why espeed used it, he could have saved three paragraphs of explanation by just saying that.
Notice I didn't just say it was elegant, I said why: "There are no tables to mess with and no joins (everything is explicitly joined)."
I find elegance in simplicity. If you don't need the tabular features of a relational database, why not use a graph DB for relational data? It's like a key value store with directly connected relationships.
This is so much simpler than having to deal with creating tables, DDLs, and migrations:
>>> g = Graph()
>>> james = g.vertices.create(name="James")
>>> julie = g.vertices.create(name="Julie")
>>> g.edges.create(james, "knows", julie)
Futhermore, there's no impedance mismatch so your code is cleaner.
But regardless, this is Hacker News where people explore, build, and share new things. I hope we're not moving to a place where that gets admonished.
I've actually looked a bit at bulbflow before, being a Python programmer who has had an interest in graph databases for quite some time. That's why I asked my question originally. Can you give an example of the types of relations you're using the DB to represent in a blog?
If you have a large blog or content system, you can use likes and views to make content recommendations using a basic Gremlin collaborative filtering query:
// calculate basic collaborative filtering for vertex with user_id
def rank_items(user_id) {
m = [:]
g.v(user_id).out('likes').in('likes').out('likes').groupCount(m)
m.sort{a,b -> a.value <=> b.value}
return m.values()
}
If you use Facebook, Twitter, or GitHub to authenticate users you can easily incorporate friends and followers into the recommendations.
I was really responding to mgkimsal, who brought up elegance. I'm all for experimentation, I am not for technical debates short on technical content. Please continue.
I wanted the benefits of a dynamic app, but I wasn't willing to exchange Emacs for a Web-based editor so I created a hybrid engine.
I chose Neo4j because graphs are an elegant way of storing relational data. There are no tables to mess with and no joins (everything is explicitly joined). And if your blog's auth/commenting system uses data from the social graph, such as Facebook or Twitter, a graph database provides a clean way of storing the data.
Also, I am the author of Bulbs (https://github.com/espeed/bulbs), a graph-database framework written in Python, so using it was a natural choice.