<?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: Daniel Kolb</title>
    <description>The latest articles on DEV Community by Daniel Kolb (@danielkolb).</description>
    <link>https://dev.to/danielkolb</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%2F169214%2F8e057924-8200-4b3f-8b91-92735f41e64e.jpg</url>
      <title>DEV Community: Daniel Kolb</title>
      <link>https://dev.to/danielkolb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/danielkolb"/>
    <language>en</language>
    <item>
      <title>Vote for what you want to learn! YouTube Channel for Shopify Developers!</title>
      <dc:creator>Daniel Kolb</dc:creator>
      <pubDate>Mon, 24 Jan 2022 13:20:49 +0000</pubDate>
      <link>https://dev.to/danielkolb/im-creating-a-youtube-channel-for-shopify-developers-536l</link>
      <guid>https://dev.to/danielkolb/im-creating-a-youtube-channel-for-shopify-developers-536l</guid>
      <description>&lt;p&gt;Hi all!&lt;/p&gt;

&lt;p&gt;I’ll start a YouTube channel about code/design/product management shortly. For the first few months, I’ll focus on Coding with Shopify.&lt;/p&gt;

&lt;p&gt;Currently I’m in the process of picking the right topics. I will include Tutorials, Live Code streams and “XXX in 100 seconds” videos.&lt;/p&gt;

&lt;p&gt;I’ve already prepared a couple of ideas here and would like you to &lt;strong&gt;VOTE&lt;/strong&gt; them and also add more to the list. This can be done anonymously, so please don’t break it.&lt;/p&gt;

&lt;p&gt;Here you go: &lt;a href="https://daniel-kolb-youtube-ideas.nolt.io/top"&gt;https://daniel-kolb-youtube-ideas.nolt.io/top&lt;/a&gt; . &lt;/p&gt;

&lt;p&gt;Thanks to everyone who want to participate!&lt;/p&gt;

</description>
      <category>shopify</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>watercooler</category>
    </item>
    <item>
      <title>NoSQL Database Design for E-Commerce Apps in 2021</title>
      <dc:creator>Daniel Kolb</dc:creator>
      <pubDate>Sat, 09 Jan 2021 19:41:59 +0000</pubDate>
      <link>https://dev.to/danielkolb/nosql-database-design-for-e-commerce-apps-in-2021-390e</link>
      <guid>https://dev.to/danielkolb/nosql-database-design-for-e-commerce-apps-in-2021-390e</guid>
      <description>&lt;p&gt;You're building things for the e-commerce industry? Then you should join my newsletter: &lt;a href="https://shophackers.news/"&gt;https://shophackers.news/&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Working with a lot of data like products, orders, categories, users and payments is a very important topic when building e-commerce applications. In this post you'll learn the very basics of structuring your noSQL schema so it's fast and scalable for e-commerce scenarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why you should consider using a noSQL database in 2021
&lt;/h3&gt;

&lt;p&gt;NoSQL databases like MongoDB are still pretty popular amongst modern app development projects and evolved a lot in the last time. The community released many decent packages that help you working with noSQL databases on a very scalable level - like schema generators and battle-proofed packages for combining it with JS frontends or graphQL APIs.&lt;br&gt;
Besides that, especially MongoDB did an awesome job with providing a very good cloud solution (MongoDB Atlas: &lt;a href="https://www.mongodb.com/cloud/atlas"&gt;https://www.mongodb.com/cloud/atlas&lt;/a&gt;) that perfectly fits in a modern web tech stack.&lt;/p&gt;
&lt;h3&gt;
  
  
  Are noSQL databases the right choice for an e-commerce application?
&lt;/h3&gt;

&lt;p&gt;In case you've dropped the idea of using noSQL databases in the last years because you've heard of them not being the right choice for any apps that need to manage a lot of complex &amp;amp; transactional data, you should give them a shot again. Things changed quite a lot. Actually, Reaction Commerce wrote a decent post about that more than 3 years ago and the technology improved even more since then: &lt;a href="https://blog.reactioncommerce.com/why-nosql-databases-are-perfect-for-ecommerce/"&gt;https://blog.reactioncommerce.com/why-nosql-databases-are-perfect-for-ecommerce/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To summarise: With MongoDB (and any other noSQL database) you can build safe, reliable, scalable, cloud-based databases that are very fun and easy to code with.&lt;/p&gt;
&lt;h3&gt;
  
  
  What you should consider when you create schemas for e-commerce apps
&lt;/h3&gt;

&lt;p&gt;When you build e-commerce experiences you typically have to cater for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;up to thousands of products&lt;/li&gt;
&lt;li&gt;products that have CMS-like content like images and descriptions&lt;/li&gt;
&lt;li&gt;products that are available in up to thousands of variants...&lt;/li&gt;
&lt;li&gt;variants that are defined by many different attributes&lt;/li&gt;
&lt;li&gt;probably thousands of orders...&lt;/li&gt;
&lt;li&gt;orders might have multiple products (and their variants)&lt;/li&gt;
&lt;li&gt;orders might have different states that might change multiple times a day&lt;/li&gt;
&lt;li&gt;orders might be assigned to customers&lt;/li&gt;
&lt;li&gt;customers might be users with a login name, password, address, etc.&lt;/li&gt;
&lt;li&gt;there's usually also quite a lot of CMS content like blog posts, marketing landing pages, etc.&lt;/li&gt;
&lt;li&gt;and much more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see, you should make sure that your database works for a huge amount of data sets that are connected to each other. &lt;/p&gt;
&lt;h3&gt;
  
  
  Embedding Data: Work with data fast &amp;amp; easy
&lt;/h3&gt;

&lt;p&gt;When you work with MongoDB, you create JSON-based entries (called "documents") in your database and group them in so-called "collections".&lt;/p&gt;

&lt;p&gt;For example, the collection "products" contains multiple documents while each document contains the data for a product like this one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// a document in the "products" collection&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;_id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ObjectId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;5e451f4cd249baf1d045a778&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hackathon T-Shirt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;price&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;3.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;currency&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;USD&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;description&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My Awesome Shirt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sku&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEV1337&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;createdAt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ISODate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2021-01-02T10:05:00.610Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stock&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sizes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;xs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;s&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;m&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;l&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;xl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;xxl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;colors&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;green&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vendor&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEVSHIRTS&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vendorSlug&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;devshirts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vendorDescription&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEVSHIRTS is a fashion label that sells T-Shirts for devs.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Query embedded data
&lt;/h4&gt;

&lt;p&gt;In this example I've &lt;strong&gt;embedded&lt;/strong&gt; all data for this product in its document. By embedding the data directly to the object I can get the product with all of its properties with a single query like in this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;findOne&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sku&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEV1337&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;productTitle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// "Hackathon T-Shirt"&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;vendor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vendor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// "DEVSHIRTS"&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;amountSizes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sizes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="c1"&gt;// 6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Super clean and easy to write, isn't it? However, you should keep in mind that query for multiple products will return the product with all of its properties which can become up to &lt;strong&gt;16MB&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Modify embedded data
&lt;/h4&gt;

&lt;p&gt;Let's say one vendor has 1000+ products and you decide to change a vendor's description. Now all 1000+ products have to be changed with the same operation to change it "vendorDescription" that needs to be changed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;updateMany&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;vendor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEVSHIRTS&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;vendorDescription&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEVSHIRT's new description&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Such operations are easy to code but might need a lot of processing power when they need to be done multiple times per minute or per second in a huge database. One solution for this is referencing the data instead of embedding it into the object.&lt;/p&gt;

&lt;h3&gt;
  
  
  Referencing Data: Work with distributed data sets
&lt;/h3&gt;

&lt;p&gt;You probably know this way of working with data from regular SQL-databases like MySQL. Instead of adding all data to the same document, you just add a reference ID to another entry in another collection like I do here for the vendor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//a document in the "products" collection:&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;_id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ObjectId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;5e451f4cd249baf1d045a778&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hackathon T-Shirt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;price&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;3.99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;currency&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;USD&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;description&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My Awesome Shirt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sku&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEV1337&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;createdAt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ISODate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2021-01-02T10:05:00.610Z&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stock&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sizes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;xs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;s&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;m&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;l&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;xl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;xxl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;colors&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;green&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vendor&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;23ae11d117baf1d127c99efd334&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//a document in the "vendors" collection:&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;_id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ObjectId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;23ae11d117baf1d127c99efd334&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEVSHIRTS&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;slug&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;devshirts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;description&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEVSHIRTS is a fashion label that sells T-Shirts for devs.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Query referenced data
&lt;/h4&gt;

&lt;p&gt;When you query referenced data, you need to write the first query to get the referenced id and a second query to get the object you're looking for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Want to get the vendor description of a product...&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;findOne&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sku&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEV1337&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;vendorId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vendor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// "23ae11d117baf1d127c99efd334"&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;vendor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vendors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;findOne&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;_id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;vendorId&lt;/span&gt;&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;vendorDescription&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;vendor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;description&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's also a way to do this on a database level with the $lookup functionality: &lt;a href="https://kb.objectrocket.com/mongo-db/how-to-use-the-lookup-function-in-mongodb-1277"&gt;https://kb.objectrocket.com/mongo-db/how-to-use-the-lookup-function-in-mongodb-1277&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Modify referenced data
&lt;/h4&gt;

&lt;p&gt;This is a big upside when working with referenced data instead of embedded data: You need to update way fewer documents, probably only one. For example, updating the description of a vendor can be done by a very performant single operation now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;vendor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEVSHIRTS&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;vendorDescription&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEVSHIRT's new description&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even if you have thousands of products from this vendor in your database, MongoDB will only need to update one single entry.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use embedded vs. referenced data
&lt;/h3&gt;

&lt;p&gt;To decide whether you should embed or reference your data is one of the most important aspects when building database schemas.&lt;/p&gt;

&lt;p&gt;Referencing data might often look like a "clean" way but when you start to create as many references as possible the amount of code &amp;amp; queries you'll need to write will increase tremendously - think of my product example above with references to sizes, colors, currencies, etc..&lt;br&gt;
Besides that, your database will get bombed with queries and operations that might be needed when you'd just embed the data. &lt;br&gt;
On the other hand, too much embedded data could mean that you query and work with objects that are way bigger than actually needed, which also slows down your app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Only reference when needed
&lt;/h3&gt;

&lt;p&gt;From my experience, it's best practice to embed as much data as possible and only reference other documents if it's really needed and makes sense for your specific application.&lt;/p&gt;

&lt;p&gt;For example, if you only need to attach a few variants with unique attributes to a product, there's no need of creating a "variants" collection for that. On the other hand, if your variants are basically their own products with a lot of attributes (like title, images, sku, prices, etc.) and even get shared across multiple products, it's a better idea to put those in their own "variants" collection so you can query and modify them independently from the products.&lt;/p&gt;

&lt;h4&gt;
  
  
  Tip: data models can come in handy
&lt;/h4&gt;

&lt;p&gt;Oftentimes it also helps to select the schema based on the data model. While embedded data is usually fine for "One-To-One" and "One-To-Few" relations, referenced data shines for "One-To-Many" and especially for "One-To-VeryMany" relations.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's next
&lt;/h3&gt;

&lt;p&gt;I hope I could give you a basic understanding of embedded &amp;amp; referenced data and you have an idea about structuring e-commerce data now.&lt;br&gt;
If you want to learn more, MongoDB has quite nice tutorials, guides, and presentations you can have a look at:&lt;br&gt;
&lt;a href="https://docs.mongodb.com/manual/applications/data-models/"&gt;https://docs.mongodb.com/manual/applications/data-models/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.mongodb.com/blog/post/performance-best-practices-mongodb-data-modeling-and-memory-sizing"&gt;https://www.mongodb.com/blog/post/performance-best-practices-mongodb-data-modeling-and-memory-sizing&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.mongodb.com/presentations/schema-design-best-practices-series-modelling-relationships"&gt;https://www.mongodb.com/presentations/schema-design-best-practices-series-modelling-relationships&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ecommerce</category>
      <category>database</category>
      <category>mongodb</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Shopify for Frontend Engineers | #1 Dev Env, ThemeKit, Liquid</title>
      <dc:creator>Daniel Kolb</dc:creator>
      <pubDate>Sat, 02 Jan 2021 17:12:22 +0000</pubDate>
      <link>https://dev.to/danielkolb/intro-to-shopify-theme-development-1-concepts-tools-124c</link>
      <guid>https://dev.to/danielkolb/intro-to-shopify-theme-development-1-concepts-tools-124c</guid>
      <description>&lt;p&gt;Shopify gained a lot of traction in the last months - probably because E-Commerce is in very high demand amidst a pandemic that forces many retail stores to shut down. That's also why Shopify developers are in high demand right now.&lt;/p&gt;

&lt;p&gt;I've been working with Shopify for several years now and introduced many developers that are used to other CMS like Wordpress, Magento, Prestashop etc. to Shopify. From my experience, many developers have troubles getting into the concepts of working with a SaaS-CMS, which applies to Shopify and results in pretty unique ways to build the thing you want to create.&lt;/p&gt;

&lt;p&gt;For example, Shopify doesn't offer a real, full-fledged possibility to work with a Shopify store's files locally and there's also a lot of black box magic happening on the Shopify servers that you just have to deal with - e.g. automatic generated, captcha-enabled forms that get connected to the Shopify servers by default.&lt;/p&gt;

&lt;p&gt;Besides that, many developers have problems grasping very Shopify specific E-Commerce concepts - like the idea of so called "collections" instead of ordinary product categories.&lt;/p&gt;

&lt;p&gt;However, in this and my upcoming blog posts I'll focus on...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setup a development environment using a development store and ThemeKit&lt;/li&gt;
&lt;li&gt;Modifying popular Shopify themes&lt;/li&gt;
&lt;li&gt;Give you guidance on how you can craft your very own, 100% custom built Shopify frontends&lt;/li&gt;
&lt;li&gt;How you can build headless storefronts for Shopify&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So let's start with the most important concepts. They're pretty basic but if you don't know about them you'll waste hours or days bumming you head against a wall because a lot of things might work differently than you'd expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool #1: Partner Dashboard &amp;amp; Development Stores
&lt;/h2&gt;

&lt;p&gt;Since you can't install Shopify locally (like you would with let's say Wordpress), you need to work with an online development instance of Shopify. Yep: it isn't possible to work with Shopify without an active internet connection.&lt;/p&gt;

&lt;p&gt;To create a development store visit &lt;a href="https://partners.shopify.com/signup"&gt;https://partners.shopify.com/signup&lt;/a&gt; and create a Shopify Partners account. It's for free and allows you to create an unlimited amount of development stores to code with. Development stores are free as well. Creating development stores is super straight forward and is probably not a major hurdle for you if you know how to code. That being said, if you face problems creating a development store have a look at this super detailed how-to written by Shopify: &lt;a href="https://help.shopify.com/en/partners/dashboard/managing-stores/development-stores"&gt;https://help.shopify.com/en/partners/dashboard/managing-stores/development-stores&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool #2: ThemeKit - a remote control for your development store
&lt;/h2&gt;

&lt;p&gt;Since Shopify is 100% SaaS based, you aren't able to create a local Shopify environment on your machine. Instead, you must work with your (live online) development store by changing the files on the files on the Shopify servers. To help you with that, Shopify created a command line tool called "ThemeKit": &lt;a href="https://shopify.github.io/themekit/"&gt;https://shopify.github.io/themekit/&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;Using homebrew you can install it as easy as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew tap shopify/shopify
brew install themekit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you've created a private app in your development store to get the API credentials you need for ThemeKit (as it's described in the "Getting Started" guide here: &lt;a href="https://shopify.github.io/themekit/"&gt;https://shopify.github.io/themekit/&lt;/a&gt;), you just have to type&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;theme download&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;to download your theme.&lt;/p&gt;

&lt;p&gt;After that you can execute&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;theme watch&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;to let ThemeKit monitor your local files and push changed files to the Shopify servers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To wrap up, what ThemeKit essentially does is:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;downloading the theme files from your development store to your local machine&lt;/li&gt;
&lt;li&gt;whenever you do a change to a local file, it gets automatically uploaded via SSH to the Shopify servers and connected to your development store&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second point is super, super important and I saw many devs not grasping this concept even after they've worked with Shopify for several weeks. To make it clear: ThemeKit exclusively works as kind of a remote-control for your Shopify store. It does so by uploading your locally changed file to the Shopify servers and replace whatever is on the Shopify servers with your local file.&lt;/p&gt;

&lt;p&gt;That means you should really cater for a version control system like git(hub) to keep track of your local changes - Shopify won't help you with that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool #3: Liquid - Shopify's templating language
&lt;/h2&gt;

&lt;p&gt;You probably at least heard of Smarty, Handlebars, JSX and all of that different templating languages. Shopify just provides their own, pretty slick templating language called "Liquid": &lt;a href="https://shopify.github.io/liquid/"&gt;https://shopify.github.io/liquid/&lt;/a&gt; . Liquid is actually open source and even used by other projects like the static site generator Jekyll.&lt;br&gt;
However, when you're working with Shopify themes you'll build page templates with Liquid, meaning instead of let's say hard-coding a product title for a product page, you use something like&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{{product.title}}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;to dynamically print the title of the current accessed product, while many products share the same page template file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Liquid gets compiled to html/css on the Shopify servers when a user wants to access a store page (well, they've caching in place but leave that for now). This means that whatever liquid magic you do in your code, only the Shopify servers know about it and compile your liquid code to pure html/css files that get sent to the client. &lt;/p&gt;

&lt;p&gt;On that note: If you write JavaScript for the client, keep in mind that any liquid variables will get compiled &lt;strong&gt;before&lt;/strong&gt; the frontend (including the script) gets sent to the user. Meaning that any liquid variable in your JavaScript will get compiled (most probably) to a string you can use, but &lt;strong&gt;you won't be able to assign any new values to liquid variables using JavaScript&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Shopify offers a "cheat sheet" that helps you to find the variables you might be looking for: &lt;a href="https://www.shopify.com/partners/shopify-cheat-sheet"&gt;https://www.shopify.com/partners/shopify-cheat-sheet&lt;/a&gt; . &lt;/p&gt;

&lt;h2&gt;
  
  
  Tool #4: HTML/CSS/JS and an IDE of your choice
&lt;/h2&gt;

&lt;p&gt;Well, nothing new here. Besides Liquid and ThemeKit you can use the tools you probably know and love for your frontend projects: HTML as markup, CSS for styling and JS to make things fancy &amp;amp; interactive. In regards to the IDE: if you use Visual Code watch out for liquid extensions that help you writing Shopify theme code.&lt;/p&gt;

&lt;h2&gt;
  
  
  But how can I use React/Vue/Angular/?
&lt;/h2&gt;

&lt;p&gt;Unfortunately there aren't very straight-forward ways to use these frameworks for Shopify frontends. The most common way to do so is by using Shopify's Storefront API (&lt;a href="https://shopify.dev/docs/storefront-api"&gt;https://shopify.dev/docs/storefront-api&lt;/a&gt;) and build a custom headless frontend. This comes with some restrictions like not being able to use Shopify's native Customizer (a drag&amp;amp;drop editor for merchants) and therefore is probably not what you're looking for. However, I'll make a tutorial on this too, so I have you covered.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fun fact&lt;/em&gt;: A lot of Shopify themes use jQuery for the javascript part. You might love or hate it, but probably hate it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's start coding!
&lt;/h2&gt;

&lt;p&gt;Okay, at this point you should have understood the concepts of ThemeKit, Liquid and have a development store you're keen to modify. In the next tutorial we'll start doing changes to the current installed theme, create new elements and learn how to code for Shopify's Customizer so merchants are able to modify your elements using a drag&amp;amp;drop editor.&lt;/p&gt;

</description>
      <category>shopify</category>
      <category>frontend</category>
      <category>theme</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Shopify for Developers — the Good, the Bad and the Ugly</title>
      <dc:creator>Daniel Kolb</dc:creator>
      <pubDate>Mon, 24 Aug 2020 11:23:31 +0000</pubDate>
      <link>https://dev.to/danielkolb/shopify-for-developers-the-good-the-bad-and-the-ugly-3pkn</link>
      <guid>https://dev.to/danielkolb/shopify-for-developers-the-good-the-bad-and-the-ugly-3pkn</guid>
      <description>&lt;p&gt;I guess it was in 2015 when I discovered Shopify for the first time. Back then, it had a very sketchy reputation in my area (Europe) for being the most popular shop system for very small merchants and drop shippers because one can get started in minutes and all the complicated stuff like payments, nice looking designs and hosting are included out of the box. Sounds good? Not for everybody.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why you may have heard bad things about Shopify
&lt;/h2&gt;

&lt;p&gt;In case you don’t know yet: drop shippers are merchants who don’t actually purchase, store and ship products using their own warehouses and employees. Let alone producing the goods. Instead, drop shippers just buy their products whenever an order comes in (usually on Chinese Alibaba or similar) and enter their customer’s address as the shipping address. Merchants usually do this if they don’t have the budget to create &amp;amp; store their own products which is usually a lot more profitable. There’s a very big community and consulting businesses for drop shippers. While most drop shippers don’t actually make much money, there are also some unicorns who can make a decent living from that.&lt;/p&gt;

&lt;p&gt;However, using the most popular shop software for that kind of bedroom entrepreneurs might feel exciting when you’re just starting out because it sounds like it’s really foolproof.&lt;br&gt;
But in contrast, imagine you’re the E-Commerce Manager of a multi million dollar company. You have to decide whether you should tell your boss that your company should run on a service mainly used by those newish entrepreneurs or should use a well known and established brand like Magento instead. In this scenario, Shopify will actually appear rather amateurish and like a bad decision to you.&lt;/p&gt;

&lt;p&gt;So it came that the idle rumor of Shopify not being sophisticated enough for any businesses besides bedroom entrepreneurs quickly spread and established.&lt;/p&gt;

&lt;p&gt;Today, Shopify proved that it can handle enterprise sized business processes. In many cases even better than most other shop systems on the market thanks to its modern tech stack and user-centric design decisions. It’s becoming more and more popular all over the globe and is the engine that runs more than 1 million shops today. Many big companies joined the plattform — like gymshark, TESLA, Hasbro, Heinz and more. Shopify even introduced Shopify Plus, which is a service exclusively for high volume merchants, but runs the same core like the regular Shopify.&lt;/p&gt;

&lt;h2&gt;
  
  
  What makes Shopify different?
&lt;/h2&gt;

&lt;p&gt;The biggest difference of Shopify compared to other solutions like Magento or Prestashop is that Shopify is a SaaS — a Software as a Service. Shopify themselves talk about Shopify not as a software, but rather a “platform”. If you register on Shopify’s website as a merchant, you’ll get only a subdomain (which you can connect to your own domain later on) and therefore a spot on their server farms that run all Shopify shops. You don’t need to rent and maintain your own server infrastructure — this is all completely handled by Shopify. Good thing is: As long as Google Cloud is online, Shopify stores are online. Anice fact for traffic spikes on Black Friday.&lt;/p&gt;

&lt;p&gt;“Well, SaaS means that I won’t be able to modify the system” you might think and indeed, changing Shopify’s core isn’t possible at all. However, changing the code of a system is usually considered very bad practice and is usually not needed. That’s why you normally build plugins for Wordpress/Magento/Prestashop rather than changing the code of the system’s core.&lt;br&gt;
Same story in regards to Shopify: You can build plugins instead of changing the core. These plugins are called “apps” in the Shopify ecosystem and integrate with Shopify solely by using their APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shopify’s APIs
&lt;/h2&gt;

&lt;p&gt;When you’re in the platform business, your APIs are your bread and butter topics since they’re the only way to enable others to add features to your platform. Sounds like a reasoner, right? That’s why Shopify really cares much about their APIs. They were one of the first E-Commerce companies that made GraphQL a first class citizen in their ecosystem while still maintaining their old REST APIs. Besides that, they have an extensive documentation, many tutorials, GraphQL learning kits, blog posts and even CLI tools and npm packages to support working with their APIs. They have a big website for developers that you can find here.&lt;/p&gt;

&lt;p&gt;Using Shopify’s APIs you can do CRUD operations to products, collections/categories, customers, pages, frontends, orders and even communicate with their own apps like Ping (Chatbot), Kit (Marketing Automation) or the Shopify POS App (selling with Shopify in brick and mortar stores). Sounds pretty sophisticated, right? Yep, the possibilities are exciting and Shopify usually adds new API features on a monthly or even weekly basis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shopify’s App Tech Stack is for everyone!
&lt;/h2&gt;

&lt;p&gt;Sometimes it feels a bit complicated to use APIs instead of calling system methods like you would usually do with your plugin in Wordpress or Magento, because you have to take care of API limits and payload structure and so on. However, good thing is: You don’t need to adopt Shopify’s system tech stack — I have no idea what it is but I read that they coded a lot in Ruby. And even better: You don’t need to use PHP — ever. Well, of course you could, but you don’t want to, do you?&lt;/p&gt;

&lt;p&gt;Instead, you can use whatever you like: You’re a Python, Java or Ruby dev and love to use Angular and Vue on the frontend?&lt;br&gt;
Build a restaurant / search / review / whatever app for Shopify!&lt;/p&gt;

&lt;p&gt;You like Node+React? No problemo, amigo!&lt;br&gt;
Shopify loves you and provides a ton of npm packages, CLI tools and even a whole component library.&lt;br&gt;
Downside: You have to take care of hosting your app and also do the whole authentication process yourself (passing hmac back and forth and more funny things). However, there’s Heroku and there’s an auth-packages from Shopify, so not really an issue that will hold you back from getting started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shiny Shopify: How to create and modify Themes
&lt;/h2&gt;

&lt;p&gt;Up until here, I just spoke about creating apps which is the path you’ll choose when you need to do massive changes to Shopify, do backend-related work or want to earn decent money by selling your app in the Shopify App Store .&lt;br&gt;
If you just want to do frontend modifications by creating a new theme or change the current theme of a Shopify store, you don’t need to use Shopify’s APIs at all.&lt;br&gt;
Instead, you can connect your IDE via theme kit and edit the frontend code right away in VS Code/Atom/Brackets/Sublime Text/Notepad++. Alternatively, Shopify even provides their own code editor which is embedded in the Shopify Admin. Shopify uses the template language Liquid which will look and feel very familiar to you if you ever worked with Smarty, JSX or handlebars before. It allows you to assign variables and do basic stuff like looping over products and getting images in different sizes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to get started: Become a Shopify partner
&lt;/h2&gt;

&lt;p&gt;As of today, Shopify offers no certification process, so all you need to do is to register here to create a free partner account. With your partner account, you can create development stores which allow you to build things in a Shopify shop for free — forever. Besides that, Shopify provides you a partner academy which is nice to understand most of the basic concepts. They won’t show you many details and you’ll get stuck for sure — that’s why I’m here to help you.&lt;/p&gt;

&lt;p&gt;I’m going to release several tutorials, best-practice posts and also business related content about Shopify in the upcoming weeks here on Dev.to. Thanks! Cheers!&lt;/p&gt;

</description>
      <category>shopify</category>
      <category>ecommerce</category>
      <category>sideprojects</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
