<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="85988" data-post-id="85988">
  <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">
								<aside class="quote no-group" data-username="namelos" data-post="31" 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/namelos/48/9296_2.png" class="avatar"> namelos:</div>
<blockquote>
<p>My thought there should be a light weight actor behaviour just automatically backup &amp; persist actor state, and resume state when it fails.</p>
</blockquote>
</aside>
<p>That’s exactly my current thinking. Keep things super simple - but v useful perhaps.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85988" 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/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-85988" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85988"
                     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 #31"></div>
  </section>
</div>
    <div class="postbit" id="86210" data-post-id="86210">
  <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>DBs are v good at many things, but are also a little bit complicated.</p>
<p>I suspect many apps don’t need to scale to need DB amounts of data.</p>
<p>For that niche, it’d be nice to have a simpler solution, eh?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86210" 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/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-86210" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86210"
                     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 #32"></div>
  </section>
</div>
    <div class="postbit" id="86233" data-post-id="86233">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mmport80" data-post="33" data-topic="14667" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mmport80/48/8995_2.png" class="avatar"> mmport80:</div>
<blockquote>
<p>DBs are v good at many things, but are also a little bit complicated.</p>
<p>I suspect many apps don’t need to scale to need DB amounts of data.</p>
<p>For that niche, it’d be nice to have a simpler solution, eh?</p>
</blockquote>
</aside>
<p>Maybe it’s important to take a step back, and let us consider what a ‘data base’ actually is:</p>
<p>It’s just <em>some place</em> in which you store (some of) your data.</p>
<p>Whether this is inside your (OS) application or outside of it does not really matter that much from a nomenclature point-of-view.</p>
<p>Historically, data base-frameworks have grown to become their own separate (OS) applications because this meant they could be started, stopped and versioned separately from the main (OS) application.</p>
<p>In a world like the BEAM which is its own operating-system like environment, it makes a lot of sense to work with a data base that runs <em>inside</em> of this system, because of:</p>
<ul>
<li>No separate serialization/deserialization-steps necessary when reading/writing from/to the data base.</li>
<li>Distribution is possible in the same way as your normal application.</li>
<li>No two (OS)-processes competing for the attention of the (OS) schedulers; rather, they can be (semi-)preemptively scheduled by the BEAM schedulers.</li>
<li>Less mental complexity than when using two separate technologies that have to talk to one-other.</li>
</ul>
<p>However, the idea to run a data base inside the BEAM is somewhat new, or at least widely unexpored territory: There is of course (D)ETS and Mnesia built on top of that, and then we have <code>riak_core</code> (but using the normal <code>riak</code> data base inside your own BEAM instances is not possible AFAIK). CouchDB was also not built with in-BEAM support in mind.</p>
<p>So <code>Mnesia</code>, <code>riak_core</code> and <code>lasp</code> are our only current contenders for <em>distributed</em> in-app data bases, and none of these are easy to get started with.</p>
<p>But if you don’t need to go to distributed scale, you can just use ETS, or even simpler: A process that periodically backs up its state using <code>:erlang.term_to_binary</code> and writes it to a file.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86233" 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/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-86233" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86233"
                     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 #33"></div>
  </section>
</div>
    <div class="postbit" id="86339" data-post-id="86339">
  <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">
								<aside class="quote no-group" data-username="Qqwy" data-post="34" 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/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p>But if you don’t need to go to distributed scale, you can just use ETS, or even simpler: A process that periodically backs up its state using <code>:erlang.term_to_binary</code> and writes it to a file.</p>
</blockquote>
</aside>
<p>That’s what I am thinking about.</p>
<p>Everyone focuses on planetary scale distribution. But in many cases, the usual use-case is quite small…</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86339" 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/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-86339" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86339"
                     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 #34"></div>
  </section>
</div>
    <div class="postbit" id="86545" data-post-id="86545">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Do you just mean how grains are stored?</p>
<p>There isn’t any, you can just as easily use a NoSQL store for grain persistence. Postgres is what it supports right now just because that is what we use at work. Orleans supports a number of different databases for grain persistence.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86545" 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/a-database-less-app-framework/14667/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-86545" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86545"
                     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 #35"></div>
  </section>
</div>
    <div class="postbit" id="86587" data-post-id="86587">
  <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>Nope, when reading up about it, it seemed that Orleans might be getting close to NoSQL land.</p>
<p>I.e. indexed, but largely unstructured storage of data.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86587" 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/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-86587" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86587"
                     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 #36"></div>
  </section>
</div>
    <div class="postbit" id="86593" data-post-id="86593">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ricosuaveyatusabe" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ricosuaveyatusabe
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The default phoenix generator will create an application with ecto - the reason is to give the user something “with batteries included”. You can easily remove this by passing the --no-ecto flag to the mix phoenix.new generator.</p>
<p>Extracted from:</p><aside class="onebox stackexchange" data-onebox-src="https://stackoverflow.com/questions/38023568/using-phoenix-framework-without-ecto">
  <header class="source">

      <a href="https://stackoverflow.com/questions/38023568/using-phoenix-framework-without-ecto" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>

  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/2936186/h%c3%a9cate" target="_blank" rel="noopener nofollow ugc">
    <img alt="H&amp;#233;cate" src="https://i.sstatic.net/EOPOx.jpg?s=256" class="thumbnail onebox-avatar" width="256" height="256">
  </a>

<h4>
  <a href="https://stackoverflow.com/questions/38023568/using-phoenix-framework-without-ecto" target="_blank" rel="noopener nofollow ugc">Using Phoenix Framework without Ecto</a>
</h4>

<div class="tags">
  <strong>elixir, phoenix-framework, ecto, leveldb</strong>
</div>

<div class="date">
  asked by
  
  <a href="https://stackoverflow.com/users/2936186/h%c3%a9cate" target="_blank" rel="noopener nofollow ugc">
    H&amp;#233;cate
  </a>
  on <a href="https://stackoverflow.com/questions/38023568/using-phoenix-framework-without-ecto" target="_blank" rel="noopener nofollow ugc">11:43PM - 24 Jun 16 UTC</a>
</div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86593" 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/38">Post #37</a>
	                </div>
	            </div>
              <div id="likers-container-86593" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86593"
                     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 #37"></div>
  </section>
</div>
    <div class="postbit" id="86614" data-post-id="86614">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ah, true, there is work on indexed actors.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86614" 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/39">Post #38</a>
	                </div>
	            </div>
              <div id="likers-container-86614" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86614"
                     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 #38"></div>
  </section>
</div>
    <div class="postbit" id="222398" data-post-id="222398">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi, I know it’s 3 years old topic but somehow I have similar issue. I need “in-house” small data storage which has to be distribute between multiple apps(2 kind of apps with multiple instances) to share state. I’m thing about mnesia and Cachex for example. I wonder how you ended up and what solutions are available in these days.<br>
Main reson for me to find this kind of storage it’s because I have two apps:</p>
<ol>
<li>api app</li>
<li>show app<br>
You can create structure with api and when you create you can show it with shop app. We use postgresql right now to store these information. It works well, until postgresql server is not available and we have to prepare for bigger traffic. So for example when we lost connection with psql for 3 seconds we can lost about 300-500 api calls. Right now I see only one solution and that’s distributed in-house(in-beam) storage which will handle it and async storing in posgresql for other use. I’m not sure if I need persistent storage for that kind of in-house db. I see only one reason for it: when some entries are not saved into postgresql and some app crash. But distribution can help with it.</li>
</ol>
<p>Cachex is nice cache solution. But I have feelings that using it for my use case is not right and can make me more other problems. This kind of cache is more cache for already stored data, not pre-save cache I think.</p>
<p>Mnesia is battle tested, but I need only key-value storage where I store some information. I take token from URL, decrypt ids, load data by that ids and use data to show call 3rd party APIs and show informations.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="222398" 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/40">Post #39</a>
	                </div>
	            </div>
              <div id="likers-container-222398" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="222398"
                     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>