<?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: Alejandro</title>
    <description>The latest articles on DEV Community by Alejandro (@alejandro).</description>
    <link>https://dev.to/alejandro</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%2F112781%2Ff9f69ac8-b954-47cd-a316-b3161fe9b852.jpg</url>
      <title>DEV Community: Alejandro</title>
      <link>https://dev.to/alejandro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alejandro"/>
    <language>en</language>
    <item>
      <title>How to use Firebase?</title>
      <dc:creator>Alejandro</dc:creator>
      <pubDate>Thu, 21 Mar 2019 16:28:26 +0000</pubDate>
      <link>https://dev.to/alejandro/how-to-use-firebase-2pb0</link>
      <guid>https://dev.to/alejandro/how-to-use-firebase-2pb0</guid>
      <description>&lt;p&gt;I have been reading about Firebase and watching a few "getting started" videos but I still don't get it.&lt;/p&gt;

&lt;p&gt;On the videos I see I frequently find things like "how to connect firebase with [Vue|Angular|React]" but then I get with the doubt does firebase is just the database layer or is also the backend layer? &lt;/p&gt;

&lt;p&gt;For example: &lt;/p&gt;

&lt;p&gt;I have an ecommerce site and the user want's to purchase a product. On Vue I'll do all the frontend stuff.&lt;br&gt;
On Net Core I'll do all the backend stuff like checking that the product is in the inventory.&lt;/p&gt;

&lt;p&gt;If I add Firebase then the architecture will become something like this?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Vue connects to Firebase to retrieve the products.&lt;/li&gt;
&lt;li&gt;Vue connects to Net Core which connects to Firebase to know the inventory if the inventory is not available then Net Core responds to Vue that the purchase can not be done.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In that case:&lt;/p&gt;

&lt;p&gt;A. What is the point on connecting to Vue -&amp;gt; Firebase?&lt;br&gt;
B. If you are connecting Vue -&amp;gt; Net Core -&amp;gt; Firebase? What exactly are you benefiting from using Firebase? I read that having a real time app is one of the selling points of firebase but I think that this will be lost by connecting to Net Core&lt;br&gt;
C. Or is it suppose to be some hybrid architecture maybe having Vue -&amp;gt; Firebase (notifications database) and then having Vue -&amp;gt; Net Core -&amp;gt; Firebase (products database)?&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;

</description>
      <category>firebase</category>
      <category>help</category>
    </item>
    <item>
      <title>Moving from Laravel to another framework (django or express)?</title>
      <dc:creator>Alejandro</dc:creator>
      <pubDate>Thu, 07 Feb 2019 15:28:44 +0000</pubDate>
      <link>https://dev.to/alejandro/moving-from-laravel-to-another-framework-django-or-express-20e0</link>
      <guid>https://dev.to/alejandro/moving-from-laravel-to-another-framework-django-or-express-20e0</guid>
      <description>&lt;p&gt;&lt;em&gt;TL;DR: What would you choose between Django or Express if you are very good in Laravel?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hi, I want to move from Laravel to another technology maybe Django or Express but I'm not sure what to do.&lt;/p&gt;

&lt;p&gt;I mainly develop web applications so I'm doing really good with Laravel but since I have been working with it with quite some time I want to learn something new and then use it as a &lt;em&gt;main weapon&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;From what I can see is that the most straight-forward approach would be doing Django but I want to know why people would prefer Express over Django, maybe I'm not seeing something.&lt;/p&gt;

&lt;p&gt;I feel comfortable with the POO languages and I consider I have a high level javascript, so doing Django will be kind of hard and I want to know if it will be worth it or maybe just stick with Laravel as a &lt;em&gt;main weapon&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you consider that there's another framework that is worth it mention it, just consider that I'm trying to go for frameworks that are mature and can be used in a production environment, very rarely I do web apps for more than 10k users per month.&lt;/p&gt;

&lt;p&gt;Thanks for your comments!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>django</category>
      <category>express</category>
      <category>laravel</category>
    </item>
    <item>
      <title>How to do microservices?</title>
      <dc:creator>Alejandro</dc:creator>
      <pubDate>Thu, 07 Feb 2019 00:06:54 +0000</pubDate>
      <link>https://dev.to/alejandro/how-to-do-microservices-59bg</link>
      <guid>https://dev.to/alejandro/how-to-do-microservices-59bg</guid>
      <description>&lt;p&gt;I have a lot of conceptual doubts about the microservices architecture and the implementation on an MVC framework, in this case Laravel.&lt;/p&gt;

&lt;p&gt;Suppose that I have a Blog platform with the given ER Database.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fyu8iizosm4uipr6apbsv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fyu8iizosm4uipr6apbsv.png" alt="database structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And I want to change this system to become a microservices architecture. Based on what I been reading I could go with something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxbbxv0cap3tz5th1ynkn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxbbxv0cap3tz5th1ynkn.png" alt="microservices architecture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this case each Microservice is a Laravel installation (or it can be Node.js, .net-core, etc).&lt;/p&gt;

&lt;p&gt;Now my question comes on how to access each service, for example, suppose that Blog App is a Laravel application and a user enters into &lt;a href="http://blog.test/1" rel="noopener noreferrer"&gt;http://blog.test/1&lt;/a&gt;, so the user wants to see the post with the id 1.&lt;/p&gt;

&lt;p&gt;How does the controller should behave?&lt;/p&gt;

&lt;p&gt;For what I understand maybe the controller looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Http\Controllers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Routing\Controller&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;BaseController&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Http\Request&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BlogController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;BaseController&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Request&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;\GuzzleHttp\Client&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// Get the blog information&lt;/span&gt;
        &lt;span class="nv"&gt;$blogResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'GET'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"http://post-api.blog.test/api/blog/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nv"&gt;$blogString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$blogResponse&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getBody&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nv"&gt;$blog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$blogString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Get the comments information&lt;/span&gt;
        &lt;span class="nv"&gt;$commentsResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'GET'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"http://comments-api.blog.test/api/comments/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nv"&gt;$commentsString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$commentsResponse&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getBody&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nv"&gt;$comments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$commentsString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Get the the author information&lt;/span&gt;
        &lt;span class="nv"&gt;$userResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$client&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'GET'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"http://users-api.blog.test/api/user/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;$blog&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'users_id'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nv"&gt;$userString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$userResponse&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getBody&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;view&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'blog.show'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'blog'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$blog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
            &lt;span class="s1"&gt;'comments'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$comments&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
            &lt;span class="s1"&gt;'author'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My questions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this the correct way to implement it?&lt;/li&gt;
&lt;li&gt;I know I can cache some responses in order to access the resources faster but are Http APIs one way to implement it or there's another piece of technology I'm not seeing?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I know that probably you don't need to do microservices for a blog but just this is just an example as how to implement this paradigm.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

</description>
      <category>help</category>
      <category>microservices</category>
      <category>laravel</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
