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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="34" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>For out of process I usually hit ETS, why spin up an agent when ETS can do it better and faster?</p>
</blockquote>
</aside>
<p>Is ETS definitely faster than storing and retrieving something from an agent? I’d been wondering about that but hadn’t seen any stats.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29205" 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/discussion-about-uses-for-agent-processes/4214/42">Post #41</a>
	                </div>
	            </div>
              <div id="likers-container-29205" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29205"
                     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 #41"></div>
  </section>
</div>
    <div class="postbit" id="29210" data-post-id="29210">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mjadczak" data-post="41" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mjadczak/48/3537_2.png" class="avatar"> mjadczak:</div>
<blockquote>
<p>The key issue here is that the processing/importing is done in parallel/concurrently over several processes. The agent here acts as the cache as well as a point of serialisation.</p>
</blockquote>
</aside>
<p>Oh, in that case, Agent works perfectly fine here, sorry for wrongly accusing you <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>
<aside class="quote no-group" data-username="mjadczak" data-post="41" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mjadczak/48/3537_2.png" class="avatar"> mjadczak:</div>
<blockquote>
<p>Maybe requiring people to understand what’s going on inside the GenServer before they use it instead of allowing the “quick win” of a simple interface which then leads to misuse would be better.</p>
</blockquote>
</aside>
<p>I agree. Many people here said they don’t use agents all that often. And yet, in the <a href="http://elixir-lang.org/getting-started/mix-otp/agent.html" rel="nofollow">official mix&amp;otp guide</a>, agents are the second lesson. I’m not sure they deserve so much spotlight, since it seems they are not used all that often in practice.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29210" 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/discussion-about-uses-for-agent-processes/4214/43">Post #42</a>
	                </div>
	            </div>
              <div id="likers-container-29210" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29210"
                     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 #42"></div>
  </section>
</div>
    <div class="postbit" id="29212" data-post-id="29212">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="brightball" data-post="42" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brightball/48/17192_2.png" class="avatar"> brightball:</div>
<blockquote>
<p>Is ETS definitely faster than storing and retrieving something from an agent? I’d been wondering about that but hadn’t seen any stats.</p>
</blockquote>
</aside>
<p>In terms of speed ETS should always be faster, because it doesn’t go through the scheduler, and it also doesn’t put any pressure on the garbage collector. In terms of memory overhead, it’s ~ <a href="http://erlang.org/doc/efficiency_guide/advanced.html#id70488" rel="nofollow">twice as much than process</a>, so you want to be a bit careful not to create too many tables. The default limit is 1400 ETS tables (can be increased via command line).</p>
<p>Given its speed and the fact that it can support concurrent reads/writes, for a simple shared k-v structure used by multiple processes, I don’t even bother with agents/GenServer, and opt immediately for ETS tables.</p>
<p>On the flip side, in terms of atomic operations support, ETS is much more limited than standard processes. You can do some basic things such as atomically set some value, or increment a counter. So there are many cases where ETS table will not suffice, and in such cases GenServer (or derivatives such as Agent or :gen_statem) are your only option.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29212" 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/discussion-about-uses-for-agent-processes/4214/44">Post #43</a>
	                </div>
	            </div>
              <div id="likers-container-29212" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29212"
                     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 #43"></div>
  </section>
</div>
    <div class="postbit" id="29220" data-post-id="29220">
  <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="sasajuric" data-post="43" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>I agree. Many people here said they don’t use agents all that often. And yet, in the official mix&amp;otp guide, agents are the second lesson. I’m not sure they deserve so much spotlight, since it seems they are not used all that often in practice.</p>
</blockquote>
</aside>
<p>Well, I would like to say that, at least in my personal opinion, grasping how Agents work and how to create them has a lot lower learning curve than grasping how the GenServer and related behaviours work and should be used. Of course, this might also be considered a bad thing if it leads to newcomers over-using Agents because they understand <em>those</em>.</p>
<p>As for using ETS over an Agent-argument: Do not forget forget that you should first make it correct, then readable, and only finally fast. If using an Agent is fast enough for whatever purpose it has in your application, the added complexity from using an ETS-based system might not be advantageous.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29220" 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/discussion-about-uses-for-agent-processes/4214/45">Post #44</a>
	                </div>
	            </div>
              <div id="likers-container-29220" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29220"
                     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 #44"></div>
  </section>
</div>
    <div class="postbit" id="29227" data-post-id="29227">
  <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="brightball" data-post="42" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brightball/48/17192_2.png" class="avatar"> brightball:</div>
<blockquote>
<p>Is ETS definitely faster than storing and retrieving something from an agent? I’d been wondering about that but hadn’t seen any stats.</p>
</blockquote>
</aside>
<p>Yes.</p>
<p>Just flat-out yes.</p>
<p>Sometimes faster and sometimes slower depending on the options used to set up the ETS table, but regardless, ‘Yes’.</p>
<p><em>Except in very very specific situations that you are likely to never run in to, and even then only barely…</em></p>
<aside class="quote no-group" data-username="sasajuric" data-post="43" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"> sasajuric:</div>
<blockquote>
<p>The key issue here is that the processing/importing is done in parallel/concurrently over several processes. The agent here acts as the cache as well as a point of serialisation.</p>
<p>Oh, in that case, Agent works perfectly fine here, sorry for wrongly accusing you <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>
</blockquote>
</aside>
<p>I’d still use ETS.</p>
<p><strong>Overall though:</strong></p>
<p>If I’m wanting to store/set data to be accessed by different processes, I’d use ETS.</p>
<p>If I’m wanting to store/set data to be accessed by different processes transactionally, I’d use Mnesia.</p>
<p>If I’m wanting to store/set data in a single process, I’d pass a value (map/tuple/record/whatever) through it.</p>
<p>If I’m wanting to bind some ‘actions’ to operating on data, I’d use GenServer straight.</p>
<p>I cannot really see any reason that I would ever use an Agent at all, there are better/faster methods in all cases that are more functional, both in syntax/code and functionality.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29227" data-batch-url="/posts/batch_likers">
                        5
                      </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/discussion-about-uses-for-agent-processes/4214/46">Post #45</a>
	                </div>
	            </div>
              <div id="likers-container-29227" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29227"
                     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 #45"></div>
  </section>
</div>
    <div class="postbit" id="29230" data-post-id="29230">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Qqwy" data-post="45" data-topic="4214">
<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>Of course, this might also be considered a bad thing if it leads to newcomers over-using Agents because they understand those.</p>
</blockquote>
</aside>
<p>That’s the big problem in my impression. Another problem is that IMO Agents don’t help much for learning GenServer. So while I agree that it’s easier to grasp Agents, I’m not sure that the gain is worth it.</p>
<p>Especially since basic GenServer (init, call, and cast) is not all that complicated (though admittedly still more than Agent).</p>
<aside class="quote no-group" data-username="Qqwy" data-post="45" data-topic="4214">
<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>Do not forget forget that you should first make it correct, then readable, and only finally fast.</p>
</blockquote>
</aside>
<p>I agree with this as long as there is some notable difference in complexity between correct and fast. For a k-v, here’s how it looks with Agents:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{:ok, pid} = Agent.start_link(fn -&gt; %{} end)
Agent.update(pid, &amp;Map.put(&amp;1, :foo, :bar))
Agent.get(pid, &amp;Map.get(&amp;1, :foo))
</code></pre>
<p>and this is how it looks with ETS:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">ets = :ets.new(:table_name, [])
:ets.insert(ets, {:foo, :bar})
:ets.lookup(ets, :foo)
</code></pre>
<p>In terms of code complexity these are mostly similar. In term of scalability, ETS will be much better than single proc in handling larger number of items, as well as larger number of clients. So in this situation, the choice is pretty clear to me <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>
<p>Otherwise, I mostly agree with what <a class="mention" href="/u/overminddl1" rel="nofollow">@OvermindDL1</a> wrote above.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29230" 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/discussion-about-uses-for-agent-processes/4214/47">Post #46</a>
	                </div>
	            </div>
              <div id="likers-container-29230" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29230"
                     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 #46"></div>
  </section>
</div>
    <div class="postbit" id="29401" data-post-id="29401">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="46" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>If I’m wanting to store/set data to be accessed by different processes, I’d use ETS.</p>
<p>If I’m wanting to store/set data to be accessed by different processes transactionally, I’d use Mnesia.</p>
</blockquote>
</aside>
<p>I guess I feel/felt like for something which exists in memory for maybe a few minutes, making an ETS or Mnesia table feels really “heavyweight”, especially since with current scale it’s unlikely to make any measurable difference whether a process is used or ETS/Mnesia directly.</p>
<p>Maybe my inner sense of how “heavy” using those is needs to be recalibrated however. Maybe I incorrectly assume they’re this heavy extra thing because they are rarely mentioned in any educational material around Elixir. Up until now I would have only thought to reach for them when storing data for a longer time—e.g. where I would use Redis in another stack—and not to just store a small, transient amount 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="29401" 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/discussion-about-uses-for-agent-processes/4214/48">Post #47</a>
	                </div>
	            </div>
              <div id="likers-container-29401" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29401"
                     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 #47"></div>
  </section>
</div>
    <div class="postbit" id="29460" data-post-id="29460">
  <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="mjadczak" data-post="48" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mjadczak/48/3537_2.png" class="avatar"> mjadczak:</div>
<blockquote>
<p>I guess I feel/felt like for something which exists in memory for maybe a few minutes, making an ETS or Mnesia table feels really “heavyweight”, especially since with current scale it’s unlikely to make any measurable difference whether a process is used or ETS/Mnesia directly.</p>
</blockquote>
</aside>
<p>Not at all, ETS is blazing fast, it technically works ‘outside’ the actor system so most communication with it is faster than anything else you could set up short of keeping it on the local actor’s stack.  Plus the ETS table is killed when the process it is linked to dies as well.</p>
<aside class="quote no-group" data-username="mjadczak" data-post="48" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mjadczak/48/3537_2.png" class="avatar"> mjadczak:</div>
<blockquote>
<p>Maybe my inner sense of how “heavy” using those is needs to be recalibrated however. Maybe I incorrectly assume they’re this heavy extra thing because they are rarely mentioned in any educational material around Elixir. Up until now I would have only thought to reach for them when storing data for a longer time—e.g. where I would use Redis in another stack—and not to just store a small, transient amount of data.</p>
</blockquote>
</aside>
<p>That is because Elixir is… odd in some of its teaching.  ^.^<br>
In my opinion it really should have made ETS more front-and-center, like it is in Erlang, the EVM/BEAM is practically designed around ETS and making it fast.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29460" 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/discussion-about-uses-for-agent-processes/4214/49">Post #48</a>
	                </div>
	            </div>
              <div id="likers-container-29460" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29460"
                     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 #48"></div>
  </section>
</div>
    <div class="postbit" id="29489" data-post-id="29489">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I read the same thing you mentioned from here:</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://brainlid.org/elixir/2015/12/05/when-do-i-want-a-genserver.html">
  <header class="source">

      <a href="https://brainlid.org/elixir/2015/12/05/when-do-i-want-a-genserver.html" target="_blank" rel="noopener nofollow ugc">brainlid.org</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://brainlid.org/elixir/2015/12/05/when-do-i-want-a-genserver.html" target="_blank" rel="noopener nofollow ugc">When do I use a GenServer?</a></h3>

  <p>Notes from the podcast Elixir Fountain 2015-12-04 with Proctor.</p>


  </article>

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

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

<p>It’s apparently how José Valim described the choice between using Tasks, Agents, and GenServer.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29489" 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/discussion-about-uses-for-agent-processes/4214/50">Post #49</a>
	                </div>
	            </div>
              <div id="likers-container-29489" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29489"
                     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 #49"></div>
  </section>
</div>
    <div class="postbit" id="29515" data-post-id="29515">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="49" data-topic="4214">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>That is because Elixir is… odd in some of its teaching.  ^.^<br>
In my opinion it really should have made ETS more front-and-center, like it is in Erlang, the EVM/BEAM is practically designed around ETS and making it fast.</p>
</blockquote>
</aside>
<p>This is largely the reason no one seems to be using Mnesia, as well. It’s odd, because it’s such a great resource to have and use out of the box. People won’t use it even when what they have is generally perfect for it. I think it stems from records being something Elixir programmers generally know nothing about and all they know is “they’re bad” even though they’ve never had to work with them and so they don’t even know what’s bad about them (the syntax, that’s all). This, coupled with that no one in the core team seems to ever mention Mnesia, means that it’s something people don’t even consider.</p>
<p>When I started working with an erlang codebase I’d only worked with Elixir before and so I faced this personally. I was totally unprepared for how great Mnesia is and how easy it is to work with, because the Elixir community does an extremely bad job in highlighting what a great out of the box feature it is to have.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29515" 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/discussion-about-uses-for-agent-processes/4214/51">Post #50</a>
	                </div>
	            </div>
              <div id="likers-container-29515" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29515"
                     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 #50"></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/4214/load_more?page=6">Load more posts (26 remaining)</a>
</div></template></turbo-stream>