<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: fullstackplus</title>
    <description>The latest articles on DEV Community by fullstackplus (@fullstackplus).</description>
    <link>https://dev.to/fullstackplus</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F85519%2F5cb68526-e332-46fc-bf9f-336bc3ae2f74.png</url>
      <title>DEV Community: fullstackplus</title>
      <link>https://dev.to/fullstackplus</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fullstackplus"/>
    <language>en</language>
    <item>
      <title>Choosing a storage solution for simple user input</title>
      <dc:creator>fullstackplus</dc:creator>
      <pubDate>Wed, 20 Oct 2021 13:05:08 +0000</pubDate>
      <link>https://dev.to/fullstackplus/choosing-a-storage-solution-for-simple-user-input-3k1f</link>
      <guid>https://dev.to/fullstackplus/choosing-a-storage-solution-for-simple-user-input-3k1f</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;here's an engineer-y question for you regarding lead generation online. &lt;/p&gt;

&lt;p&gt;Say you had to collect your visitors' name &amp;amp; email through a landing page opt-in. What storage mechanism would you use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a JSON file&lt;/li&gt;
&lt;li&gt;a key-value store&lt;/li&gt;
&lt;li&gt;a relational DB?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My current solution is a JSON file, however it's not very efficient because when saving a new entry, you need to parse all the existing ones into an Array from JSON, add the new data, then again serialize the entire collection as JSON, then write it back to the file. &lt;/p&gt;

&lt;p&gt;Also, if I'm going to do uniqueness tests (no double entries allowed for email, for example), I'll have to traverse the entire array to find the duplicate — I suspect this is more efficiently handled by the other two storage mechanisms (hash-based lookup in constant time).&lt;/p&gt;

&lt;p&gt;Thanx for your input!&lt;/p&gt;

</description>
      <category>storage</category>
      <category>db</category>
      <category>json</category>
      <category>optin</category>
    </item>
    <item>
      <title>Running a modular Sinatra app on Heroku</title>
      <dc:creator>fullstackplus</dc:creator>
      <pubDate>Thu, 19 Jul 2018 16:23:05 +0000</pubDate>
      <link>https://dev.to/fullstackplus/running-a-modular-sinatra-app-on-heroku-4d68</link>
      <guid>https://dev.to/fullstackplus/running-a-modular-sinatra-app-on-heroku-4d68</guid>
      <description>&lt;p&gt;Hello, I'm having trouble getting a modular Sinatra app to run correctly in production. The &lt;code&gt;git push heroku master&lt;/code&gt; works fine, but when I try to submit a form through the &lt;code&gt;/contact&lt;/code&gt; page I get: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;bundler: failed to load command: rackup (/app/vendor/bundle/ruby/2.4.0/bin/rackup)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;Procfile:&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;web: bundle exec rackup config.ru -p $PORT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My &lt;code&gt;config.ru:&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'rubygems'&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'bundler'&lt;/span&gt;

&lt;span class="no"&gt;Bundler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;require&lt;/span&gt;

&lt;span class="nb"&gt;require_relative&lt;/span&gt; &lt;span class="s1"&gt;'lib/app'&lt;/span&gt;
&lt;span class="n"&gt;run&lt;/span&gt; &lt;span class="no"&gt;Tir&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;App&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My &lt;code&gt;lib/app.rb&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'sinatra/base'&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expand_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'articles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kp"&gt;__FILE__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expand_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'static'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kp"&gt;__FILE__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expand_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'landing'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kp"&gt;__FILE__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Tir&lt;/span&gt;
  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;Sinatra&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
    &lt;span class="c1"&gt;#code&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I've tried all manner of tweaks but am stuck! Thanks for any help.&lt;/p&gt;

</description>
      <category>help</category>
    </item>
  </channel>
</rss>
