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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Our project generator defaults first and foremost have always optimized for on boarding folks getting into the ecosystem. History and support requests from slack/forums/irc tells us our defaults of including DB integration out of the box are what the vast majority of folks want when getting into Elixir and Phoenix. This same argument is why we include brunch by default – folks want a good story on “where do I place my js/css so I can style and script my web application”. Our defaults are driven by these facts, but as Dave points out in his course, there are switches to customize your new project once you are comfortable in the ecosystem.</p>
<p>With respect to decoupling and thinking in terms of larger application architecture, our <code>--umbrella</code> flag to the <code>phx.new</code> generator follows what dave lays out in his course. You have an <code>apps/my_app_web</code> which is the phoenix server, and a separate <code>apps/my_app</code>, which is <em>your app</em>, and contains Ecto/DB integration by default. There are also new <code>phx.gen.ecto</code> and <code>phx.gen.web</code> project generators for generating isolated applications for existing umbrella apps, so I believe we tick the boxes dave is after if you are using umbrella apps. That said, we don’t generate an umbrella project by default today because it places a larger burden on folks getting started – multiple config files, multiple mix.exs files to place deps in different places, etc. It’s also not clear that all project scopes are best served by umbrellas. What we do in Phoenix 1.3 to bridge this gap is a project structure that more easily lends itself to graduate to an umbrella app, hence the <code>lib/my_app_web</code> and <code>lib/my_app</code> folders with separate aliases.</p>
<aside class="quote no-group" data-username="pragdave" data-post="7" data-topic="8623">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pragdave/48/1042_2.png" class="avatar"> pragdave:</div>
<blockquote>
<p>It’s rather that first 1.2 and the 1.3 actually tightened the coupling between the two.</p>
</blockquote>
</aside>
<p>Dave, can you expand on this point? The push for contexts encourages folks to use discrete APIs exactly to decouple the two. Whether <code>MyApp.Calendar.create_reminder</code> talks to an Ecto repo, or starts a GenServer process with a timeout is an implementation detail from the caller’s perspective so I don’t agree with this point.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50191" data-batch-url="/posts/batch_likers">
                        16
                      </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-dont-add-a-database-layer-to-your-phoenix-application/8623/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-50191" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50191"
                     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="50192" data-post-id="50192">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In what context is ‘application’ being used here? I can think of a few that might apply. Does ‘phoenix application’ refer to the entire mix project generated by <code>phx.new</code> or does it refer to just the <code>myapp_web</code> portion? Or does it refer to the actual otp application that you get out of the box?</p>
<p>Phoenix 1.3 encourages the logical separation of your web concerns and your business concerns, with the data layer being lumped in with the business logic. Is the idea to pull that apart further into three separate pieces: <code>[web, business, data]</code> instead of <code>[web, {business, data}]</code>? So that inside of a Foo context, <code>Foo.get_all_things()</code> contains something like <code>DataLayer.get_all_things()</code> instead of <code>Thing |&gt; Repo.all()</code>, where <code>DataLayer</code> is referencing a separate service, whether that be in another child of the main supervision tree or a completely separate otp application?</p>
<p>I already think of <code>myapp</code> and <code>myapp_web</code> as being separate concerns, with nothing phoenix specific touching anything from <code>myapp</code>. So in that sense the database layer has a ‘source code’ decoupling from the web stuff, but there is still a ‘project’ coupling in that they both live in the same mix project, and I suppose a sort of ‘run time’ coupling in that the ecto Repo and phoenix Endpoint are siblings under the same direct parent supervisor and run under the same otp application. Is the idea to move the database layer into it’s own otp application?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50192" 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-dont-add-a-database-layer-to-your-phoenix-application/8623/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-50192" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50192"
                     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="50203" data-post-id="50203">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<p>The push for contexts encourages folks to use discrete APIs exactly to decouple the two.</p>
</blockquote>
<p>To a point. But the code still lives in the Phoenix app, so the presence of contexts actually encourages the exact behavior that is long-term harmful.</p>
<p>It seems to me that contexts are simply a way of creating service apis.</p>
<p>If I were writing an application that had services, but I included those services in one of the endpoint API modules, that would generally be considered to be a bad design. Why, for example, would a user creation service be part of my web API module when I would also use it from my command line and from my batch processing?</p>
<p>So I really think that offering contexts as part of Phoenix is wrong. It says that the Elixir community supports this kind of coupling.</p>
<p>But the reality is that the Elixir ecosystem is one of the few that actually supports the proper (and efficient) splitting of these responsibilities.</p>
<p>I really don’t buy the “ease-of-entry based on new user expectations” argument. If I did, I’d write a PHP interpreter as part of Phoenix. Instead, I think we make the entry easier by making it simpler. Give people a good architecture, where everything has it’s place, and where decoupling is the norm. The aim isn’t to write a 10 minute blog—it’s to write a five year application.</p>
<p>Parallel (not umbrella) applications are trivial to create and manage, and have decoupling built in from the start.</p>
<aside class="quote group-Phoenix-Core-Team" data-username="chrismccord" data-post="12" data-topic="8623">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chrismccord/48/24233_2.png" class="avatar"> chrismccord:</div>
<blockquote>
<p>Whether MyApp.Calendar.create_reminder talks to an Ecto repo, or starts a GenServer process with a timeout is an implementation detail from the caller’s perspective so I don’t agree with this point.</p>
</blockquote>
</aside>
<p>Except… this assumes that the Calendar context/service is part of the Phoenix app (assuming MyApp is one), and this just doesn’t make sense. Phoenix is not the application. It’s a way of accessing the application.</p>
<p>Dave</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50203" data-batch-url="/posts/batch_likers">
                        10
                      </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-dont-add-a-database-layer-to-your-phoenix-application/8623/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-50203" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50203"
                     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="50204" data-post-id="50204">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="pragdave" data-post="15" data-topic="8623">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pragdave/48/1042_2.png" class="avatar"> pragdave:</div>
<blockquote>
<p>If I were writing an application that had services, but I included those services in one of the endpoint API modules, that would generally be considered to be a bad design. Why, for example, would a user creation service be part of my web API module when I would also use it from my command line and from my batch processing?</p>
</blockquote>
</aside>
<p>Isn’t this the reason <em>for</em> contexts though? Your application services aren’t included inside of your web api module, but rather inside of the appropriate context module. <code>MyAppWeb.Controller.UserController.create</code> calls into <code>MyApp.Accounts.create_user</code>. If you wanted to use the user creation service from the command line you could have <code>Mix.Tasks.MyApp.CreateUser.run</code> that also calls into <code>MyApp.Accounts.create_user</code> to do the actual work.</p>
<p>In that sense, the phoenix/mix edges of your application are essentially just i/o adapters that are translating inputs/ouputs from somewhere (http, stdin) into calls to the functional api that lives inside of the contexts. If you maintain strict segregation between your contexts and the i/o layers (which I think 1.3 encourages), then your application remains decoupled from phoenix.</p>
<p>That is the way that I think of it at least. I think of phoenix as just being a dependency for my elixir application that lives along side of it inside it’s own <code>app_web</code> world.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50204" 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-dont-add-a-database-layer-to-your-phoenix-application/8623/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-50204" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50204"
                     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="50208" data-post-id="50208">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="pragdave" data-post="15" data-topic="8623">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pragdave/48/1042_2.png" class="avatar"> pragdave:</div>
<blockquote>
<p>Except… this assumes that the Calendar context/service is part of the Phoenix app (assuming MyApp is one), and this just doesn’t make sense. Phoenix is not the application. It’s a way of accessing the application.</p>
</blockquote>
</aside>
<p>All the web things are in <code>MyAppWeb</code> namespace, <code>MyApp</code> has no web components.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50208" 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-dont-add-a-database-layer-to-your-phoenix-application/8623/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-50208" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50208"
                     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="50209" data-post-id="50209">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The point still holds: it’s still one big application. It should be many.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50209" 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-dont-add-a-database-layer-to-your-phoenix-application/8623/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-50209" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50209"
                     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 #17"></div>
  </section>
</div>
    <div class="postbit" id="50210" data-post-id="50210">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It is really hard to agree that Phoenix v1.3 became more coupled to the database compared to previous versions. It has gone from an application that accessed the database in your controllers, channels and models to one that puts this access behind isolated modules with discrete APIs. Removing the database access in a Phoenix v1.3 app should require localized changes to your lib/app instead of rewriting most of your web layer.</p>
<p>It also puzzles me when someone says contexts are wrong because contexts are literally modules. You can disagree with the placement of those modules (in the same application instead of separate ones) but using modules to define our APIs is pretty much our bread and butter.  This is supported by the fact you can now generate the web code that access any module and then just fill in the blanks. The blanks can be filled with a module in the same or in a separate application. Or even with a module that does not reach the database at all.</p>
<p>I agree Phoenix v1.3 does not completely push in the direction <a class="mention" href="/u/pragdave" rel="nofollow">@pragdave</a> would like to but it does make those patterns possible which is something we cannot say at all about previous versions.</p>
<p>I also have strong reservations about having different applications that depend on the same database instance, as those are effectively coupled at the operation level and you will run into issues depending on how you coordinate things such as migrations. I would like to see both development and operation concerns being taken into account on those discussions. But since I have already phrased those concerns elsewhere, I won’t rehash them here.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50210" data-batch-url="/posts/batch_likers">
                        12
                      </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-dont-add-a-database-layer-to-your-phoenix-application/8623/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-50210" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50210"
                     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="50211" data-post-id="50211">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The fact they live in a different place doesn’t stop them being part of the same application codebase.</p>
<p>I agree that Phoenix is an I/O adapter. I don’t agree that the application code should share the same mix project (or even umbrella project). That would be like putting my text-based adventure game into the /dev/tty driver codebase… <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="50211" 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/discussion-dont-add-a-database-layer-to-your-phoenix-application/8623/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-50211" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50211"
                     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="50213" data-post-id="50213">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team" data-username="josevalim" data-post="19" data-topic="8623">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<p>It also puzzles me when someone says contexts are wrong because contexts are literally modules.</p>
</blockquote>
</aside>
<p>I don’t say contexts are wrong. I do say that encouraging new developers to place them inside the same project as the view layer is not a good idea. So in that way, 1.3 created a good idea (contexts/services) but then encouraged it to be used in a way that can lead to lots of coupling, and to Monorails. (And, as we’re discussed, umbrella projects don’t fix it.)</p>
<p>Saying “developers don’t have to use it” is dissembling when it is the default (and hence recommended) way that Phoenix apps are created.</p>
<p>Don’t get me wrong. I’m in awe of the amount of work that’s been done, and I’m very grateful to everyone. But I’m simply worried that this effort might not realize its full potential unless newcomers are shown that Phoenix is not a web framework—it isn’t Rails. Instead it is the web-tier (or, really, the TCP tier) in a multi-tier overall application.</p>
<p>And with that, I’ll sign out, because I respect the developers too much to spread bad karma.</p>
<p>Dave</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50213" 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/discussion-dont-add-a-database-layer-to-your-phoenix-application/8623/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-50213" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50213"
                     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>
    <div class="postbit" id="50214" data-post-id="50214">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="pragdave" data-post="21" data-topic="8623">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pragdave/48/1042_2.png" class="avatar"> pragdave:</div>
<blockquote>
<p>I don’t say contexts are wrong.</p>
</blockquote>
</aside>
<p>Thanks for clarifying Dave! You said “offering contexts as part of Phoenix is wrong” which I read as “offering contexts as a concept in Phoenix” and it seems you meant “offering contexts directly in Phoenix and not in a separate app”. <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> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="50214" 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/discussion-dont-add-a-database-layer-to-your-phoenix-application/8623/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-50214" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="50214"
                     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 #21"></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/8623/load_more?page=3">Load more posts (62 remaining)</a>
</div></template></turbo-stream>