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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>We are talking about state here. In my opinion if you have business data that needs to be persisted you should be using a SQL database. I also think that you should design and manage this outside of an application context. I.e use SQL scripts for DDL and migrations.</p>
<p>The business data is likely to outlive your application by a big margin. Having this completely separate from the app will make it much easier to maintain in the long run. Perhaps after 5 years you want to use a completely different framework. Your business data though is still the same and by having it managed outside of the application makes this transition much easier. You can also add multiple different applications to your data without having the <em>design choices</em> of one framework affect any other.</p>
<p>On the other hand. If the data is only there to help run the application and not a thing in itself then the database-less approach is interesting. This auxiliary data can be stored in many different ways and can be quite tightly coupled with your application as it is more there to help the application than being data you care about in the long run.</p>
<p>A third type of data would be ephemeral data which can be recreated at any time. This is usually stored in memory can can be recreated when needed.</p>
<p>Likely your application will contain all three and there may some overlap between the three. What I think is important is that <em>business data</em> and the <em>auxiliary data</em> is loosely coupled. On is the core of your business and the other is just there to help.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85058" data-batch-url="/posts/batch_likers">
                        8
                      </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/a-database-less-app-framework/14667/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-85058" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85058"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="85060" data-post-id="85060">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Object databases are great when you know the shape of every query you will ever run on your database. Otherwise, it can be very slow and laborious to write those reports, and many reports won’t be worth writing at all, when you could have done the same thing in 5 minutes in SQL. You can also run into major performance challenges when you simply need to group your data differently from how it is stored in an object database.</p>
<p>In most domains I’ve worked in RDBMS is the right choice for these reasons. Even specialized use cases where you can make a strong case for a different model, can turn out to be more trouble than it is worth in the long run.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85060" data-batch-url="/posts/batch_likers">
                        6
                      </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/a-database-less-app-framework/14667/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-85060" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85060"
                     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="85073" data-post-id="85073">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="cmkarlsson" data-post="12" data-topic="14667">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cmkarlsson/48/23000_2.png" class="avatar"> cmkarlsson:</div>
<blockquote>
<p>This auxiliary data can be stored in many different ways</p>
</blockquote>
</aside>
<p>I am not disputing the three kinds of data you are talking about but it’s my experience that most project members opt for a singular storage to avoid potential complexity. That’s not an invalid concern.</p>
<p>I guess we are starting to tread into the configuration storage again as a by-product of this discussion, though.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85073" 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/a-database-less-app-framework/14667/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-85073" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85073"
                     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="85076" data-post-id="85076">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dimitarvp" data-post="14" data-topic="14667">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>most project members opt for a singular storage to avoid potential complexity</p>
</blockquote>
</aside>
<p>and that is fine. As long as they are somewhat logically separated and not coupled with the business data (i.e many foreign key constraints and other relationship between tables).</p>
<aside class="quote no-group" data-username="dimitarvp" data-post="14" data-topic="14667">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>I guess we are starting to tread into the configuration storage again as a by-product of this discussion, though.</p>
</blockquote>
</aside>
<p>Yes, configuration also comes in many multiple layers. I’d say that the same separation works here too. I.e business configuration, auxiliary configuration needed to just run the software (ports, number of processes, etc), and ephemeral configuration (temporary log levels, tracing)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85076" 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/a-database-less-app-framework/14667/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-85076" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85076"
                     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="85080" data-post-id="85080">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The reality is most commercial apps need some sorts of database, not files. Files-based storage were there way before relational database, files-based storage didn’t work for most business companies and corporations. That’s why folks like Boyce and Codd invented relational database, and C.J. Date preached about it. That’s why Oracle, Microsoft and IBM makes billions of dollars on it, because they help companies and corporations to do their business.</p>
<p>Yes, relational database is slow… We know it really well. Guys with 50 years experience know it, fresh-grads know it. That’s our job as engineer to tackle with it. Plenty of way to do performance optimisations.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85080" data-batch-url="/posts/batch_likers">
                        2
                      </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/a-database-less-app-framework/14667/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-85080" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85080"
                     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="85086" data-post-id="85086">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dwahyudi" data-post="16" data-topic="14667">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dwahyudi/48/347_2.png" class="avatar"> dwahyudi:</div>
<blockquote>
<p>The reality is most commercial apps need some sorts of database, not files.</p>
</blockquote>
</aside>
<p>In fact, the reality is that most sizable apps need more than one storage mechanism. Keeping <em>everything</em> in database may lead to disaster, keeping <em>everything</em> in files as well, not to mention keeping everything in memory.</p>
<p>If the commercial app is big and complicated, it usually requires some sort of relational database, some (possibly remote) file storage, something to record events quickly and something analytical, and possibly a persisted caching layer…</p>
<p>That’s something to remember when you try to build “database-less” application: you most likely will need database anyway at some point, do not exclude the possibility that it may be beneficial to save some stuff in database, and query it as well. I guess we have to be pragmatic about what we use.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85086" data-batch-url="/posts/batch_likers">
                        4
                      </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/a-database-less-app-framework/14667/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-85086" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85086"
                     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="85087" data-post-id="85087">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dwahyudi" data-post="16" data-topic="14667">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dwahyudi/48/347_2.png" class="avatar"> dwahyudi:</div>
<blockquote>
<p>Yes, relational database is slow…</p>
</blockquote>
</aside>
<p>Okay, well not always. Try implementing in-memory joins / mapreduce on your virtual actors to filter them out to some subset matching given criteria, and then compare the speed to your SQL query that’d do the same. Or implement a full text search and compare it with elasticsearch.</p>
<p>Generally SQL/database will likely to be quicker when you need to deal with querying large data sets, and in-memory solution will be quicker to access to individual ones.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85087" data-batch-url="/posts/batch_likers">
                        9
                      </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/a-database-less-app-framework/14667/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-85087" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85087"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="85089" data-post-id="85089">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Crowdhailer" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Crowdhailer/120/2438_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Crowdhailer
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Raxx</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I have thought that a database-less framework would be a good thing to have and for a lot of cases just having enough in memory replicas would be fine. you could perhaps have a follower process backing data up to a db to deal with catastrophic failure but in normal operation the DB simply gets no writes at all.</p>
<p>I am currently working on a <a href="https://github.com/CrowdHailer/pachyderm" rel="noopener nofollow ugc">project</a> that experiments with such a solution. temporary erlang processes that die when a machine dies are replaced with entities that are transparently moved between nodes when their host node dies. These can still be thought of as actors but there are a few interesting difference between normal processes. i.e. don’t use <code>self()</code></p>
<aside class="quote no-group" data-username="cmkarlsson" data-post="12" data-topic="14667">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cmkarlsson/48/23000_2.png" class="avatar"> cmkarlsson:</div>
<blockquote>
<p>The business data is likely to outlive your application by a big margin.</p>
</blockquote>
</aside>
<p>That is certainly a consideration for many cases and probably I’m first thinking about tackling the state that doesn’t live that long. In game state that needs to live for perhaps days but after the game has completed only results are needed</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85089" data-batch-url="/posts/batch_likers">
                        4
                      </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/a-database-less-app-framework/14667/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-85089" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85089"
                     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 #18"></div>
  </section>
</div>
    <div class="postbit" id="85113" data-post-id="85113">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mmport80" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mmport80/120/8995_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mmport80
                    <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>I suppose, what I was thinking about, how about changing the <em>default</em> away from DB storage…</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85113" 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/a-database-less-app-framework/14667/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-85113" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85113"
                     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 #19"></div>
  </section>
</div>
    <div class="postbit" id="85119" data-post-id="85119">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>That train of thought often leads to:</p>
<ul>
<li>Apply “the change” to application state in memory</li>
<li>Eventually write “the change” (preserving sequence) to an append-only log</li>
<li>Replay “changes” to recreate last known state</li>
</ul>
<p>leading people to <a href="https://www.youtube.com/watch?v=STKCRSUsyP0&amp;feature=youtu.be&amp;t=1237" rel="noopener nofollow ugc">Event Sourcing</a> (which sometimes doesn’t end well especially once CQRS gets involved).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85119" data-batch-url="/posts/batch_likers">
                        4
                      </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/a-database-less-app-framework/14667/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-85119" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85119"
                     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 #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/14667/load_more?page=3">Load more posts (19 remaining)</a>
</div></template></turbo-stream>