<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="159553" data-post-id="159553">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sorentwo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sorentwo/120/37360_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sorentwo
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Oban Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The talk I linked is about the experience of running an app that combined Postgres and Neo4J. He details the pain points and the extended process to migrate to Postgres entirely.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="159553" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/combining-postgresql-and-neo4j/28333/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-159553" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="159553"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="159591" data-post-id="159591">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="simrayz" data-post="10" data-topic="28333">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/simrayz/48/26241_2.png" class="avatar"> simrayz:</div>
<blockquote>
<p>as it can store json documents and keep separate fields for what needs to be queryable</p>
</blockquote>
</aside>
<p>You can even build indexes on json fields.  ^.^</p>
<aside class="quote no-group" data-username="simrayz" data-post="10" data-topic="28333">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/simrayz/48/26241_2.png" class="avatar"> simrayz:</div>
<blockquote>
<p>The reason for using Neo4j is to simplify modeling of complex structures such as permission hierarchies, as it can be queried and examined exactly as it’s stored, but also to make queries faster when they get several levels deep. I feel like “don’t do it” is a bit of a rash decision, as there’s no doubt that graph databases excel at both these points. However, I can’t find a single record of someone combining Postgres + Neo4j, so I do feel like I’m doing something wrong <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20"></p>
</blockquote>
</aside>
<p>PGSQL has ‘path’ based support, I forget the commands off hand but they are in the docs, but those sound better for that use-case?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="159591" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/combining-postgresql-and-neo4j/28333/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-159591" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="159591"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="191230" data-post-id="191230">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tjdam" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tjdam/120/20256_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tjdam
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi <a class="mention" href="/u/sorentwo" rel="nofollow">@sorentwo</a>! I just watched the talk you linked as I’be been playing with Neo4j and thinking of using it in my next project… but something Glenn mentions in the beginning of the talk is that the mistake they made was they chose to use Neo4j when they believed they were building a social graph when they were not… but what he presents as being the data and relationships they had seems very much like a social graph to me… could you expand on that a little?</p>
<p>Thanks <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="191230" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/combining-postgresql-and-neo4j/28333/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-191230" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="191230"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="191265" data-post-id="191265">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sorentwo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sorentwo/120/37360_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sorentwo
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Oban Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Glenn (and the recorded talk) will have a more accurate memory of the situation than I do, but I’ll share what I can recall.</p>
<p>Much of the data fit into heavily interconnected network of connections, at least for storage. The way that data was used for display and analysis didn’t fit so well. The access pattern was relational, rather than “crawling” through a graph.</p>
<p>The biggest issue, IIRC was with the performance and instability of the Neo4J driver in Ruby. It had concurrency issues and performance bottlenecks that couldn’t easily be worked around. It necessitated backs to correlate PG and Neo4J data and use broad caching layers to prevent ever connecting to the database.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="191265" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/combining-postgresql-and-neo4j/28333/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-191265" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="191265"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="191308" data-post-id="191308">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tjdam" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tjdam/120/20256_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tjdam
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah, he did mention the issue with drivers, but didn’t expand much on this.<br>
I’m a bit afraid of choosing it due to the current state of its support in Elixir.</p>
<p>Thank you for sharing this, highly useful information <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="191308" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/combining-postgresql-and-neo4j/28333/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-191308" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="191308"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="191644" data-post-id="191644">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="simrayz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/simrayz/120/26241_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  simrayz
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi there, OP here. Since the start of the year, we’re still using a combination of Neo4J and Postgres. It’s working fine for us, but it does require a lot of low level decisions. In addition, we’ve experienced difficulties when onboarding new employees, as the complexity of running two databases with a custom solution for keeping them synced is hard to grasp. Furthermore, there’s no unified way of writing “migrations” for Neo4j, as it is with ecto. As such, I had to write a script that runs the Neo4j updates manually. Keeping this updated as the business logic changes is a challenge.</p>
<p>If I were to rewrite our backend, I would try my best to use Postgres as much as possible. The reason being that we haven’t yet utilized deep, multi-level queries which are the main selling point for using Neo4j. That being said though, writing Neo4j queries is genuinely <em>fun</em>. Adding a new ad-hoc relationship is done in an instant.</p>
<p>However, we have chosen to use the combination for the foreseeable future. Here’s a few details on our implementation in case you’re interested:</p>
<ul>
<li>We are using Ecto.Multi to make sure that create/update/delete functions are run properly in BOTH databases before committing the postgres update. Aa such, the Neo4j query runs <em>last</em>.</li>
<li>I created a duplicate schema for the Neo4j module, and use this to determine whether or not the neo query needs to be run based on changeset changes.</li>
<li>We only add fields to Neo4j that are used for querying. E.g. uuid, username and name for Users.</li>
<li>When loading documents themselves, such as our dashboards, we only use Neo4j to check the given user’s permissions and connected users.</li>
</ul>
<p>Don’t hesitate with reaching out if you’re interested in knowing more!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="191644" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/combining-postgresql-and-neo4j/28333/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-191644" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="191644"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="191929" data-post-id="191929">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tjdam" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tjdam/120/20256_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tjdam
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ohh, tons of food for thought there…! I will begin my experiments this weekend, awesome to know someone around here battle testing it <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20">, will definitely be in contact!</p>
<p>Somewhat related, are you aware of <a href="https://github.com/dominique-vassard/seraph" rel="noopener nofollow ugc">Seraph</a> project?</p>
<p>I found it recently and I was wondering if someone like yourself with some experience handling raw Neo4j queries in production would find it valuable. In particular the idea of an interface that resembles Ecto but it’s built around graph database “mechanics”.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="191929" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/combining-postgresql-and-neo4j/28333/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-191929" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="191929"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>