axelson

axelson

Scenic Core Team

Posting a little bit late today but here you go:

ElixirConf 2017 - Elixir + Neo4j - Regina Imhoff

Neo4j is a non-relational graph database with its own query language, Cypher, which means it doesn’t work with Ecto. However, graph databases are great at modeling social networks. You will be learning how to combine Elixir Phoenix with Neo4j to make a clone of a popular social networking site with real time updates to the social graph.

Audience: Intermediate

All talks are available in the Elixir Conf 2017 Talks List or via the elixirconf2017 tag

Showing Posts 1 to 10

josevalim

josevalim

Creator of Elixir

I have always kept an eye on graph databases and it is really exciting to see some work in using them directly from Elixir!

AstonJ

AstonJ

I’m really interested in graph dbs too and I watched most of this talk when it was first uploaded. Great talk Regina, if you are reading this please join up as I might need to pick your brains one day :lol:

JEG2

JEG2

Author of Designing Elixir Systems with OTP

I agree that the graph databases are interesting and this was a solid introduction. I did wonder if skipping Ecto in this case could make interactions more natural.

AstonJ

AstonJ

I love the idea of using separate DBs for different components of your app - so say Postgres for a registration system, Neo4J for a user r/ships system etc

I’m hoping @PragDave will cover something like this in his next course as I’d love to see how his approach would tie something like this together.

WolfDan

WolfDan

I tried to integrate separate databases for that but at the end of the day you end up having mostly the same data in the two databases… So why don’t use a graph database for all? IMO

kylethebaker

kylethebaker

I really like the query syntax, it somewhat isomorphic to the graph relationships themselves, with the arrow and the ‘edges’ (-).

MATCH (p:User)-[:OWNS]->(y:yard)-[*]-(q:User)

The wildcard is particularly cool, how it cuts out all of the inner joins. Basically it’s saying “Use any path/relationship you can find to get from PointA to PointB”. I wonder if it’s possible to do a sort of “meta query” where you can have it show you all of the relationships it’s traversed, maybe something like MATCH (f:Foo)-[r:*]-(b:Bar) RETURN r?

AstonJ

AstonJ

Primarily because different types of DBs have different strengths and weaknesses. And since Elixir makes it much easier to build your app as a series of components, it, to me at least, makes sense to make full use of that; I really really like the idea of having independent systems that are built without having to make compromises that you might have to otherwise.

What kind of data was being duplicated in your app/s?

WolfDan

WolfDan

Well is and app that I’m working my self, kind of little “startup”, basically a social network (I’m a n00b so all this is based in my opinion and experience, I have never worked on a real project before, any opinion or suggestion is welcome!)

At first time I decided to use simply Postgre for all my my project (pretty robust, amazing search features etc…), but after see this talk I decided to use graph databases because it really fist to what I’m doing and make the work easily, so I decided to use Postgre and a Graph database called Dgraph

So I begin to work on it, creating some data and make a sketch of what I want to, but I end up with this “problems”:

  • I need a way to recognize the data that I need in the two databases, so I need the same identifiers (duplicate data)

  • I’m working with Abshinte so are Graphql queries to get the data, since get relationships from Graphql queries are pretty easy, I needed a way to query the main object requested and the relationships, so I saw two options:

    • Parse the Graphql query and query the relationships to graph database, after that construct a SQL query to send it into Postgres (here I think you need to join data etc so what is the point to use a graph database) and send back the data
    • Save directly the same data in the Graph database and query the relationships with the requested data, and just query the basic data of the main object to Postgres database (duplicate data)

    At my opinion the second option the second option was easier

  • If I wanted to use the Graph database as a search I need to add all the data that need to query the result as wanted (again duplicate data)

  • You can build cool things with Graph databases like recommendation systems and so… Need to have the same data in the two databases too to make the feature work correctly

The problem with two databases and duplicate data is maintain the same state in the two databases, so what if one fail if the other no when you update data etc…

At this point looks reasonable to me just use the Graph database, but I haven’t yet made a final decision, as mention before I’m a n00b so possibly I’m wrong on all that I said or a few things, I hope to be corrected if that is the case


Feel free to correct any grammatical problem

AstonJ

AstonJ

If you want to build your app as a series of components, I highly recommend PragDave’s online course - it has given me a huge insight into this sort of architecture and if you’re interested in this too, I think you will love the course just as much as I did :003:

WolfDan

WolfDan

I would really love to acquire the course since was released, but unfortunately I do not have any way to acquire it, I am still quite young and that amount of money is a lot in my country ^^’

Where Next? Top

Trending in Talks Top

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews