<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sam Ghoreishi on Medium]]></title>
        <description><![CDATA[Stories by Sam Ghoreishi on Medium]]></description>
        <link>https://medium.com/@sam20gh?source=rss-11c4990b7312------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*JjLoEMrRjqdHet-x2z5FtA.jpeg</url>
            <title>Stories by Sam Ghoreishi on Medium</title>
            <link>https://medium.com/@sam20gh?source=rss-11c4990b7312------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 20:02:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sam20gh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a personalised news feed with MongoDB Atlas Vector Search and PCA-compressed embeddings]]></title>
            <link>https://medium.com/@sam20gh/building-a-personalised-news-feed-with-mongodb-atlas-vector-search-and-pca-compressed-embeddings-807eff3e6bc8?source=rss-11c4990b7312------2</link>
            <guid isPermaLink="false">https://medium.com/p/807eff3e6bc8</guid>
            <dc:creator><![CDATA[Sam Ghoreishi]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 19:20:19 GMT</pubDate>
            <atom:updated>2026-06-03T19:20:19.123Z</atom:updated>
            <content:encoded><![CDATA[<p>How we turned likes, saves and reading time into a 128-dimensional vector that decides what every user sees next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4BQdt---mJpQojWDHr5BA.png" /></figure><p>A reverse-chronological feed is the easiest thing in the world to ship and the fastest thing to make people bounce. Newest-first means the loudest source wins, breaking news drowns everything for an hour, and a reader who only ever opens football stories gets fed the same politics they keep scrolling past. We run a news app (English and Arabic), and “sort by publishedAt descending&quot; got us to launch and absolutely no further.</p><p>What we actually wanted was the thing every recommendation talk hand-waves over: show each person the articles they’d have picked themselves, from a pool of tens of thousands, without anyone manually tagging interests. This is a write-up of how we did it with MongoDB Atlas Vector Search, why we search a PCA-compressed embedding instead of the real one, and the unglamorous production plumbing that keeps it from falling over. There’s a fair bit of real code, because the interesting parts are never in the diagram.</p><h3>One vector space for everything</h3><p>The whole approach rests on a single idea: put articles and users in the <em>same</em> coordinate system.</p><p>Every article gets an embedding from its text — a list of floats that places “Saudi PIF raises stake in…” near other finance stories and far from a match report. A user is just the running average of the articles they’ve engaged with. If both live in the same space, “what should this person read” becomes “which article vectors sit closest to this user’s vector,” and that’s a nearest-neighbour search. Cosine similarity, specifically, because we care about direction (topic), not magnitude.</p><p>That’s the part that’s easy to say. Everything below is the part that’s annoying to get right.</p><h3>Why we don’t search the raw embedding</h3><p>Here’s a decision I’d defend to anyone: we never run vector search against the raw embedding model output. We store a 128-dimensional <strong>PCA projection</strong> of it on a field called embedding_pca, and that&#39;s what the index sits on.</p><p>The raw embeddings are big — hundreds to a couple thousand dimensions depending on the model. They’re great for accuracy and terrible for everything else at our scale. A bigger vector means a bigger index, slower approximate-nearest-neighbour traversal, more bytes pulled out of Mongo on every query, and a heavier payload moving around the backend. Principal Component Analysis lets us keep the directions that actually carry the variance and throw away the rest. We landed on 128 dimensions because below that we started losing topic separation we could feel in the results, and above it we were paying for precision nobody noticed.</p><p>The nice side effect: 128 floats is small enough that we can do cosine similarity <em>in JavaScript</em> when we already have the vectors in memory, which matters for some of the re-ranking paths later. The same function the index uses, basically:</p><pre>function cosineSimilarity(a, b) {<br>  if (!a || !b || a.length !== b.length) return 0;<br>  let dot = 0, magA = 0, magB = 0;<br>  for (let i = 0; i &lt; a.length; i++) {<br>    dot += a[i] * b[i];<br>    magA += a[i] * a[i];<br>    magB += b[i] * b[i];<br>  }<br>  return magA &amp;&amp; magB ? dot / (Math.sqrt(magA) * Math.sqrt(magB)) : 0;<br>}</pre><p>The catch with PCA is that the projection has to be stable. The basis you fit once and reuse — you can’t refit it per batch, or yesterday’s article vectors stop being comparable to today’s. So the PCA model is trained once on a representative sample and then applied as a fixed transform to every new article and every user vector. If you ever retrain it, you re-embed everything. Plan for that on day one.</p><h3>The index</h3><p>The Atlas Search index is small and does more than people expect:</p><pre>{<br>  &quot;fields&quot;: [<br>    { &quot;type&quot;: &quot;vector&quot;, &quot;path&quot;: &quot;embedding_pca&quot;, &quot;numDimensions&quot;: 128, &quot;similarity&quot;: &quot;cosine&quot; },<br>    { &quot;type&quot;: &quot;filter&quot;, &quot;path&quot;: &quot;language&quot; },<br>    { &quot;type&quot;: &quot;filter&quot;, &quot;path&quot;: &quot;publishedAt&quot; },<br>    { &quot;type&quot;: &quot;filter&quot;, &quot;path&quot;: &quot;category&quot; },<br>    { &quot;type&quot;: &quot;filter&quot;, &quot;path&quot;: &quot;sourceId&quot; }<br>  ]<br>}</pre><p>Four of those five fields are filter, not vector, and that&#39;s deliberate. Filtering <em>inside</em> $vectorSearch is the cheapest place to narrow the search — you&#39;re pruning the candidate set before the ANN traversal does its work, not after. So language (&quot;don&#39;t show an English reader Arabic stories&quot;), a freshness window on publishedAt, category exclusions, and source filtering all happen at the index level. Trying to filter that stuff in a later $match stage means the vector search does a pile of work you immediately throw away.</p><h3>Building the user vector, and keeping it from going stale</h3><p>This is the half of the system that tutorials skip, and it’s where all the actual product behaviour lives.</p><p>A user vector is the centroid of what they’ve engaged with — but “engaged with” is a spectrum, not a boolean. A like is a strong signal. A dislike is a strong <em>negative</em> signal. A long read on an article is a real signal even without a tap. A two-second bounce is noise. We weight those differently when we build the vector, and we keep it current in three different ways at three different speeds.</p><p><strong>The nightly rebuild (slow, complete).</strong> A cron job recomputes each active user’s vector from scratch every night — likes, saves, comments, the articles they actually read. This is the source of truth. It’s also hours stale by definition, which is fine for the baseline but useless for “I just liked three crypto articles, why is my feed still all football.”</p><p><strong>The incremental update (fast, on every tap).</strong> So on every like and dislike, we nudge the vector immediately with an exponential moving average — pull it toward a liked article, push it away from a disliked one. No embedding API call, about 5ms of arithmetic:</p><pre>// EMA blend — like pulls toward, dislike pushes away.<br>const alpha = action === &#39;like&#39; ? 0.12 : -0.15;<br>const w = 1 - Math.abs(alpha);<br>const newEmbedding = user.embedding_pca.map(<br>  (v, i) =&gt; v * w + article.embedding_pca[i] * alpha<br>);<br>await User.updateOne(<br>  { supabase_id: supabaseId },<br>  { $set: { embedding_pca: newEmbedding, updatedAt: new Date() } }<br>);</pre><p>A dislike gets a slightly bigger magnitude than a like (-0.15 vs 0.12) because in practice people will tell you what they hate more clearly than what they love, and you want to act on it fast. The nightly cron still catches up on everything the incremental path is too cheap to handle.</p><p><strong>Cold start.</strong> A brand-new account has no vector at all, so its first request can’t be personalized. The moment they like something, we seed their vector with that article’s vector outright — the very next feed is already vector-weighted instead of waiting until 2am:</p><pre>// Cold-start: user has no embedding yet. Seed it with the article&#39;s<br>// vector so the next request is personalized. Only on like — seeding<br>// from a dislike means starting as &quot;the opposite of one article,&quot;<br>// which is meaningless.<br>await User.updateOne(<br>  { supabase_id: supabaseId },<br>  { $set: { embedding_pca: article.embedding_pca, updatedAt: new Date() } }<br>);</pre><p>We only seed from a like, never a dislike. Starting a profile as “the opposite of the one article you didn’t like” is mathematically valid and completely useless.</p><p><strong>Don’t let fast scrolling thrash the vector.</strong> Someone rage-tapping like on ten articles in three seconds shouldn’t move their vector ten times. A Redis SET ... NX EX 2 debounce means at most one incremental update per user per two seconds; the rest collapse into the nightly rebuild. Cheap insurance against a noisy hot path.</p><p><strong>The drift correction.</strong> Even with all that, a lifetime average lags behind a shifting interest — someone who’s read finance for a year but is suddenly deep in a tech story this week. So right before we query, we blend the stored lifetime vector with the centroid of their last ~15 liked articles, then renormalize so cosine stays valid:</p><pre>// 65% lifetime embedding + 35% recent centroid<br>const blended = userEmbedding.map((v, i) =&gt; 0.65 * v + 0.35 * recentCentroid[i]);<br>const mag = Math.sqrt(blended.reduce((s, v) =&gt; s + v * v, 0));<br>if (mag &gt; 0) userEmbedding = blended.map(v =&gt; v / mag);</pre><p>65/35 was a feel decision. Higher and the feed lurched around on a single session’s whims; lower and recent interest didn’t show up fast enough. Tune it on your own users.</p><h3>The query</h3><p>With a fresh user vector in hand, the search itself is almost boring — which is the goal:</p><pre>{<br>  $vectorSearch: {<br>    index: VECTOR_INDEX,<br>    path: &quot;embedding_pca&quot;,<br>    queryVector: userEmbedding,<br>    numCandidates,<br>    limit: searchLimit,<br>    filter: {<br>      language,<br>      publishedAt: { $gte: cutoffDate },<br>      _id: { $nin: excludeIds },<br>      ...(dislikedCategories.length ? { category: { $nin: dislikedCategories } } : {}),<br>      ...(preferredCategories.length &amp;&amp; !isWideningSearch<br>        ? { category: { $in: preferredCategories.slice(0, 5) } } : {}),<br>      ...(preferredSources.length &amp;&amp; !isWideningSearch<br>        ? { sourceId: { $in: preferredSources.map(id =&gt; new mongoose.Types.ObjectId(id)) } } : {})<br>    }<br>  }<br>},<br>{ $addFields: { similarity: { $meta: &quot;vectorSearchScore&quot; } } }</pre><p>A few things worth pointing at:</p><p>numCandidates and limit are the recall/latency dial. numCandidates is how many approximate neighbours the engine looks at; limit is how many it returns. We set candidates to 2.5× the pool we need and the return limit to 1.5×. More candidates means better recall and a slower query — we walked both down from higher numbers once the results were good enough, because at our traffic the latency mattered more than the last few points of recall.</p><p>excludeIds is everything we don&#39;t want to show again: articles already served today, things they&#39;ve explicitly disliked, and the last 200 they viewed. Excluding at the index level beats fetching-then-filtering.</p><p>$meta: &quot;vectorSearchScore&quot; hands the cosine score back as a real field. You need it, because similarity is the <em>input</em> to ranking, not the ranking itself.</p><h3>Similarity is not a feed</h3><p>If you sort purely by cosine similarity you get a feed that is technically relevant and practically dead — the same five topics, the same handful of sources, nothing new, nothing breaking. A good feed is a blend. Here’s roughly what each candidate’s score is made of:</p><pre>const baseScore = (similarity * 0.55) + (engagementScore * 0.20) + preferenceBoost;<br>const finalScore = w_recency * recencyScore + (1 - w_recency) * baseScore;</pre><p>Similarity leads at 55%. Engagement (a weighted mix of views, likes and dislikes) is secondary at 20%. On top sits a preference boost — and that boost isn’t flat. We derive it from how long someone <em>actually reads</em> each category, scaled so their top category gets the strongest nudge:</p><pre>// Scale so the top category gets +0.25, others proportionally less<br>categoryTimeBoosts[stat._id] = (stat.totalTime / maxTime) * 0.25;</pre><p>Reading time is the most honest signal we have. People lie with taps and tell the truth with attention. A category someone genuinely sinks minutes into gets a proportional boost; a category they merely clicked once gets nothing. That replaced an earlier flat “+0.15 if it’s a preferred category,” which treated a casual tap and a daily habit identically.</p><p>And w_recency is page-aware — it&#39;s higher on the first page and decays as you scroll:</p><pre>const w_recency = page === 1 ? 0.45 : page === 2 ? 0.35 : page === 3 ? 0.25 : 0.20;</pre><p>Page one should feel current. By page four you’re clearly browsing, and freshness should step aside for relevance.</p><h3>Recency, without the cliffs</h3><p>Our first recency function was a staircase: 1.0 if under 24h, 0.8 under 48h, and so on. The bug that function shipped is obvious in hindsight — an article scored 1.0 at 23 hours old and 0.8 at 25 hours, a 20% drop for two hours of aging, while a 2-hour-old breaking story and a 22-hour-old one scored <em>identically</em>. For a news app that’s exactly backwards.</p><p>We replaced it with continuous exponential decay and a single tunable constant:</p><pre>const RECENCY_TAU_HOURS = 72;</pre><pre>function basicRecencyScore(publishedAt) {<br>  const now = Date.now();<br>  const t = new Date(publishedAt || Date.now()).getTime();<br>  const hours = Math.max(0, (now - t) / (1000 * 60 * 60));<br>  return Math.exp(-hours / RECENCY_TAU_HOURS);<br>}</pre><p>With τ at 72 hours, a story is worth ~0.72 at a day old, ~0.37 at three days, and a faint 0.10 after a week. A two-hour-old story now genuinely beats a twenty-two-hour-old one on the recency term, which is what you want when something just broke. One knob, no cliffs, and freshness re-tunes without touching anything else.</p><h3>Breaking the bubble on purpose</h3><p>Pure relevance is a filter bubble with extra steps. Three things push against that, all bounded so they assist the ranking instead of hijacking it.</p><p><strong>Diversity injection</strong> mixes in ~15% of slightly-less-similar-but-still-relevant articles, shuffled with a <em>seeded</em> random generator so that pagination stays stable — page two looks the same whether you load it once or five times. Deterministic randomness sounds like an oxymoron until you’ve debugged a feed that reshuffles itself on every scroll.</p><p><strong>Trending injection</strong> adds ~10%, but ranked by view <em>velocity</em> — views per hour — not raw view count:</p><pre>const ageHours = Math.max(0.5, (Date.now() - new Date(article.publishedAt).getTime()) / 3.6e6);<br>const velocity = (article.viewCount || 0) / ageHours;</pre><p>A two-hour-old article pulling 500 views should beat a three-day-old one sitting on 2,000. Raw counts just surface old winners; velocity surfaces what’s catching fire right now.</p><p><strong>Source caps.</strong> No more than two articles per source group make the feed, so one prolific outlet can’t carpet someone’s morning. For a news product that publishes a fair-revenue-share story about <em>not</em> being dominated by the loudest publisher, this one’s also kind of the whole point.</p><h3>The boring part that actually keeps it up</h3><p>Here’s what nobody puts in the architecture diagram: vector search is a dependency that can be slow or simply gone — index rebuilding, Atlas Search having a moment — and your feed cannot 500 because of it. Most of the route, honestly, is failure handling.</p><p>We check readiness before trusting it, and that check has its own trap. listSearchIndexes() can hang for ~9 seconds when the search service is unhealthy, which would turn a cold instance&#39;s first request into a 9-second wait. So it&#39;s wrapped in a hard timeout and the result cached for ten minutes:</p><pre>const indexes = await Promise.race([<br>  Article.collection.listSearchIndexes({ name: VECTOR_INDEX }).toArray(),<br>  new Promise((_, reject) =&gt;<br>    setTimeout(() =&gt; reject(new Error(&#39;listSearchIndexes timeout&#39;)), 2000)),<br>]);</pre><p>There’s also a tiny “is this actually alive right now” probe — a limit: 1 vector search with a 300ms ceiling — before we commit to the full query, and an env flag to hard-disable vector search during migrations without touching code.</p><p>Above all of that sits a wall-clock budget. If the request crosses ~3 seconds, we abandon the clever path entirely and serve a plain recency-and-engagement fallback. A slightly-less-personalised feed in under a second beats a perfect feed that times out, every time. There’s a cold-start fallback for users with no vector yet, and an engagement fallback for when the vector search returns nothing — the feed degrades through several tiers but it always returns <em>something</em>.</p><p>Caching is per-user and surgical. Page one is keyed by the hour so it refreshes hourly; deeper pages key by day plus a per-user novelty seed. The part I’m quietly proud of: when a user likes something, we don’t scan the whole Redis keyspace to bust their cache. Every cache write also SADDs the key into a user_cache_keys:{userId} set, so invalidating one user is an O(their-keys) operation, not O(everyone). Combined with a served-set that tracks what each user has already seen today, the same article doesn&#39;t show up twice and one person&#39;s activity never forces a global cache flush.</p><h3>Where this leaves us</h3><p>Strip away the plumbing and the shape is simple: embed the articles, compress to 128 dimensions with a fixed PCA basis, average a user’s engagement into a vector in that same space, and let Atlas Vector Search find the neighbours — then blend in recency, engagement, reading time, diversity and trending so the result reads like a feed instead of a similarity dump.</p><p>The lessons that transferred to everything else we build: compress your vectors and stop apologising for it; update the user representation at three speeds (instant, hourly, nightly) instead of pretending one will do; and spend more of your time on graceful failure than on the happy path, because the happy path is the part that already works. If you’re standing up something similar, start with the index filters and the fallbacks. The cosine search is the easy 20%.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=807eff3e6bc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplify Your Restaurant Operations with a Centralised Point-of-Sale System]]></title>
            <link>https://medium.com/@sam20gh/simplify-your-restaurant-operations-with-a-centralised-point-of-sale-system-49680763774b?source=rss-11c4990b7312------2</link>
            <guid isPermaLink="false">https://medium.com/p/49680763774b</guid>
            <category><![CDATA[epos-software-uk]]></category>
            <category><![CDATA[epos-systems]]></category>
            <category><![CDATA[epos-systems-uk]]></category>
            <category><![CDATA[epos-software]]></category>
            <category><![CDATA[takeaways]]></category>
            <dc:creator><![CDATA[Sam Ghoreishi]]></dc:creator>
            <pubDate>Mon, 17 Mar 2025 16:21:32 GMT</pubDate>
            <atom:updated>2025-03-17T16:21:32.627Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jhlQC88hRykwyRVcj8H63A.png" /><figcaption>GrubPos</figcaption></figure><p>Running a successful restaurant demands efficient management across various areas, from order processing and inventory management to customer satisfaction. Centralising these operations through a robust Point-of-Sale (POS) system like GrubPos can streamline processes, enhance efficiency, and boost your profitability.</p><h3>What is a Centralised POS System?</h3><p>A <a href="https://grub24forbusiness.com/">centralised POS system</a> consolidates all your restaurant’s operational tasks into one accessible platform. This includes managing orders, payments, inventory tracking, sales reporting, and even customer relationship management, all from a single user-friendly interface.</p><h3>Benefits of Using GrubPos Centralised Management</h3><h4>1. Seamless Order Management</h4><p>Say goodbye to misplaced orders or communication errors. GrubPos integrates orders from various channels — dine-in, takeaway, and online — into a unified dashboard, making it easier for your staff to manage efficiently and reducing customer waiting times.</p><h4>2. Real-Time Inventory Control</h4><p>Efficient inventory management is vital for reducing waste and controlling costs. GrubPos helps track your stock levels in real-time, alerting you when items run low, so you can reorder promptly and ensure you’re always ready to serve your customers’ favourite dishes.</p><h4>3. Enhanced Customer Experience</h4><p>GrubPos’s intuitive interface ensures quick and error-free transactions. Furthermore, with integrated allergen alerts and detailed product descriptions, your staff can confidently answer customer queries and personalise service, significantly improving customer satisfaction.</p><h4>4. Comprehensive Reporting</h4><p>Gain actionable insights into your restaurant’s performance through GrubPos’s powerful analytics tools. Understand your sales patterns, peak hours, and top-performing menu items to make informed business decisions that drive profitability.</p><h4>5. Simplified Staff Management</h4><p>Keep track of staff productivity, manage shifts effectively, and streamline payroll processes. GrubPos provides comprehensive tools that simplify staff management, saving time and reducing administrative burdens.</p><h3>Why Choose GrubPos?</h3><p>GrubPos stands out as a tailored solution designed specifically for restaurants looking to simplify complex operations. By providing robust integrations, secure payment processing, and user-friendly technology, GrubPos helps you focus more on delivering outstanding food and service rather than worrying about operations.</p><h3>Ready to Simplify?</h3><p>Transform the way your restaurant operates today. Embrace centralised management with GrubPos and see immediate improvements in efficiency, customer satisfaction, and profitability.</p><p>Visit <a href="https://grub24forbusiness.com/">Grub24 for Business</a> to learn more or schedule your demo now!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49680763774b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Restaurant GrubPos: Revolutionising Hospitality with a Smarter Point-of-Sale System]]></title>
            <link>https://medium.com/@sam20gh/restaurnt-grubpos-revolutionising-hospitality-with-a-smarter-point-of-sale-system-566fefc0fbf7?source=rss-11c4990b7312------2</link>
            <guid isPermaLink="false">https://medium.com/p/566fefc0fbf7</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[epos-systems]]></category>
            <category><![CDATA[epos-software-uk]]></category>
            <category><![CDATA[hospitality]]></category>
            <category><![CDATA[hospitality-industry]]></category>
            <dc:creator><![CDATA[Sam Ghoreishi]]></dc:creator>
            <pubDate>Sat, 08 Mar 2025 21:48:51 GMT</pubDate>
            <atom:updated>2025-03-10T13:49:18.880Z</atom:updated>
            <content:encoded><![CDATA[<p>The hospitality industry is fast-paced, demanding, and constantly evolving. Efficiency is everything for restaurant owners, cafés, takeaways, and QSRs (quick-service restaurants). Managing orders, processing payments, and keeping track of inventory while ensuring a seamless customer experience can feel like an endless juggling act.</p><p>This is where <strong>GrubPos</strong> steps in. Designed specifically for the hospitality industry, <strong>GrubPos is an all-in-one digital order management system that streamlines restaurant operations and enhances customer service.</strong></p><figure><img alt="Waiter holding GrubPos ordering tablet" src="https://cdn-images-1.medium.com/max/1024/1*aidT6oKGYCz0mEbUZHYv8A.jpeg" /></figure><h3>What is GrubPos?</h3><p>GrubPos is a next-generation <strong>point-of-sale (POS) system</strong> tailored to the needs of modern restaurants, takeaways, and food businesses. It’s more than just a POS — it’s a comprehensive solution that integrates <strong>order management, payments, kitchen display systems, and customer engagement tools</strong>, all in one intuitive platform.</p><p>Whether you’re running a small independent café or a multi-location restaurant chain, GrubPos provides <strong>seamless automation, real-time insights, and user-friendly tools</strong> to simplify day-to-day operations.</p><h3>How GrubPos Helps the Hospitality Industry</h3><h3>1. Simplifies Order Management</h3><p>Gone are the days of manually tracking orders and struggling with paper tickets. With GrubPos, orders from the till, self-service kiosks, online platforms, and third-party delivery apps are <strong>automatically synced</strong> into a central system. This means fewer mistakes, faster service, and <strong>happier customers</strong>.</p><h3>2. Integrated Payment Solutions</h3><p>A seamless payment process is crucial for customer satisfaction. GrubPos integrates with leading payment providers, including <strong>Dojo</strong>, to ensure secure, fast, and hassle-free transactions. Whether it’s card, contactless, or mobile payments, <strong>GrubPos handles it all effortlessly</strong>.</p><h3>3. Real-Time Inventory and Reporting</h3><p>Keeping track of stock can be a nightmare, especially during peak hours. With real-time inventory tracking, GrubPos alerts you when items are running low, helping you <strong>avoid stock shortages and reduce wastage</strong>. Plus, its built-in analytics provide insights into sales trends, best-selling items, and customer preferences — helping you make smarter business decisions.</p><h3>4. Kitchen Automation for Faster Service</h3><p>A smooth kitchen workflow is key to fast and accurate food preparation. The <strong>GrubPos Kitchen Display System (KDS)</strong> sends orders directly to the kitchen, reducing miscommunication and wait times. This helps kitchen staff stay organised and deliver <strong>consistent, high-quality food</strong>.</p><h3>5. Streamlined Refunds and Payment Adjustments</h3><p>Mistakes happen. But with GrubPos, refunds and payment corrections are handled <strong>quickly and transparently</strong>. Payments can be refunded directly from the checkout page, and incorrect transactions can be reversed without disrupting daily operations.</p><h3>6. Compliance and Allergen Management</h3><p>Food safety is a top priority for restaurants. GrubPos includes an <strong>allergen tracking feature</strong>, allowing staff to flag menu items containing allergens like milk, soy, or nuts. When a customer with allergies places an order, the system automatically prevents them from selecting unsafe items — <strong>helping businesses comply with food safety regulations while protecting customer health</strong>.</p><h3>7. Supports Multi-Channel Sales</h3><p>In today’s digital world, customers order food through multiple channels — walk-ins, online, and delivery apps. GrubPos integrates everything into one system, making <strong>managing in-house dining, takeaway, and delivery services easier without juggling multiple devices</strong>.</p><h3>Why Restaurants are Choosing GrubPos</h3><p>Unlike traditional POS systems, <strong>GrubPos is built with hospitality in mind</strong>. It’s designed to be intuitive, easy to set up, and flexible enough to adapt to different restaurant models. With features like:</p><p>✅ <strong>Seamless integration with third-party platforms</strong><br> ✅ <strong>Real-time cloud-based updates</strong><br> ✅ <strong>A user-friendly interface for staff and managers</strong><br> ✅ <strong>Multi-location support for growing businesses</strong></p><p>…it’s no surprise that more restaurants are switching to GrubPos.</p><h3>Final Thoughts</h3><p>In the fast-moving hospitality industry, having the right technology can make or break a business. GrubPos isn’t just another POS — it’s a <strong>game-changer</strong> for restaurants looking to streamline operations, boost efficiency, and improve customer experience.</p><p>Whether you’re a single-location café or a multi-chain restaurant, <strong>GrubPos gives you the tools to succeed in today’s competitive food industry</strong>. Ready to take your restaurant to the next level? It’s time to <strong>make the switch to smarter hospitality technology</strong>.</p><p>🚀 <strong>Learn more about GrubPos and how it can transform your business.</strong></p><p><a href="https://grub24forbusiness.com/epos/">https://grub24forbusiness.com/epos/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bq0QWcvRbC0aELxb9lUOTw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=566fefc0fbf7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to import mySQL database from cPanel to Amazon RDS]]></title>
            <link>https://medium.com/@sam20gh/how-to-import-mysql-database-from-cpanel-to-amazon-rds-9943afee195?source=rss-11c4990b7312------2</link>
            <guid isPermaLink="false">https://medium.com/p/9943afee195</guid>
            <dc:creator><![CDATA[Sam Ghoreishi]]></dc:creator>
            <pubDate>Tue, 11 Jan 2022 00:46:28 GMT</pubDate>
            <atom:updated>2022-01-11T00:46:28.982Z</atom:updated>
            <content:encoded><![CDATA[<p>Migration to cloud infrastructure from traditional WHM/cPANEL setup was long due on my latest project so decision was made to migrate to AWS and one the main challenges I faced was migration of a 9GB MySQL database to Amazon RDS.</p><p>Traditionally I would use MySQLWorkbench to import and export datas or if the database is small it s possible to use phpmyAdmin but as the size of database increases it becomes more challenging to use these tools and after 3 attempts to use MySQLWorkbench I finally gave up.</p><p>so here is the route I took and I believe its a fastest and easiest ways to migrate to RDS.</p><h3>1- Create your amazon RDS</h3><p><strong>To create a DB instance follow this link</strong></p><p><a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html">https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GDH_NITttXFt1_s1jx6tTw.png" /><figcaption>Create RDS instance</figcaption></figure><p>Its very strait-forward and easy so I wont repeat it but in the setting you</p><h4>must remember to allow Public access</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZBaHmgRAvIjjvzNnE5NFjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4O7IizlAzo1tCiZPJmddA.png" /><figcaption>Security Group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DyvPqu-kPD4zQKLU8k-t_g.png" /></figure><p>once your DB instance status is Available click on instance name and under Connectivity &amp; security tab click on security group you have assigned to you instance</p><p>and click edit inbound roles</p><p>Add a new rule and select MYSQL/Aurora and enter your old servers IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8YxezczfapRt1tfT8xHDng.png" /></figure><p>this is to make sure your old server can connect to your RDS instance. You can remove this rule after migration is completed.</p><h3>2- login to you old server</h3><p>via ssh or WHM terminal and run the following command (replace with your credentials)</p><p>sudo mysqldump -u <strong><em>localuser</em></strong>\<br> — databases <strong><em>databaseName</em></strong> \<br> — single-transaction \<br> — compress \<br> — order-by-primary \<br> — routines=0 \<br> — triggers=0 \<br> — events=0 \<br> -p<strong><em>localpassword</em></strong> | mysql -u <strong><em>rdsuser</em></strong> \<br> — port=3306 \<br> — host=<strong><em>myinstance.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com</em></strong> \<br> -<strong><em>prdspassword</em></strong></p><p>The parameters used are as follows:</p><ul><li>-u <em>local_user</em> – Use to specify a user name. In the first usage of this parameter, you specify the name of a user account on the local cPanel MySQL database.</li><li>--databases <em>databaseName</em> – Use to specify the name of the database on the cPanel MySQL instance that you want to import into Amazon RDS.</li><li>--single-transaction – Use to ensure that all of the data loaded from the cPanel is consistent with a single point in time. If there are other processes changing the data while mysqldump is reading it, using this option helps maintain data integrity.</li><li>--compress – Use to reduce network bandwidth consumption by compressing the data from the cPanel database before sending it to Amazon RDS.</li><li>--order-by-primary – Use to reduce load time by sorting each table&#39;s data by its primary key.</li><li>-p<em>local_password</em> – Use to specify a password. In the first usage of this parameter, you specify the password for the user account identified by the first -u parameter.</li><li>-u <em>RDS_user</em> – Use to specify a user name. In the second usage of this parameter, you specify the name of a user account on the default database for the MySQL instance identified by the --host parameter.</li><li>--port <em>port_number</em> – Use to specify the port for your MySQL instance. By default, this is 3306 unless you changed the value when creating the instance.</li><li>--host <em>host_name</em> – Use to specify the DNS name from the Amazon RDS DB instance endpoint, for example, myinstance.xxxxxxxx.us-east-1.rds.amazonaws.com. You can find the endpoint value in the instance details in the Amazon RDS Management Console.</li><li>-p<em>RDS_password</em> – Use to specify a password. In the second usage of this parameter, you specify the password for the user account identified by the second -u parameter.</li></ul><h3>Example</h3><p>sudo mysqldump -u cp_dataUser <br>- databases cp_testDataBase<br>- single-transaction<br>- compress<br>- order-by-primary<br>- routines=0<br>- triggers=0<br>- events=0<br>pMycPanelPassword | mysql — user=rdsUser<br>- port=3306<br>- host=grubaws.cslacxdsgddr94aer.eu-west-2.rds.amazonaws.com — password=MyRdsPassword dbmaster</p><p>hit enter and Enjoy. it takes less than 10min to transfer a 10GB database for cPanel to Amazon RDS.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl4Ep3mmmj7Bw3adWw%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl4Ep3mmmj7Bw3adWw%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl4Ep3mmmj7Bw3adWw%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="333" frameborder="0" scrolling="no"><a href="https://medium.com/media/a18746208b526ccb8bea61973f5e307c/href">https://medium.com/media/a18746208b526ccb8bea61973f5e307c/href</a></iframe><p>If you can not connect to RDS from your cPanel then there are few things to check.</p><p>1- Firewall of your WHM account is not blocking you. Turn it off and rr=un the command to test it</p><p>2- inbound rule is not properly set. check your server IP address and make sure you are allowing connection from that IP to your RDS instance.</p><p>3- Your RDS instance is publicly available.</p><p>I hope this little tutorial will help someone out there.</p><p>Thanks for reading, and happy coding! 😀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9943afee195" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Look at ReactJS and React Native]]></title>
            <link>https://medium.com/@sam20gh/a-look-at-reactjs-and-react-native-8e984d4d2f0d?source=rss-11c4990b7312------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e984d4d2f0d</guid>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sam Ghoreishi]]></dc:creator>
            <pubDate>Tue, 28 May 2019 12:43:24 GMT</pubDate>
            <atom:updated>2019-05-28T13:01:04.616Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>React JS</strong> and <strong>React Native</strong> is fast growing in popularity amount developers. In this article, I will be discussing the what is React JS, what is React Native, the Difference between ReactJS and React Native, and the pros and cons of both ReactJS React Native in respect to one another etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQPH_vMYWljzjrgUMz-4xg.png" /><figcaption>React JS vs. React Native Comparison Chart</figcaption></figure><h3>What is React?</h3><p>To address its need for a dynamic and high performing User Interface(UI), Jordan Walke and his team from Facebook developed and released the ReactJS library in 2011, a JavaScript library which brought together the speed of JavaScript and a new way of rendering pages, leading to a responsive and dynamic user input.</p><blockquote><strong>ReactJS is responsible for V part within a MVC pattern (Model-View-Controller)</strong></blockquote><p>ReactJS is component based. These components are the elements which constitute the user interface (a button, a search engine, etc.).</p><p>A virtual DOM is altered with each alteration. This fact makes the real DOM only change in the parts which have experienced alterations. This translates into an improvement in memory consumption and performance over the other frameworks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T8O-XO4eg1DPy9tKKqMSfg.png" /><figcaption>ReactJS Statistics and usage among top websites</figcaption></figure><h3>Pros of React JS</h3><ul><li><strong>React’s virtual DOM is faster than the conventional full refresh model</strong>, since the virtual DOM refreshes only parts of the page.</li><li>You can <strong>reuse code components</strong> in React JS, saving you a lot of time..</li><li>Being a Javascript based library, React JS can be combined with other Javascript libraries to increase the functionality of the applications.</li><li>It <strong>improves the debugging speed</strong> making your developer’s life easier.</li></ul><h3>Cons of React JS</h3><ul><li>In React JS, the community support is not very strong and has less open source contributions than other frameworks like Angular JS.</li><li>Some members of the community think that React technologies are updating and accelerating so fast that there is no time to write proper instruction. To solve this, developers write their own documentation for specific tools used by them in current projects.</li><li>Developers find it difficult to integrate libraries like Reflux and Redux as React JS lacks proper documentation.</li></ul><p><strong>Companies Using ReactJS:</strong></p><p>Dropbox, Netflix, KhanAcademy, Yahoo Mail, NewYork Times</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*sTdh0bl2VxUH4ApEfPeJvw.jpeg" /></figure><h3>What is React Native?</h3><p>Two years after the 2015 ReactJS release, Facebook created React Native. While the ReactJS library is developed for creating web interfaces, React Native is a hybrid app-development framework for iOS and Android that allows you to <a href="https://differential.com/insights/sharing-code-between-android-and-ios-in-react-native/">reuse up to 95 percent</a> of code leaving the rest to designing <a href="https://facebook.github.io/react-native/docs/platform-specific-code">platform-specific interfaces</a>.</p><p>As oppose to ReactJS which is Javascript library, React Native is full Framework which compiles to native app components, permitting the user to build native mobile applications<strong> (iOS, Android, and Windows) in JavaScript</strong> which allows the user to use ReactJS for building your components, and implements ReactJS under the hood.</p><p>React Native lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components.</p><p>With React Native, you don’t build a “mobile web app”, an “HTML5 app”, or a “hybrid app”. You build a real mobile app that’s indistinguishable from an app built using Objective-C or Java. React Native uses the same fundamental UI building blocks as regular iOS and Android apps. You just put those building blocks together using JavaScript and React.<br>React Native lets you build your app faster. Instead of recompiling, you can reload your app instantly. With hot reloading, you can even run new code while retaining your application state. Give it a try — it’s a magical experience.<br>React Native combines smoothly with components written in Objective-C, Java, or Swift.</p><ul><li>The hybrid apps are much development using <strong>HTML5, CSS and JavaScript.</strong> They use the same code irrespective of the platform in which they are being executed. They are embedded within a webview or a Web App.</li><li>The native apps are developed using the language required by the target platform specifically: Objective-C and iOS Swift, Java and Kotlin Android, etc.</li><li>While ReactJS uses Virtual DOM to render browser code, React Native uses native APIs as a bridge to render components on mobile. For example, for Android components, it uses Java APIs and it invokes Objective-C API to render to iOS.</li><li>React Native doesn’t use HTML. So, if you worked with ReactJS before, you’ll have to get familiar with React Native syntax. For example, it uses &lt;Text&gt; instead of &lt;p&gt; and &lt;View&gt; instead of &lt;div&gt;.</li><li>Because React Native doesn’t use CSS, standard CSS-features like animation run with React Native special APIs.</li></ul><h3>Pros of React Native</h3><ul><li>The framework is very fast for developing mobile applications as it has a lot of built-in components and has access to npm, the largest ecosystem for packages.</li><li>It uses the uses JavaScript — fast and popular programming language</li><li>The hot reloading feature lets the developers make modifications to the application while it is running, making it easier to add new features to the user interface.</li></ul><h3>Cons of React Native</h3><ul><li>The collection of the readily made components for development are limited that create problems for developers while making simple applications.</li><li>Limited number of third party components.</li><li>It uses a library Navigator for navigating mobile applications but the new developers may not find it very smooth to navigate.</li><li>The security is low and developers need to be careful about malicious code that could damage the functionality of applications made for online banking or payment.</li></ul><p><strong>Companies Using React Native:</strong></p><p>Instagram, Facebook, Netflix, WhatsApp. Airbnb</p><h3><strong>Conclusion</strong></h3><p>Both <strong>React JS</strong> and <strong>React Native</strong> is growing in demand among developers. As React Native is built on React JS principles, the learning curve is simple. The Virtual DOM renders the browser code in React JS whereas Native uses its API to render code for mobile applications. As the community support for both frameworks is improving day by day, it will help developers in the future for building better applications.</p><p>ref:</p><p><a href="https://www.stechies.com/difference-between-reactjs-react-native/">https://www.stechies.com/difference-between-reactjs-react-native/</a></p><p><a href="https://dzone.com/articles/whats-the-difference-between-react-native-and-reac">A Look at React Native and React.js - DZone Web Dev</a></p><p><a href="https://www.altexsoft.com/blog/engineering/the-good-and-the-bad-of-reactjs-and-react-native/">https://www.altexsoft.com/blog/engineering/the-good-and-the-bad-of-reactjs-and-react-native/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e984d4d2f0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to add “Add to Home screen” to your website]]></title>
            <link>https://medium.com/@sam20gh/how-to-add-add-to-home-screen-to-your-website-4b07aee02676?source=rss-11c4990b7312------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b07aee02676</guid>
            <category><![CDATA[add-to-homescreen]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[pwa]]></category>
            <dc:creator><![CDATA[Sam Ghoreishi]]></dc:creator>
            <pubDate>Mon, 13 May 2019 15:43:40 GMT</pubDate>
            <atom:updated>2019-05-15T15:23:51.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kzk1Ob3FIOnrheDnLpb-qA.png" /><figcaption>Transfer your website to web App</figcaption></figure><p><strong>Add to Home Screen</strong>, sometimes referred to as the web app install prompt, makes it easy for users to install your Progressive Web App on their mobile or desktop device. After the user accepts the prompt, your PWA will be added to their launcher, and it will run like any other installed app but minimum requirements to have a Progressive Web App (PWA) are:</p><h3>Secure:</h3><p>A secure connection (HTTPS) over your site makes sure all traffic is as safe as a native app. A secure endpoint also allows the service worker to securely take action on the behalf of your app.</p><h3>Standard Manifest:</h3><p>The site should be controlled by a W3C manifest that determines the experience and behaviour of your PWA. This includes everything from images, to language, to the start page of your web app. your manifest file should include:</p><ul><li><a href="https://developers.google.com/web/fundamentals/web-app-manifest/#name">short_name or </a><a href="https://developers.google.com/web/fundamentals/web-app-manifest/#name">name</a></li><li><a href="https://developers.google.com/web/fundamentals/web-app-manifest/#icons">icons</a> must include a 192px and a 512px sized icons</li><li><a href="https://developers.google.com/web/fundamentals/web-app-manifest/#start-url">start_url</a></li><li><a href="https://developers.google.com/web/fundamentals/web-app-manifest/#display">display</a> must be one of: <a href="https://developers.google.com/web/fundamentals/web-app-manifest/#display-params">fullscreen</a>, <a href="https://developers.google.com/web/fundamentals/web-app-manifest/#display-params">standalone</a>, or <a href="https://developers.google.com/web/fundamentals/web-app-manifest/#display-params">minimal-ui</a></li></ul><h3>Network Independent:</h3><p>The Progressive Web App should have a mechanism (e.g. through a service worker) to help control traffic when the network isn’t there or isn’t reliable. The app should be able to work independent of network.</p><h3>Responsiveness:</h3><p>The site should be responsive on tablets &amp; mobile devices.</p><h3>Cross-Browser:</h3><p>The site should seamlessly work on multiple browsers (e.g. Chrome, Edge, Firefox and Safari).</p><h3>Deep Linking:</h3><p>Each page of the site should have a unique URL (individual pages are deep linkable via URLs e.g. to share on social media).</p><p>if you your website meets these criteria then from Chrome 31+ , add to home screen popup will open automatically which recommend users to install the webapp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*poXUmpRQcc-y6-4RgWc10g.jpeg" /><figcaption>Add to home screen native popup window</figcaption></figure><p>But what your website doesn&#39;t meet these minimum criteria? luckily there is another way of adding this option to your page. here is a short instruction:</p><h3>Step 1. Create icon Pack.</h3><h3>Step 1. Create icon Pack.</h3><p>you need to create icon pack in variety of sizes for different Smartphone sizes and tablets. I personally use <a href="https://www.favicon-generator.org/">https://www.favicon-generator.org/</a>. This is a free service that generate favicon as well as icons for Web, Android, Microsoft, and iOS (iPhone and iPad) Apps. Go this website and select:</p><p>Generate icons for Web, Android, Microsoft, and iOS (iPhone and iPad) Apps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*GrrhyVJOGmqhbzqCbCviMA.png" /></figure><p>Download the generated icon pack and place it in the root of your website. Please note there is a json file called: manifest.json which you can use to change you website name. simply change the “name” value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*iA5K2IKvKQbZ11t8nKanKg.png" /><figcaption>manigfest.json file</figcaption></figure><h3>Step 2. Add to home screen call-out</h3><p>There is an old but very useful Add to home screen call-out library available on git hub which you can use to add a popup window to your website with instruction on how to ‘add to home screen’.</p><p>find the libraty at <a href="https://github.com/cubiq/add-to-homescreen">https://github.com/cubiq/add-to-homescreen</a>. download the package and upload it to the root of your website.</p><p>I personally prefer to create a new folder called add_to_homescreen and upload all the files to this folder but remember to change the src section in the next step</p><h3>Step 2. Add link to script and css</h3><p>next step is to add the link to your index.html of your website. 1 files is for the CSS file which you need to add to &lt;head&gt; section of your website before the &lt;/head&gt; tag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*yvI3QTK5mxmMADmF7q6eSQ.png" /><figcaption>addtohomescreen.css link</figcaption></figure><p>and the second file is the js file which you can also add head section but I prefer to add it to the bottom of the index file below other JS files you may have on your website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*HaYLVbmJ5UvjeLxIeDH3Lg.png" /></figure><h3>Step 3. Call addToHomeScreen()</h3><p>immediately after you addtohomescreen.js file you need to add the below script to call the function. to to that you simply need to add below script which calls the script and also run your app in standalone mode</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*EEK3qDsPrZo0PxA8oeJMKA.png" /></figure><h3>Step 4. Add meta tag to header</h3><p>In order to run the app in full screen mode you also need to add some meta tags to head section of the index.html before &lt;/head&gt;. this script let the browser to to hide the address bar when its loaded from homescreen shortcut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*NRc3VR64L7pAbCxfR9Mp4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xKd6_5G6xo0skAmTlgy1dA.png" /><figcaption>Transfer from website to web App</figcaption></figure><p>that it if you now run open your website on your smartphone browser, a popup open with instruction on how to add the web app to home screen and if you follow the instruction and open the app from the home screen shortcut then you will see the app in full screen and it looks and feels like a native app providing its responsive.</p><h3>bonus:</h3><p>you can customise and style the popup window from addtohomescreen.css file, you can also change the splash screen colour of the app when it opens by simply changing the colour code in</p><p>&lt;meta name=”msapplication-TileColor” content=”#000000&quot;&gt; and</p><p>&lt;meta name=”theme-color” content=”#ffffff”&gt;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b07aee02676" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The SQL vs NoSQL]]></title>
            <link>https://medium.com/@sam20gh/the-sql-vs-nosql-713613cdac5c?source=rss-11c4990b7312------2</link>
            <guid isPermaLink="false">https://medium.com/p/713613cdac5c</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Sam Ghoreishi]]></dc:creator>
            <pubDate>Mon, 15 Apr 2019 08:58:45 GMT</pubDate>
            <atom:updated>2019-04-15T10:00:49.399Z</atom:updated>
            <content:encoded><![CDATA[<p>A brief introduction</p><h3>SQL or Rational database management system RDBMS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jbyYyCZqnSLjjM2HSC5vyg.png" /><figcaption>MySQL database table viewed using phpMyAdmin</figcaption></figure><p>Rational Databases were introduced in 1970s to to deal with first wave of data storage applications through a standard data modelling and query language (Structured Query Language, or SQL).</p><p>RDBMS organises data into one or more tables of columns and rows with a unique key identifying the each row.</p><p>A column is basically a property of the table.</p><p>For example, a table could have 3 columns: ID, First Name, Last Name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ObYq9oKtmByGkth4dUQVRQ.png" /><figcaption>Designer view of a typical MySQL database</figcaption></figure><blockquote>SQL Database tables have Schema which is basically a blueprint and defines how the data is organised structure the database and prevent invalid datas to be entered into database.</blockquote><p>Rows in a table can be linked to rows in other tables by adding a column( <a href="https://en.wikipedia.org/wiki/Foreign_key">foreign keys</a>) for the unique key of the linked row.</p><p>Some of the well know SQL databases are MySQL, Postgres, Microsoft SQL Server and Oracle Database.</p><p>Lets imagine we have a table with 3 columns of “first_name”, “last_name” and “user_name ” and I need to enter “email_address” into the data, Schema prevent this operation and I get error message as there is no column called “email_address” so I need to create this column before I am able to enter. This ALTER statement to change the table structure adds the constraint stating it can’t be Null. To fix this issue we need to add the column without the NOT NULL constraint and manually enter the “email_address” value for all the existing rows and then ALTER the table to add the NOT NULL constraint into the table.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FE2USislQIlsfm%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fai-kentucky-calls-E2USislQIlsfm&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FE2USislQIlsfm%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="281" frameborder="0" scrolling="no"><a href="https://medium.com/media/01df97a577a2762842a55b32d6b0bcd7/href">https://medium.com/media/01df97a577a2762842a55b32d6b0bcd7/href</a></iframe><p>If you are developing a new App you may not know exactly what is your database Schema or when you complete a new features, the schema of your database often needs to be changed so you can imagine how hard it would be to constantly go back to database and Alter the tables and Schema.</p><p>That where NOSQL databases comes into play</p><h3>What is NOSQL database?</h3><blockquote>A <strong>NOSQL</strong> or as it was originally referred to, “non <a href="https://en.wikipedia.org/wiki/SQL">SQL</a>” or “non relational” <a href="https://en.wikipedia.org/wiki/Database">database</a> provides a mechanism for <a href="https://en.wikipedia.org/wiki/Computer_data_storage">storage</a> and <a href="https://en.wikipedia.org/wiki/Data_retrieval">retrieval</a> of data that is modelled in means other than the tabular relations used in <a href="https://en.wikipedia.org/wiki/Relational_database">relational databases</a>.</blockquote><p>NoSQL database is basically a huge JSON file hosted in the cloud. it’s just a combination of key/value pairs and has no schema for the database, no tables, no columns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*X9RW1QJ8jNyuTmJk6PMZSg.png" /><figcaption>How user table in NOSQL would look like</figcaption></figure><p>NOSQL Databases are Schema_less databases which basically means they have no structure which bring lots of flexibilities.</p><p>Going back to our email_address example, we can simply add “email_address” value to one of our entries without the need to change the schema of the the database or changing the value of the current entries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*TwbCackFWpt8atATsDRuQA.png" /></figure><p>This is really great for flexibility but doesn’t really help us ensure data integrity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*QkhidQdGVgBTwRAN_RInsg.png" /></figure><p>NOSQL databases such as MangoDB or Google’s Firebase provide security roles to validate data and you can define the child entry value to to be, String, Number etc. This is similar to constraint is SQL.</p><p>The main difference between SQL database and NOSQL database is the flexibility and integrity, SQL has lots of integrity but NOSQL database has lots of flexibility and the integrity of the database are left to developer to deal with.</p><p><strong>There are other advantages on using NOSQL database</strong></p><p>since rational databases were designed in 70s and never designed to cope with current volume of datas there are restriction on performance for example:</p><ul><li><strong>Elastic scalability:</strong></li></ul><p>SQL databases are vertically scalable whereas the NoSQL databases are horizontally scalable. SQL databases are scaled by increasing the resources of the hardware by improving the CPU, RAM, SSD, etc, on a single server. A database administrator can simply add more commodity servers or cloud instances. The database automatically spreads data across servers as necessary.</p><ul><li><strong>Big data applications:</strong></li></ul><p>NoSQL database fits better for the hierarchical data storage as it follows the key-value pair way of storing data similar to JSON data. NoSQL database are highly preferred for large data set.</p><ul><li><strong>Database administration:</strong></li></ul><p>SQL databases require administrators to design, manage and maintain the system Most NoSQL databases also support automatic replication, meaning that you get high availability and disaster recovery without involving a team to manage these tasks.</p><h3>Closing thoughts:</h3><p>NOSQL databases are fairly new comparing to SQL databases which have been around since 70s so there are still many obstacles which must be overcome before they can be fully accepted and used by many more well stablished organisations. Many of the developers using the system are still in the learning stage and therefore the community support is also limited.</p><p>Any organisation or developer willing to implement NoSQL solutions needs to proceed with caution, bearing in mind the above limitations but since NOSQL was designed with the demands of the Web 2.0 modern-day web applications in mind its worth learning implementing in small projects.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F57WAdFQc3tba3OkCFZ%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fnbc-wow-omg-57WAdFQc3tba3OkCFZ&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F57WAdFQc3tba3OkCFZ%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="245" frameborder="0" scrolling="no"><a href="https://medium.com/media/739f5ea2a5863e7dd6dd087f2e18f956/href">https://medium.com/media/739f5ea2a5863e7dd6dd087f2e18f956/href</a></iframe><p>ref:</p><ul><li><a href="https://www.mongodb.com/nosql-inline">What is NoSQL?</a></li><li><a href="https://www.mongodb.com/nosql-explained">What Is NoSQL? NoSQL Databases Explained</a></li><li><a href="https://gonehybrid.com/firebase-database-best-practices/">Jumping from SQL to Firebase NoSQL Database</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=713613cdac5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>