<?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 Naguib (Nick) ihab on Medium]]></title>
        <description><![CDATA[Stories by Naguib (Nick) ihab on Medium]]></description>
        <link>https://medium.com/@naguibihab?source=rss-288fc6b41d91------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g_LU5awxktOkefIuBR35sg.jpeg</url>
            <title>Stories by Naguib (Nick) ihab on Medium</title>
            <link>https://medium.com/@naguibihab?source=rss-288fc6b41d91------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 13:36:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@naguibihab/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[Eventual Consistency: What, How, and Why]]></title>
            <link>https://levelup.gitconnected.com/eventual-consistency-what-how-and-why-50c942472a0c?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/50c942472a0c</guid>
            <category><![CDATA[eventual-consistency]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Mon, 06 Jan 2020 16:37:13 GMT</pubDate>
            <atom:updated>2020-01-06T18:06:37.077Z</atom:updated>
            <content:encoded><![CDATA[<p>There once was an API called Fred. Fred would often receive PUT requests from a client and inserts the data into the database and replies back with the id.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unKjxNk6gmswjsb-PwkMuA.png" /></figure><p>Fred’s life was simple until a new data auditing service started asking for any data that Fred receives to go to it as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tf35vajugHABylhMHTUSBA.png" /></figure><p>This creates two distinct problems.</p><h4>Problem #1</h4><p>Imagine inserting the data into the database took around <strong>n</strong> milliseconds, which meant that in the first scenario the client making the request would take <strong>n</strong> to receive the id and finish the request. Let’s also assume that the auditing service requesting the data takes around <strong>m </strong>milliseconds to consume it, so after adding that service the client making the request now takes <strong>n+m</strong> to finish the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7vbVRZFfQIAq5gk7ZlK83g.png" /></figure><p>Since we’re building architecture that scales, this time will keep increasing as we add more services.</p><h4>Problem #2</h4><p>It’s a fact of life that sometimes requests fail for any number of reasons: the client is not ready, validation failed, too many requests..etc..etc.. So what would happen if one of the requests fail, i.e. if the data was inserted into the database but didn’t get through to the auditing service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zrUvDWzUA6Z9hUcLyBfIpg.png" /></figure><p>We can’t tell the client that the request failed because it kind of didn’t and if we try to re-insert the data, the database would complain (we can get around that by upserting but we’d be bending a business rule)</p><p>One solution to both problems is <strong>eventual consistency</strong>, but to understand that we need to first cover <strong>CAP</strong></p><h3>The CAP principle</h3><p><strong>CAP</strong> stands for consistency, availability, and partition resistance. The CAP Principle states that it is not possible to build a distributed system that guarantees consistency, availability, and resistance to partitioning. Anyone or two can be achieved but not all three simultaneously.</p><blockquote>Consistency means that all nodes see the same data at the same time.</blockquote><blockquote>Availability is a guarantee that every request receives a response about whether it was successful or failed.</blockquote><blockquote>Partition tolerance means the system continues to operate despite arbitrary message loss or failure of part of the system.</blockquote><p><em>From the book “Practice of Cloud System Administration, The: DevOps and SRE Practices for Web Services, Volume 2” By Thomas A. Limoncelli, Strata R. Chalup, Christina J. Hogan</em></p><p>Eventual consistency (EC), is able to achieve Availability and Partition tolerance at the expense of Consistency, what that means is that we can’t guarantee that all of the recipients of the data will see it at the exact same time but we do guarantee that we’ll always able to have the service available because we’re tolerant to any dependencies failing.</p><p>We guarantee:<br>- <strong>A</strong>vailability<br>- <strong>P</strong>artitioning tolerance (AKA failing dependencies)<br>We don’t guarantee:<br>- <strong>C</strong>onsistency between data stores</p><h3>Eventual consistency explained with coffee</h3><p>Imagine you go to a coffee place and order a latte and a scone. The cashier takes your order, you pay and then you wait for your coffee but you take your scone immediately.</p><p>As you move to the next window waiting to pick up your coffee you ponder on what just happened:</p><ul><li>The cashier was available to take your order and gave you a receipt of your transaction</li><li>You don’t know if the espresso machine was working at the time of ordering, but it doesn’t affect your order</li><li>You have a guarantee that you will <em>eventually</em> get your coffee, but you don’t know the exact time</li></ul><p>Your latte is now ready, you take it and enjoy it with the scone.</p><p>We’ve covered the Why, now let’s cover what it is and how to implement it.</p><h3>The What?</h3><p>EC is delivering the data to a message queue that takes the message and delivers it to whoever is listening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-3AtJM87zeF53AbijADVmA.png" /></figure><p>Some messaging queues push to the receivers, while others just hold the data and the receivers keep a record of which message they are at.</p><p>However, the main feature in most messaging queues is that if the receiver does not consume the message for any reason, the message queue will keep retrying to send the message or the receiver will keep retrying to consume it.</p><h3>The How?</h3><p>Using our previous example, Fred the API, we can implement EC in two ways:</p><h4>Way #1 database first</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8SaUQHDL6w2rAQ-cvlB1Q.png" /></figure><p>The request is limited to inserting the data in the database; after it’s inserted Fred tells his client that the data is in and the request ends there but the data’s journey doesn’t. The database triggers the MQ and sends it the data that it has just received, the auditing service picks up the data and consumes it without affecting the reliability or the time it takes to complete the request.</p><p>In that method, we guarantee that the data is in the database by the time the request ends but we can’t guarantee that it is in the messaging queue.</p><h4>Way #2 messaging queue first</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UPHKVdS-wAU7TI9fU7IQng.png" /></figure><p>In that method, we guarantee that the data is in the messaging queue but not in the database. The API is also responsible for creating the identifier for the new data.</p><p>You’d use that method if having your data in the messaging queue is more important than having it in the database.</p><h3>A real-life example of eventual consistency</h3><p>In My Guinea Pigs app, we split up the pet’s profile data on different DynamoDb tables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HLH3rCRwBIAUS59VqtArKg.png" /></figure><p>The <em>PetProfile</em> table contains a summary of that profile but not the whole data, i.e. the name, age, gender and some of the logs.</p><p>The <em>Pets</em> table contains fewer data about the profile but all of names of that user’s pets.</p><p>If the client requests to see all the pets that the user has we use the <em>Pets</em> table, if the client requests to see the summary data about a particular pet then we query the <em>PetProfile</em> table, and if the client needs to update the age of the pet then we go to the table that has this data which in that case the <em>PetProfile</em>.</p><p>However, if the client needs to add a new profile, that data needs to be stored in both tables and even though we can batch update both tables at the same time in a single transaction we don’t <em>have</em> to because the <em>Pets</em> table doesn’t need to know about that information as soon as it is available but will eventually need to know about it so we went with EC.</p><h4>Eventual Consistency in DynamoDb</h4><p>DynamoDb offers a feature called Streams, which allowed us to trigger a lambda function that would put data in another table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1mcDyIlsMcYdiDgnY7IDA.png" /></figure><p>And the same goes for the rest of the tables, at some we have the stream triggering multiple functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LPRzbIkHIsKLSWaO6bd2Q.png" /></figure><h4>What is wrong with this picture?</h4><p>As the CAP principle explains, we can guarantee that the service will be available and that the data will be inserted in at least one of the tables, but we can’t guarantee that all the tables will consistently have the same data at any point in time. In our case, that was an acceptable scenario, and in a healthy system, the client wouldn’t notice because the data transfer happens nearly instantaneously.</p><h4>Further readings</h4><p>I hope the article explained in a nutshell what eventual consistency is and how is it used, but I do encourage you to do further reading before deciding EC is for you:</p><ul><li><a href="https://martinfowler.com/articles/microservice-trade-offs.html">Microservice Trade-Offs</a></li><li><a href="https://programmaticponderings.com/2018/06/17/using-eventual-consistency-%E2%80%A8and-spring-for-kafka-to-manage-a-distributed-data-model-part-1/">Using Eventual Consistency and Spring for Kafka to Manage a Distributed Data Model: Part 1</a></li><li><a href="https://pradeeploganathan.com/patterns/transactional-outbox-pattern/">Transactional Outbox Pattern - Pradeep Loganathan</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50c942472a0c" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/eventual-consistency-what-how-and-why-50c942472a0c">Eventual Consistency: What, How, and Why</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to merge NoSQL and SQL using AWS Glue]]></title>
            <link>https://levelup.gitconnected.com/how-to-merge-nosql-and-sql-using-aws-glue-ec83c6f02137?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec83c6f02137</guid>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws-glue]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Sun, 05 Jan 2020 20:40:01 GMT</pubDate>
            <atom:updated>2020-01-05T20:40:01.749Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to report on data from both NoSQL and SQL at the same time without going crazy</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgURA_mxKSXDr31dwT5sOA.jpeg" /></figure><p>One of my projects involved creating a platform that generated reports for a food delivery company. It is running on microservices architecture where each service had its own database. Most had a MySQL database but some that were driven by realtime events (i.e. where is the driver) had a NoSQL Mongo databases and all of that lived on AWS.</p><p>The project is to create an autonomous platform that would periodically create reports that a frontend UI can digest and show the business people some nice looking graphs. So the end result needed to look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*sdifpMKGQOi8aF_ykxANew.png" /></figure><p>One of such reports is on how accurate the ETA of the system is compared to how long does the driver actually takes to get there. The ETA data and the data used to calculate it (traffic conditions, distance, and time) is stored in a MySQL database, and the actual time and route that the driver took is stored in a Mongo database.</p><h3>First step: getting the data</h3><p>Let’s imagine that our data lives in two documents in Mongo and two tables in MySQL. The first problem to solve is how to get the data we need to make that report and only that data. After all, these are humungous databases and the less we can read, the faster those queries would be.</p><p>We have two options to get the data:</p><p><strong>Option A:</strong> we can set up triggers to create views as the data comes in, or spit out the data in another Mongo and MySQL databases. The issue with that option though is that even if it doesn’t add any cost to writing in the database, it makes it the responsibility of the service that handles the database to maintain those triggers, and therefore the responsibility falls to the teams that handle these services. So, given that the business wants the reporting to operate independently from the other teams, that option is <strong>kaput</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3YqWp75cCB2iIEVLpwyGg.png" /></figure><p><strong>Option B:</strong> If we can’t have continues events emitting from the data sources we’re after, then we need to read them ourselves. We can set up some external service that has read access to these databases and are able to run queries to get the data that the report needs. That service would need to use certain indexes to make the reading is more efficient and the teams managing the main services would just need to create the indexes in their databases — a much easier thing to ask for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oP-xGcgvgPe7qA0zZoqd2A.png" /></figure><p>We decide that this read service is called <strong>Bob</strong>, and we also decide to build Bob on AWS Lambda functions and have it export the results of the queries as CSV files in an S3 bucket since Bob will not be running continuously and might run once a day/week/month. This gives the business the flexibility to decide when to run Bob without worrying about having to pay for Bob while Bob is not doing anything.</p><p><strong>Bob</strong> is now made of four different lambda functions, one function for each table/document that we need to read from Mysql/Mongo. Each function connects to the database and runs a query when triggered to read the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rmaGpJV13Ag9wmq9ddQ5nw.png" /></figure><p>Now we have the data we need to merge it together and make one big blob that the reporting service can read and report on.</p><h3>Second step: merging the data</h3><p>Here comes the tricky part. We have data from Mongo that is represented in nested objects and data from MySQL that is all flat</p><pre>// NoSQL</pre><pre>{</pre><pre>tripId: abc,</pre><pre>timeFrom: 123123123,</pre><pre>timeTo: 123123123,</pre><pre>  travelPath: [</pre><pre>    {</pre><pre>      lat: 123123123A</pre><pre>      lng: 123123123B</pre><pre>    },</pre><pre>    {</pre><pre>      lat: 123123123C,</pre><pre>      lng: 123123123D</pre><pre>    },</pre><pre>    {</pre><pre>      lat: 123123123E,</pre><pre>      lng: 123123123F</pre><pre>    }</pre><pre>  ]</pre><pre>}</pre><pre>// SQL</pre><pre>{</pre><pre>  tripId: abc,</pre><pre>  driver: Mr X,</pre><pre>  deliveringFrom: Tekehashi Store</pre><pre>}</pre><p>To merge them together we need to flatten out the Mongo data first by breaking down the object’s nested objects and putting them all in one line.</p><p>From the above to:</p><pre>// NoSQL<br>{</pre><pre>  tripId: abc,</pre><pre>  timeFrom: 123123123,</pre><pre>  timeTo: 123123123,</pre><pre>  lat: 123123123A,</pre><pre>  lng: 123123123B</pre><pre>},</pre><pre>{</pre><pre>  tripId: abc,</pre><pre>  timeFrom: 123123123,</pre><pre>  timeTo: 123123123,</pre><pre>  lat: 123123123C,</pre><pre>  lng: 123123123D</pre><pre>},</pre><pre>{</pre><pre>  tripId: abc,</pre><pre>  timeFrom: 123123123,</pre><pre>  timeTo: 123123123,</pre><pre>  lat: 123123123E,</pre><pre>  lng: 123123123F</pre><pre>}</pre><p>We then use the tripId to map the data from MySQL to Mongo and put them in the same row and store them in a new data warehouse. To do all of that, we use AWS Glue service.</p><p>AWS Glue is an ETL, <em>Extract-Transform -Load,</em> service that is used to “glue” data together from different sources.</p><p>We write a Python script on AWS Glue that does the mapping based on the tripId and lets Glue export the end result in AWS Redshift, a data warehouse, where the reporting magic will happen. Let’s call that part <strong>Patricia</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BFhd6g2c6W9_AKcG1jPKg.png" /></figure><p>To get Bob to talk to Patricia, Patricia reads the CSV files from the S3 bucket that Bob exports and maps them.</p><h3><strong>Third step: orchestration</strong></h3><p>Now that everything is in place this should work. However, Bob and Patricia are different services that do not communicate. The S3 bucket holds the data that Bob exports and Patricia needs. However, we need another service to tell Bob to start, wait until Bob finishes and then tell Patricia that the data is ready, wait until Patricia finishes, and then raise a flag to let everyone know that the data querying and merging is done and is ready to be reported on.</p><p>That service needs to know when the pipeline (Bob and Patricia) has started running and when it has finished so that it would prevent data from overlapping and would tell Bob to start querying new data that we know was not collected.</p><p>i.e.</p><ol><li>Bob starts querying data from timestampA up until now which his timestampB</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYQqnJpm2cgN1qr7_WB0bg.png" /></figure><p>2. timestampB is saved somewhere for later reference (So we’d know where Bob is up to)</p><p>3. Later, someone asks for another report. The new orchestration service would ask Bob to start querying from timestampB up until now timestampC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkwlXhmJSlt-x2d6tg9yPg.png" /></figure><p>To get Bob working, all we need to do is to trigger each lambda function that Bob has or a one “kickoff” function. Once all of Bob’s functions are finished and have exported their data to S3 we can now trigger Patricia’s AWS Glue and let that run. To do all of that we create a lambda function and call it <strong>Uncle Frank</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*v5cIv9A7nyqrZRCzysw9CQ.png" /></figure><p>In order to not keep Frank waiting until all of Bob’s lambda functions have finished, we have Bob invoke Frank whenever a query or a function has finished its job, we create another lambda function for Frank that saves every “I’m Done!” call in a lightweight Dynamo database with a timestamp and checks if all the jobs are done, once all the jobs are done Frank invokes Patricia.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9U6dQ59TPSPg0mXd7R0fA.png" /></figure><p>We can replace Frank’s call to Patricia with a trigger on S3 <strong>IF</strong> we had only one file going into S3, but because we have four different files that can be uploaded in different orders, we need an external service to monitor and action once all four are ready to be digested</p><p>Frank’s database would look something like this:</p><pre>{</pre><pre>  reportType: “ETA”,</pre><pre>  jobTimestamp: &lt;timestamp&gt;</pre><pre>  BobMySQL:</pre><pre>    {</pre><pre>      A: &lt;timestamp&gt;,</pre><pre>      B: null</pre><pre>    }</pre><pre>  BobMongo:</pre><pre>    {</pre><pre>      A: &lt;timestamp&gt;</pre><pre>      B: &lt;timestamp&gt;</pre><pre>    }</pre><pre>}</pre><p>Notice how in this example that BobMysql.B doesn’t have a timestamp. Therefore it’s safe to assume that it hasn’t finished these jobs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDRXHDgh15YEvJftQNjy2Q.png" /></figure><p>Every time Bob invokes Frank, Frank checks if all the tables have finished and triggers Patricia.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P3qpr3rIAmfDciDpE6WZJA.png" /></figure><p>We implement the same logic for Patricia and have Frank store if and when Patricia finished the glue job. We do that so we’d be able to tell any other service that is waiting on the report that it is finished. We use an SNS to communicate that to whoever is listening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dT0RfXE6Zi8NYSsPa74rwQ.png" /></figure><p>And finally, we create a time-based cloud watch trigger for Frank, so it can run the report every day at midnight. We also create an SSM parameter store for Frank to keep the timestamp of the last report ran so that when Frank runs, it would pass that timestamp to Bob, and Bob would query all the data based on that timestamp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VG1KCmTycqdEmWox4c0YAA.png" /></figure><h3><strong>Fourth step: Scaling</strong></h3><p>The fourth and final step is to replicate that process for every report we have. We do that by creating another set of functions for Bob (i.e. Sabrina) and another Python script for Patricia, the rest is reusable while keeping in mind that Frank needs to know about every report and the queries involved in getting that report so that it’d know when to invoke Patricia’s particular glue function.</p><p>So suppose we have another report that combines three MySQL tables and one Mongo table, our flow would look something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uko_4QvjWHGLekLrMtsvxA.png" /></figure><p>In that model, we have another service called Sabrina that’s doing three MySQL queries and a single Mongo query, Patricia has another glue mapping script that throws the end result in the same data warehouse as the first script.</p><p>Frank’s architecture is still the same, but the orchestration function is aware that there is a service called Bob that has 2 SQL and 2 NoSQL jobs before it’s done and a service called Sabrina that has 3 SQL and 1 NoSQL jobs before it’s done. It’s also aware of the appropriate glue jobs for each service/report.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec83c6f02137" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/how-to-merge-nosql-and-sql-using-aws-glue-ec83c6f02137">How to merge NoSQL and SQL using AWS Glue</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[If it works it works — cowboy code in startups]]></title>
            <link>https://medium.com/upilio/if-it-works-it-works-cowboy-code-in-startups-6bbdd81ac866?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bbdd81ac866</guid>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Sun, 13 Oct 2019 12:17:54 GMT</pubDate>
            <atom:updated>2019-10-13T12:17:54.700Z</atom:updated>
            <content:encoded><![CDATA[<h3>If it works it works — cowboy code in startups</h3><p>Being a developer, it’s hard to resist finding a way to do things better, a better process, a better design pattern, better networking..etc but what I often forget is that a startup is often not an organised company.</p><p>As a startup, you try and take every shortcut to get things done, without sacrificing any security or efficiency in the end result, but the code itself doesn’t have to be simple. Almost every startup I have joined have their legacy code, things that barely work and need to be rewritten, old outdated technologies that need to replaced by new ones, there is a reason that every startup has that: They were focused on <strong>making it work</strong></p><p>A couple of months ago I decided it’d be good for my app <a href="https://medium.com/upilio/how-the-my-guinea-pigs-app-started-5e1e6eed48e9">My Guinea Pigs</a> to implement <a href="https://microservices.io/">microservices</a> in our backend, microservices is an architectural pattern that allows every service in your backend to be modular, in other words, every feature is completely isolated which makes it easy to copy, delete, replace and add new services.</p><p>That meant that we needed to rewrite our entire backend (a working one at that) and rebuild the database and migrate all of our users and data from MySQL to DynamoDB. I got my team excited and convinced and we went ahead with it.</p><p><em>Techy alert: The next part of this article is a bit technical</em></p><p>First, we had to plan out everything, thinking this is a simple architecture change and the code itself won’t need much of a rewrite other than connecting to a different database and have a different way to get the data. Claiming that moving from a relational database to a NoSQL database is not so simple is an understatement, it was extremely complex that we had to rethink of how our data flow is going to be like and what kind of data do we need at each stage.</p><p>Mind you most of our services had more than one DynamoDB database because it caters for more than a single model, i.e. we have a pet profile feature where users add in the details of their pet along with logs of their weight; our pet profile service had one database to contain the profile itself but we didn’t want to clutter that database with the weight data, mainly because one view in the mobile app does not need to see all the weight log at the same time but there’s another view that does, so instead of dumping all the data into one great object we created a second database to contain the weight data, so our service looked a bit like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7exhFnQhJUgEvB2M6i9TvQ.png" /></figure><p>Now there was the problem of making sure that all databases are consistent, with duplication of data (which is sometimes necessary in a microservices architecture) we needed to have one of the databases to act as a source of truth and move the data over to the other databases, hence we needed the databases to be event-driven and look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzJ0BKU9LtlfXbz0imjohw.png" /></figure><p>Luckily for us, DynamoDB has a feature called <a href="https://aws.amazon.com/blogs/database/dynamodb-streams-use-cases-and-design-patterns/">datastream</a> which is basically a script that triggers once the database receives a create/edit/delete action. Using that feature, our databases now became event-driven within each service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EperEsS0Hyn2TsBWTTHFcQ.png" /></figure><p><em>The techy part is over, back to the fun stuff</em></p><p>I underestimated the amount of work needed for that rewrite, and even though the rewrite and the new architecture is justifiable by being a better architecture it was a process that took us weeks to do and by the end of it, we all agreed that it wasn’t necessary, at least <strong>it wasn’t necessary right now.</strong></p><p>The new microservices architecture will have its perks, absolutely! it will allow us to build things quicker and reuse more code and it will pay off in the long run but we could have used these few weeks to build badly needed features first, then do this rewrite later on. This is one of the times where I jumped the gun and got my developer side in me excited about getting rid of the old architecture and building a new one without paying too much attention to the business needs.</p><p>A good architect would know how to improve the architecture and improve its effectiveness, efficiency and all those nice words that give management the jiggles but a better and wise architect would know when to do so; picking the right time is as important as the change itself and keeping the business goals above having a good architecture, most times the two would align, after all the business can’t operate well without a solid infrastructure but when the business needs don’t align with the architecture’s timeline then biting the bullet and meeting those needs with the bad code/network/architecture/process remains the more important task.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bbdd81ac866" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upilio/if-it-works-it-works-cowboy-code-in-startups-6bbdd81ac866">If it works it works — cowboy code in startups</a> was originally published in <a href="https://medium.com/upilio">Upilio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How My Guinea Pigs App Started — Part 2]]></title>
            <link>https://medium.com/upilio/how-my-guinea-pigs-app-started-part-2-eb1ecf553da9?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb1ecf553da9</guid>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Sun, 13 Oct 2019 12:00:45 GMT</pubDate>
            <atom:updated>2019-10-29T08:29:35.829Z</atom:updated>
            <content:encoded><![CDATA[<h3>How the “My Guinea Pigs” app started — Part 2</h3><p>It’s August 2019, exactly a year since I started fiddling with an idea for an application for guinea pig owners, something that I’ve been wanting to do for a while but did not seem like a smart investment at the time. After all, at the time I had no idea if this was going to work, but spending $400 bucks just to put my mind at ease and answer the question “Does anyone even want this?” seemed like a good idea.</p><p>12 months later, we now have over 14,000 registered users, 5000+ monthly active users, and are making a decent sum every month.</p><p>Here’s how we got from this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2BsFqzHbsH02MRfJZ4Adeg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LlZNhE0Vm-f4dVPCMPB_iQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHDWr6evpoBX9FCKNc905Q.png" /></figure><p>to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ddTFFmcYHfkNKHJDA4Z_eA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQSurzfn0suzo2P_dNN62Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*TnBDLcS6v_S9Lsmk_7pB0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*XOhp5r74tbScqGOMlhtmKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*k95sofv1s7EQu-cqoXLuLw.png" /><figcaption>My Guinea Pigs App Screenshots &amp; Reports</figcaption></figure><p>and the lessons we learned along the way.</p><h3>TL;DR Here’s what this article will cover:</h3><ul><li>In <a href="https://medium.com/upilio/how-the-my-guinea-pigs-app-started-5e1e6eed48e9">my last article</a>, I mentioned that we had a few 1-star ratings that complaining about our in-app payments and how we made <a href="https://en.wikipedia.org/wiki/Microtransaction">microtransactions</a> in the app. In this article, I’ll talk about how we <strong>changed our business model</strong> and what effect this had on us</li><li>How we <strong>planned our roadmap</strong> and had a long timeline that told us what to expect in 6 months and when there will be gaps in the business</li><li>How we <strong>implemented a grunt fund</strong> an employee equity model rather than getting an investor</li><li>The “paper” work and third parties that you <strong>need to be aware of</strong> and keep an eye on</li></ul><h3>Lesson #1: The market is a brutal beast</h3><p>In January 2019 we launched our second major update which introduced a different payment model: Freemium which is offering a free version of the app with an option to pay and upgrade to a premium version. It wasn’t an easy decision to choose the freemium model for one main reason: It’s not scalable, once the user makes a purchase then they have converted to a premium user and is no longer contributing to the ongoing costs of maintaining a server or developing the app. Simply put, <strong>cloud-based software does not survive on one-off payments</strong>.</p><p>Yet when we asked people what they didn’t like about the app (and with the 1-star reviews we got from the previous versions) it was mainly the in-app purchases that annoyed people the most so we at this point we had two options: either we offer a subscription-based model or we offer a one-off fee, which, based on surveys, was more appealing to our users as it’s similar to what other pet apps do and other apps, in general, that doesn’t offer ongoing content (think of Netflix, youtube red..etc) but is more of a tool instead.</p><p>So going against my better judgement we went with the freemium model; but rather than putting whole functionality behind the premium version we made the whole app free but certain features are locked:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*MDrJhdF4qA7QnjTSuTs8Fw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*NbBBhFQKor9dibwQi_QajQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*jEL-4VmkKrWeelgtfqldgQ.jpeg" /></figure><p>however, knowing that we can’t survive on this pricing model for very long so we started looking into a plan B, finding different ways of generating more recurring revenue.</p><p><strong>Our ratings changed when we LISTENED to the market<br></strong>The market is a brutal beast, in our beta version the app contained the food guinea pigs can eat and a small collection of articles, we had good reviews and our users were happy; Once we introduced other features and locked them behind a pay per use plan our ratings went down. <strong>In a way not offering these features at all was better than asking for people to pay for them</strong>, however, the market is also a fair teacher, if you listen to her, she will guide you to the product that you want people to want. At first, I was using the allegedly famous saying by Henry Ford “If I had asked people what they wanted, they would have said faster horses” as a guide, and while this is true in mainly the very early stage of the app it doesn’t work nine times out of ten afterwards. And what did I learn? Instead of telling the market what it wants, listen to what it’s asking for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nwCWThsfSFIgMmvdiRzRNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEbty30CYl32ScRoAz4ybQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*baqkgfXRFtorjiEIqxVk6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2fh7WPUXsPr-P0NwqctEUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1eM53F36v_9AUOZnkq5VMg.png" /></figure><h3>Lesson #2: Roadmaps &amp; OKRs</h3><p>This might seem obvious but what’s more important than ratings, good metrics, and a solid business plan is being self-sufficient. Having that sense of security allows for mistakes, and with some tolerance to mistakes in your startup you’re able to take more risks, try things that may succeed well, or completely fail, you can’t do the same if you have a limited juice in the bank.</p><p>When we started making regular revenue (almost the same number every month) we started budgeting our tasks and spreading them out so that we’d be able to cover our expenses with the money coming in, so we had to get <em>wizardy</em> with our planning.</p><p>Firstly we made a list of the short term targets we want to achieve:</p><ul><li>We want to build a social platform for pet owners to interact and communicate</li><li>We want our users to buy safe trusted vet-approved products for their guinea pigs</li><li>We want to expand into other markets i.e. Rabbits, Ferrets and Hamsters</li><li>As a side effect of achieving these goals, we should be able to sustain our company financially</li></ul><p>Secondly, we asked ourselves what do we need to build to achieve these targets, I am not going to get into the details of what we’re building because you probably are not interested in that but you’re interested in how we’re doing it, so let’s just say that we had this list:</p><ol><li>To build a social media feature we need to build out: 1A and 1B in the app</li><li>To have vet-approved products in the app we need to: do 2A and build 2B</li><li>To expand into other markets we need to do: 3A and 3B</li></ol><p>At that point, it seemed enough for us to know what needs to be done so we created this rough roadmap that indicates what is happening now, what will happen later and so on. We divided our timeline into now; things we’re currently working on, soon; things we’re going to work on this or in the next quarter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HPlzo77p-RnBl9wpnRdLRw.png" /></figure><p>But the problem with that was it wasn’t very detailed, yes it did give us a clear destination of where we want to go but it didn’t really tell us how we’d get there and when, so we had to go deeper.</p><p>Thirdly we broke down each of those (1A — 3B) into small tasks, each with an assignee and a dependency (i.e. in order to do 2B we had to have 2A in place first) and we estimated how long each task would take to do and we ended up with a nice looking google sheet of all the tasks we needed to do</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFnYDHlqOIAKommbXZEvHQ.png" /></figure><p>And finally we created a roadmap out of that google sheet and ordered the tasks in a way so that we’d have no gaps in our work week, i.e., person, X is not waiting on person Y to finish 2A to be able to do 2B instead while 2A is being done person X is working on 3A. Eventually, we ended up with an even nicer looking roadmap</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FGEK5u5wgX6cWlq70Uu5qA.png" /></figure><p>Finally, with this plan in mind, and with some money in the reserve in case we ran into any unexpected bills, we set our speed according to our budget and kicked off.</p><h3>Lesson #3 The best endorsement you can get is from your own employees</h3><p>At some point in the last year I’ve hit a roadblock, I have just spent way too much money on this “idea”, either I’d call it quits and let the application generate enough passive income to develop another block of features or I’d start looking for investors, as I was seeking the latter option and preparing a financial roadmap, business plan, all the works to start presenting to investors in 2019 one of my team mates told me that she’d be interested in investing her time in exchange for equity, I remembered a book I read a few years back when I was in another venture about a fair way to split equity between founders and how the author talked about having this dynamic equity equation that allows equity to keep changing and forming and he called it “Slicing Pie” where each individual is contributing to the pie adding “ingredients” (aka time &amp; money) and based on how much their market value is whatever contributions they provided gets compared against the contributions that are provided by the other “chefs” and bob’s your uncle you have a fair equity split that is based on what you have provided. I’d recommend reading <a href="https://slicingpie.com/learn-slicing-pie-model/">that book by Mike Moyer</a> even if you’re not in an active partnership.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/0*3swuKXWS3aTl9mU_.png" /></figure><p>Back to the team member who offered to invest her time, I gave myself a few weeks to think about it and finally decided to go for it rather than seeking funding, my reasons were twofold:</p><p>1. I have never worked with investors before, I never sought investment for a company before, and I don’t like using someone else’s money but I have worked with developers before, I have built projects using overseas teams and I know what interests them and what doesn’t, I know that a developer would rather work on a small project they’re given total freedom in and figure out the solutions themselves than a large project where they’re being told what to do. I know how a developer’s mind works but I don’t know how an investor’s mind does.</p><p>2. The second and more important is that this team, including the team member I have mentioned, have been with me from the start if there’s anyone I’d like to share this with it’d be the working hands that helped me build this. I know firsthand what’s it like to be working on something that’s yours, something that you sacrifice for because you believe in. Call me cheesy but I’d rather have employees that believe and own the business over employees who at the end of the day are doing this to make a buck, it’s that passion that an average working person would be willing to give up their valuable time for that would outweigh the investor’s money</p><p>The point I want to make is that if the people who are working on your product first hand believe in it enough to be willing to invest in it then you’re on the right track and <strong>you’re letting the work do the talking</strong>, I didn’t do a single pitch to any of my team members because they didn’t need convincing.</p><p>If I made it sound all fun and games it isn’t, we have contracts in place, a roadmap of where we want to be and how to get there, a realistic financial plan and an exit point where we’d stop investing our time for equity and start harvesting the rewards.</p><h3>Lesson #4 “Paper” work</h3><p>Now I’ll admit, that I have a pretty bad eye for noticing small details. When we started the app idea I didn’t have the domain upilio.io, so I just hosted the API and website on whatever domain I had at the time and didn’t think much of it, when I registered upilio.io a few months later I stopped using that other domain and even disabled the Gsuite associated with that domain which meant my website &amp; email would go down but the domain itself is still up because the API is hosted on it and that’s all that mattered, all the accounts associated with my old email, left it online for about a month to make sure that I didn’t miss any important notifications, then when it finally stopped receiving emails that I cared about i turned it off and switched to the new domain, <em>goodbye spam!</em></p><p>Two consequences happened because I didn’t pay attention to everything the app dependent on to run. To those of you who are DevOps.. please don’t judge me.</p><p><strong>The first incident</strong></p><p>I was using the app at night, trying to add in weight log for one of my guinea pigs who had been recovering from a breathing problem when I got an error using the app, I jotted it down on slack and didn’t think much of it, I had spent the last couple of weeks playing with my account on the backend and testing things so it must be just a missing id somewhere in the system that I can look at tomorrow. That was a mistake. I woke up the next morning to messages on our facebook page, emails, 1-star reviews and posts on different guinea pig groups about people asking us why is the app not working 😱</p><p>I got up at 6 am, my team’s timezones being behind me it was still midnight for most of them, I started testing the app from my wife’s phone and lo and behold the app is giving me an error when I sign in. I replied to all the messages, went on amazon and got their support on the line, kept testing different scenarios to figure out what was going on and eventually we found it… our SSL certificate for the old domain had expired</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/0*Zviy6Ekekcqb9DJY.gif" /></figure><p>Of course I would have received those emails warning me that the SSL certificate was about to expire had I actually kept my old email address running, by the time I found out it was too late, I had to reapply for a new certificate, reactivate my old email and wait a few hours for the effect to take place. It was a nightmare.</p><p>We kept monitoring the app for the next two days to make sure that the domain has its new SSL in different parts of the world (AWS distributes the domain and SSL on <a href="https://aws.amazon.com/cloudfront/features/">edge locations</a> so each region gets its update at a different timeframe) and replied to all of our users that the fix is on the way.</p><p>On the other hand I was kind of glad to see that immediately people started noticing and complaining, that does tell us a bit about how many users would be annoyed if the app completely stopped working, which the book “The lean startup” suggests is an accurate way to measure how much users actually want what you’re doing, of course the book is only talking about a feature in the app but I like taking things to the next level.</p><p><strong>The second incident</strong></p><p>Before we had the Upilio domain I registered the app and any and all legal documents (I.e. privacy policy) under the domain I had available at the time. Any third party application needed to have a link to these documents to present them to their clients to understand how we use their data and yada yada. I set them up once and forgot about them.</p><p>When I started moving domains around, I moved the website from the old domain to the new one and didn’t think much of it, after all we don’t even use that website and no one visits it, <em>the app is what’s important everything else comes in second </em>but what I DID NOT DO was update the links to our privacy policy hosted on the new domain.</p><p>Facebook the ferocious did not give us any notice before shutting down the app.</p><p>Another eventful morning I woke up to a bunch of emails and Facebook messages from users who can’t log in to the app using their Facebook account, Facebook has shut down our integration app. I spent an hour this morning running around different options and eventually I brought the old domain back up along with the privacy policy in it, and eventually, we updated the link on facebook to point to our new domain instead.</p><p>The main takeaway from these is for those of us who are used to things <em>just working </em>to be alert, write everything you’re using in your business down, ask your developers to write all the libraries they are dependant on in a readme file in the code, make sure to check on everything often and do not make the move from one domain to another lightly.</p><p>These are the lessons I have learned running this business so far, we still have a lot ahead of us and the biggest challenge right now is moving towards a recurring income model that can scale and having the patience to see it through.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb1ecf553da9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upilio/how-my-guinea-pigs-app-started-part-2-eb1ecf553da9">How My Guinea Pigs App Started — Part 2</a> was originally published in <a href="https://medium.com/upilio">Upilio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How my guinea pig Augustus kick started My Guinea Pigs App]]></title>
            <link>https://medium.com/upilio/how-my-guinea-pig-augustus-kick-started-my-guinea-pigs-app-9bc5a1013a13?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bc5a1013a13</guid>
            <category><![CDATA[startup-ideas]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[pets]]></category>
            <category><![CDATA[ideas]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Tue, 01 Jan 2019 12:55:24 GMT</pubDate>
            <atom:updated>2019-10-13T12:44:26.920Z</atom:updated>
            <content:encoded><![CDATA[<p>You may have noticed that the “My Guinea Pigs” app logo is based off my guinea pig Augustus</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*9bRqKpqlRSGJdMsfXJLltQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*CPGg257pyIxdgl9_74J8yw.jpeg" /><figcaption>My Guinea Pigs logo &amp; Augustus</figcaption></figure><p>When my wife Mary and I first went to the pet store to get a cage friendly pet for our home, as we’re renting so we’re not allowed to get a cat or a dog, we first thought of getting a snake, a lizard or a tarantula, but when we saw some guinea pigs at the pet store we couldn’t resist getting ditching the reptile idea and getting that cute fluffy little animal.<br>We went back home, did some research and found out that they had to be in pairs so we had an e-chat with our landlord and got them, they both would fit in the palm of my hand, adorable, we got them in 2015.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VgkzChXcJoU7kJQnbEB-g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*cwqjIbiTNfcvSQZgMyjGLw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*iYiEL9UyD5PuKE0cuc-0wg.jpeg" /><figcaption>Caesar and Augustus</figcaption></figure><p>We later got Cornelius in 2016</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*g8GOHw0TorAk5UfSeEKEow.jpeg" /><figcaption>Curious Cornelius</figcaption></figure><p>It became daunting for us to keep on googling for what they should eat from what’s available around us, so we found a list of food online and we stuck by it.<br>I fiddled with the idea of building a website that would have a list of vegetables they can eat but I didn’t bother seeing it through at the time, that was in 2017.</p><h3>Augustus getting sick</h3><p>At some point in December 2017, Augustus started getting thinner, and it became very noticeable in January, I kept taking him to our normal general vet but they couldn’t find anything odd about Augustus, everything looked fine, they recommended I’d go to an exotic vet, it was a Sunday afternoon and that week was going to be my first week in a new job so I went to a vet hospital and they kept him in the hospital overnight, and I drove back without Augustus.</p><p>I went to work on Monday, first day, and I got a call from a vet in the hospital. It turned out that his back teeth were overgrown and it was painful for him to chew.</p><p>They put him under anesthesia for 15 minutes and filed his teeth. Then they kept him there for a couple of days, I was able to tell that his brothers, Caesar and Cornelius, felt something was wrong, they weren’t their active selves while Augustus was in the hospital.</p><p>My stress level was through the roof that week; with the new job and worrying about what bill I’d have to push back to pay for Augustus’ care and, worst of all, the feeling of guilt that I haven’t taken proper care of my pet.</p><h3>Google vs Exotic vet</h3><p>When I went to check on him in the hospital, the vet and I had a chat about his diet, it turns out that I have been giving them the soft vegetables that doesn’t help their teeth and overfeeding them that they get full on it and end up not eating enough Hay which is hard enough to trim their teeth down. I am not sure why it was just Augustus that got affected by this but I’m glad it was only him.<br>So the vet gave us a new list of fruit and vegetables to follow and certain quantities to stick by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XSxlDT5149DMyhhSgN_Fg.png" /></figure><p>Which worked out great, and was much better than my internet list (what a shocker…) and that gave me a deep distrust in any information related to guinea pigs on the internet.</p><h3>How to differentiate between opinions and facts</h3><p>After joining a few facebook groups for guinea pig owners, I discovered that I am not the only one who has that problem. Every third post is a question about “Can my guinea pig eat this” and in the comments there is usually some nice people giving a general yes or no answers but they disagree around the details; i.e. “yes your guinea pig can eat Carrots but only twice a week”. And there’s the occasional justice warrior who sets the post author straight and gives them more advice than what they asked for which often leaves the person asking the question feeling guilty about not knowing the answer in the first place.</p><p>Why were people posting these questions.. Shouldn’t they be easy to google? And shouldn’t we trust the information on the WWW? The answer to both is No, they are not easy to google and the information is not trustworthy, in fact as I later found out, most of it are just opinions by people who own/owned guinea pigs and wrote about their experience with different vegetables, <strong>none of these websites were written or verified by veterinarians</strong></p><p>I found out that a lot of guinea pig owners share the same frustration and distrust I have, everyone wants a reliable source of information that has gone through rigorous research and got the stamp of approval from a specialised veterinarian.</p><p>And so, in Augustus’s honor (who is now healthy and well), I started the app. One that not only solves the problem of unreliable data, but also creates a meal plan out of that data so I wouldn’t have to worry about feeding them too much sugar, or not enough vitamin c.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*M-pTHUA5tlg3lk2t0ikixA.jpeg" /><figcaption>Enjoying some coffee after completing our My Guinea Pigs App shopping list</figcaption></figure><p>After launching the first version of the app back in mid 2018, people loved it, we did a lot of work getting the data together and verified from experts from different countries and now we finally have a free and reliable source of information, all thanks to Mr Augustus who has absolutely no idea.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NsLPqtpaBtLSzhhevmQfVQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*xpWutnxIGs6XkYETcdQXug.jpeg" /><figcaption>Mr Augustus working his piggy ass off… kind of..</figcaption></figure><p>Read more about how we went from an idea to an app: <a href="https://link.medium.com/wtgEp2rI7S">https://link.medium.com/wtgEp2rI7S</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bc5a1013a13" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upilio/how-my-guinea-pig-augustus-kick-started-my-guinea-pigs-app-9bc5a1013a13">How my guinea pig Augustus kick started My Guinea Pigs App</a> was originally published in <a href="https://medium.com/upilio">Upilio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How the “My Guinea Pigs” app started]]></title>
            <link>https://medium.com/upilio/how-the-my-guinea-pigs-app-started-5e1e6eed48e9?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e1e6eed48e9</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[pets]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Thu, 27 Dec 2018 19:24:35 GMT</pubDate>
            <atom:updated>2020-01-15T00:04:44.927Z</atom:updated>
            <content:encoded><![CDATA[<h3>How the “My Guinea Pigs” app started — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*DWi_e-8L5BbgP60oj_BAcA.png" /></figure><p>At the time of writing this (Dec 2018), the mobile application “My Guinea Pigs” now has 1500 monthly active guinea pig owners on both iOS and Android, when I started the application back in July, I did not expect to be at that position by December.</p><p>We had our struggles along the way; Apple rejected the first four versions of the app, we exceeded the budget three times, all the while we’re trying to deliver this world quality application and at the same time figuring out how to make enough revenue from it to keep it going.</p><p>I’ll aim to be as accurate as I can be in describing our journey to this point from a technical and an entrepreneurship perspective</p><h3>Validation, do people actually want this?</h3><p>Being a software consultant and helping a lot of business owners / entrepreneurs build an app out of an idea I can tell that validation is quite important; what might sound like an excellent idea today can be pretty dumb a few weeks and thousands of dollars down the line or at least missing some key elements that can’t be learned, or even sometimes rejected and the person pointing them out rebuked, without having a 100 users telling you about it.</p><p>I had a budget of $5000 in mind, we had saved up some money and I recently finished a project, but of course I didn’t want to bet it all on something that I believe in and it wouldn’t have taken me a long time to get a basic website out but still I wanted some proof that this is worth while. So I just searched on Facebook for “Guinea Pigs”, joined some guinea pig groups and popped a question:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*EFGbmJTNdhDPR3kfIUCoQA@2x.jpeg" /></figure><p>And that helped direct the MVP; rather than building a website everyone wanted an app, so, I planned out the app and made some wireframes and split out the app into three milestones:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*TdGTbn8dGrSQPehu-HnUaw@2x.jpeg" /></figure><p>Being a developer, I know how this will be built, and I started building the backend while looking for a freelancer to help me build the mobile side. Luckily I found an excellent Android developer to help me build the MVP which would get us to milestone 1.</p><p>Two weeks after making that post on Facebook, we launched the app on google play.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*3f3utyXwjJtpf0mu81jK_g@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*guwgx4yMvJmc3bRWK-8X8g@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*HK_FO-kuBIrJxlYoY32SYA@2x.jpeg" /></figure><p>I also made a Facebook page and an early adopters group to make it as easy as possible for our users to connect with us and give us feedback, I wanted this app to be user centric that we wouldn’t build any features unless the community asked for it. That currently is in our <em>company values</em> list</p><p>In our first week we reached 200 users, the idea had been <strong>validated</strong>.</p><h3>The next step, how can we generate revenue?</h3><p>Of course we can all agree that cash flow is the maker or breaker of any business, no money coming in, no staff, no development, no business. So now that the app is validated and I proved that there is a problem in the market “Can my guinea pig eat this?” and the app has the solution for it, the next step would be to figure out if a business can be built on top of this, in order to figure that out I needed to check two other boxes:</p><ul><li>Are people willing to pay for it?</li><li>Is there a big enough market to sustain a continuous income?</li></ul><p>Box more is more important, so I focused on ticking that first. I thought if people can pay any amount for anything in the application then that ticks the box regardless of the payment model, the conversion rate or a business plan, these come in later when a business person is in the team, I’m a software engineer and I realise that I wouldn’t be able to make a successful business out of this without some help but there’s no point spending more money on it until I figure out its potential and the possibility of make a company out of this.</p><p>After reading some books, doing some research on how B2C apps made their revenue, I saw three revenue models:</p><ul><li>In App payments</li><li>Out of app products</li><li>Ads</li></ul><p>Now initially at this very early stage, ads are ruled out, we’d need thousands of users logging in every day and spending a few minutes on the app to be able to make enough money to sustain a company, so that is a late game plan.</p><p>Out of app products (physical products sold out of the app) is a good idea, I got that from knowing that a large percentage of angry birds revenue comes from merchandise, but selling physical products has its own hassles of competing with established businesses in an area I am not at all familiar with and I didn’t want to fix problems that aren’t there, however, if I can help the suppliers reach their audience then this would be a win-win, after all, I have the focus of a very niche market. However, I still need at least a thousand users to be able to get suppliers interested in the app.</p><p>And lastly there’s in app payments, that should give us the kickoff we need to build everything else, if we’re able to raise enough from a thousand users to build the next phase then we can be self sufficient, isn’t that the dream?</p><p>So milestones 2 and 3 were to build good tools in the app that the users asked for and charge a small amount for it.</p><p>I had a list of features people asked for, so I combined their request and came up with two tools:</p><ul><li>A profile for your guinea pigs to track their weight and other data</li><li>A meal planner so you wouldn’t have to plan their weekly meals yourself</li></ul><p>But I needed to know that these are things people actually want and they are willing to pay for them, so I went back to the way I validated the idea of having an app in the first place and posted a survey on a few guinea pig groups and got some responses</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*xVA7FOUKrRGWlYHwdEZt_g@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*XV-ZusoMpoSf2VqkwTgUvw@2x.jpeg" /><figcaption>An actual survey and its answers</figcaption></figure><p>So now it was time to start working on the second version of the app.</p><h3>Reality hit, the tough technicality of building an app</h3><p>So I’m sure I mentioned by now that I’m a software developer and this is not my first app, that means that I should be able to know how it will get built, how much it would cost and how long it would take right? Wrong.</p><p>We went over two budgets in developing the app, apple rejected our app four times and we had to change our frameworks twice. I won’t get into the technical details in this article but I’ll give you an overview of what happened.</p><h4>Cross Platform vs Native</h4><p>After the MVP was built on Android, I started looking into having it built on iOS, so I did some investigating and talked to a few iOS developers to get quotes and it would have costed more than the Android app to get done, plus I’d be talking to two developers instead of one, so I started looking into having a cross platform app, that’s where you write the code once and compile it into two native apps or at least that’s the idea, however, that also has it’s problems, animation would be much harder, bugs would be tougher to solve, and you’d need a developer who knows Java for Android, Swift for iOS and JavaScript for ReactNative BUT, it would be 60% cheaper than building natively on the two platforms, so for me that was the selling point and we made our first platform change from Native code to React.</p><h4>Serverless vs Claudia</h4><p>At the time I was in charge of the API backend and the database, I wrote all the logic on a framework called Claudia that’s used to create AWS Lambda functions. Claudia is great and I have used it in the past for a number of different apps, this one was a bit different though, the whole backend is server-less which means it’s not running on a single physical server or even virtual one that I manage, instead for all I care, I only need to worry about the code working and AWS Lambda does the rest; it’s also a cheaper upkeep than having a sever running 24/7 because I pay when the function runs for the duration it runs in. However, as the application grew, I had to upload the entire code every time I wanted to update a function, so deployment time for pretty small changes would take up to 5 minutes, which meant API development became quite slow. I had to change course and explore a new framework, I started doing a bit of research and decided to go with another framework called Serverless, however, it would have taken me around 5 to 10 hours to make that move from Claudia to Serverless and with my full time job it became quite difficult to keep up with Addin the mobile developer so I had to make a choice, either ask Addin to slow down so I can catch up or pass the budget and hire a backend developer to take the lead on the move to Serverless and continue from there. As I didn’t want to mess with the momentum, and I know from past experience how important it is to keep that momentum level up, I went with the latter option and hired someone who knew Serverless inside out and she gave the backend a great push forward and I had time to focus on the business itself and the data side of our app.</p><h4>Apple rejecting our app</h4><p>While all this was happening, Apple had rejected the first version of our app, their reason was that we were in violation of their policy 4.2 Minimum functionality which meant we didn’t have enough functionality in the app to justify it being in the App Store, never mind that by that time we had 500 users on Android and a large number of people asking for the iPhone version, we got stuck in this grey area for quite some time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*g7uJ2puYNw7ihMwZUm8tXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*eX3oT1Kbf9amh_NUQCRyvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*tsbT-GNcNh0B55Ib6DUwdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*mDYchPT5C-Ch-myzAENpGA.png" /><figcaption>Our users asking for the iPhone version</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*pUofgOIdpDMaLOjtomZQvg.png" /><figcaption>The rejection message from Apple</figcaption></figure><p>So I figured if we add more to the app they have to let it through, and we need to have the app on iOS because we still want that validation we got from version 1, that iPhone users want the app and will use it; so we added in the articles and crossed our fingers and the app got rejected for the second time, I emailed them asking for a call back, followed up two days later, and followed up again three days later until someone finally called me and explained to me that they are aware that this part is open for interpretation and there are no set of rules that qualifies an app in having “enough” functionality to be on the App Store but what the agent told me at the time was the app “lacked interactivity and is just offering data” and then she continued “if you added a chat feature then this <strong>might</strong> pass the review process”.</p><p>I use that story to advise anyone against publishing the beta version of the app or a proof of concept on the App Store, you might have a brilliant idea, great bug-free code, and a user base that’s dying for your app but struggle to get on the App Store; on the other hand, <strong>Google released our app in a matter of hours</strong>, without having that validation for the first version I probably wouldn’t have continued the app, thank you for being nice and easy Google.</p><p>Moving on from there, I had high hopes that once the meal planner and the profile features were implemented Apple would approve our app because those are “interactive” features, we added in the profiles feature first then it got rejected and I didn’t pay much attention to it because we were going to add in the meal planner feature anyway and I placed my hopes on that and yet I got this sad frustrating email “Your app has been rejected”, I was furious; I emailed them, tried calling the agent that called me before, applied for an appeal and waited; none of these stuff worked in the past so I didn’t expect them to work this time and without an iPhone version I wouldn’t be able to reach nearly half the potential market, I can’t run an ad campaigns because I don’t know what device the user has, and worst of all I had no idea how to fix this. A few hours later, I got an email saying it got approved, I speculate that whoever is reviewing the application saw the previous three rejections and decided that it is ok to make a fourth rejection, I blame that person for the dent in my wall.</p><p>Once that approval came through from Apple, we were back on track, and it was time to try and fix anything wrong with that last release and get it out there.</p><p>We had already passed our first budget when we took a backend developer on board, not that this was a wrong decision I still stand by it, but now we were close to passing our second. Software Development isn’t easy, there are a lot of unexpected things that can happen and you can’t plan for them, so my advice is to always put some money on the side even if the project is simple.</p><p>We started using our Early Adopters group for beta testing the second version before it goes out to the market, so we invited anyone who was interested in testing the app to that group with the promise of giving them the app for free in return for their feedback, and that turned out to be a great idea, not only did they find extremely peculiar bugs but they also gave us some great suggestions, that group of users from different countries, ages and different levels of experience with guinea pigs showed us some loop holes we never thought about, and in making those last few changes before the launch caused us to pass the second budget, but again, it was worth it.</p><p>In November, we were finalising the last bits and pieces, doing some tests and running through every scenario possible and we eventually launched the second version of the app on November 24th 2018, Immediately people started purchasing in-app commodities and the second box was checked. I celebrated with some 30 year old Port..</p><h3>The last stretch, growing the app and making a business</h3><p>As I am writing this, we have:</p><ul><li>1500 monthly active users, 1200 of which have logged into the app (using the meal planner and the profile features)</li><li>1300 guinea pig profiles (that’s a ratio of 1.1 profile per user)</li><li>12,000 meal plans created (that’s a ratio of 9.2 plans per user)</li><li>A 20% conversion rate (Buying something in the app)</li><li>4.2 Rating on Google Play from 42 ratings, no rating on App Store yet</li><li>3 data validations from exotic veterinarians, nurses and big name rescues</li><li>Made a considerable amount of revenue and raised a nice sum for animal shelters around the world</li><li>At least 1 new message on the facebook page every day from a new user thanking us for the app and suggesting us new features</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*vbFRBCZpuYXaYzT_bFahgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*GMJdRg_V9acqP70jw5w53A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*arsS2Q9s2F8mS8EDuW5Q5g.png" /></figure><p>But we also have:</p><ul><li>Six 1 star ratings, complaining about the fact that the app is asking for in-app payments</li></ul><p>So the next step and the last box to check is that we can grow the app and even though the app audience grew from 500 to 1500 in a couple of weeks, that box also means having a sustainable business that can generate a continuous cash flow and most importantly having a happy community of users that would advocate us and spread the word about the app.</p><p>We all quickly realised that our pricing model is not ideal, the way we generate revenue at the moment is through in-app payments, every time you want to add a new profile you’d make a payment, and every time you’d like to save a meal plan you’d make a payment, but that was not what people expected, even though 20% would buy a profile there was a group of users who were not happy about having to pay to add a second profile. So, we did some brainstorming, asked our early adopters, I reached out to some colleagues who have a business degree and got some ideas off them, did some research on how other apps that might be somewhat familiar to us make their revenue and we came up with two conclusions; either we’d have a monthly subscription or a one-off fee and as it eventually falls down to what the paying users want, we made a survey and basically asked them “What would you rather pay”</p><p>Based on that, we’re making our next change, setting up a new financial forecast, raising capital, building up a team of experts in the mobile app and pet tech fields, and figuring out our next moves in 2019; which features do we build and what parts in the app do we focus on.</p><p>The third box is almost checked and we are on our way to changing the Pet industry for the better.</p><p>Read more about how my guinea pig Augustus kick started My Guinea Pigs App: <a href="https://link.medium.com/ECEv6VOH7S">https://link.medium.com/ECEv6VOH7S</a></p><p>Or checkout part 2: <a href="https://link.medium.com/3VvO5cnIK0">https://link.medium.com/3VvO5cnIK0</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e1e6eed48e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upilio/how-the-my-guinea-pigs-app-started-5e1e6eed48e9">How the “My Guinea Pigs” app started</a> was originally published in <a href="https://medium.com/upilio">Upilio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Dev hacks for Angular developers to make your work life easier]]></title>
            <link>https://medium.com/naguibihab/3-dev-hacks-to-make-your-work-life-easier-47a8fbf9ac76?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/47a8fbf9ac76</guid>
            <category><![CDATA[hacks]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Wed, 13 Sep 2017 08:36:02 GMT</pubDate>
            <atom:updated>2017-09-18T11:48:55.096Z</atom:updated>
            <content:encoded><![CDATA[<p>“A lazy developer is a good developer” — wise man</p><p>Don’t you just love it when the computer is smart enough to do the mundane stuff for you? If you’re a fan of <strong>automation </strong>and you’re working on a <strong>windows </strong>computer, then this article is <strong>for you.</strong></p><h3>Hack #1 Batch files</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*66ZwFIPveE-lqZtpqQZqAQ.gif" /></figure><p>A simple click and your code is being built, copied, deployed, invalidated for you. Batch files are fantastic for writing quick and straightforward code that would run git/grunt/aws commands for you.</p><p><a href="https://github.com/naguibihab/useful-batch-files"><strong>Checkout this useful git repository</strong></a><strong> that contains all the batch files that I use on a daily basis for my Angular &amp; PHP development</strong></p><p>Here’s an example of one of my favourite and most used batch files where it pulls a branch that I specify, does a bower install, builds it, then copies it into a location where my peers can see it and opens a browser tab pointing to that location:</p><pre>REM ****************************************************************<br>REM I use that bat file when someone asks me to build them a particular branch<br>REM it goes to the secondary source code (in case i&#39;m in the middle of something<br>REM and don&#39;t want to commit or stash) fetches from git, checksout the branch<br>REM pulls it by force (it will overwrite any uncommitted changes but that folder<br>REM shouldn&#39;t be used to write code anyway) installs any new dependencies from<br>REM bower and then builds and copies that build to my xampp folder where I<br>REM have a local ip address pointing to it so others on the same network can see<br>REM it and test it. Eventually it opens a new browser tab with that url.<br>REM<br>REM If you&#39;re working remotely and want to upload the code to a server checkout<br>REM the batch file &quot;CheckoutBuildUpload&quot; which uploads to S3<br>REM<br>REM prerequisits: git, bower, grunt<br>REM **************************************************************</pre><pre>::setup<br>if &quot;%isSetupCalled%&quot; equ &quot;&quot; (<br>call ../SetupEnv.bat<br>)<br>set _human_or_batch=%1<br>set _isPause=%isPause%</pre><pre>::inputs<br>:: check if its called by human or by another batch file<br>if &quot;%_human_or_batch%&quot; equ &quot;&quot; (<br>set /P _branch_name=Branch: <br>goto defaults<br>)<br>:: else, get the inputs from the parameters<br>set _branch_name=%1<br>set _isPause=false</pre><pre>::defaults<br>:defaults<br>:: No defaults in that file, but I&#39;m keeping that for consistency</pre><pre>::operations<br>echo moving to %frontend_directory%:%frontend_secondary_source_code%<br>%frontend_directory%:<br>cd %frontend_secondary_source_code%</pre><pre>echo getting branch %_branch_name%<br>call git fetch --all<br>call git checkout %_branch_name% --force<br>call git pull --force</pre><pre>echo building...<br>call bower install<br>call grunt build</pre><pre>xcopy &quot;%build_file%&quot; &quot;%base_destination%\%_branch_name%&quot; /s/e/c/y/f</pre><pre>start &quot;&quot; %base_url%/%_branch_name%</pre><pre>if %_isPause% equ true pause</pre><h3>Hack #2 Automatically starting up your apps</h3><p>I used to have my computer sleep everyday instead of shutting it down because I have more than ten applications open and I just don’t want to have to open them all up again the next day, that’s not so good for the computer though and it ends up slowing it down. The solution, using windows’ <em>Startup Menu.</em></p><ul><li><em>Open the cmd and run </em><em>shell:startup</em></li><li>Create a shortcut for each application you’re using or any batch files that you use often (i.e. to open git for my projects) and throw it in there</li><li>You can even add in batch files for stuff like:<br>- opening and pulling the latest from git in all projects<br>- running grunt-serve for your frontend application<br>- compiling/building your application</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*kgpItEzCh51QUk5SKLvkdA.png" /></figure><h3>Hack #3 Git hooks</h3><p>Git can have hooks attached to it that would do a job before or after you commit or push. <br>The one that I use the most is a hook that appends my branch name to the my commit message.</p><p>For example if I commit a new change while on branch nick-testing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*HlNNoz2gJie_f3LfybpVcA.png" /><figcaption>git hook</figcaption></figure><p>That git hook appends my branch name to that start of my commit message</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*8y2myBwXlAFfTrfrE_p8xQ.png" /><figcaption>git hook</figcaption></figure><p>This comes in handy when you’re working with <a href="https://www.atlassian.com/software/jira">Jira</a> where commits that contain the jira task id are seen on the console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*f-Ya8OpuY8z2bPvTGYWK4A.png" /></figure><p>Here’s how you can add that nice little handy hook to your git repositories:</p><ul><li>Navigate to the hooks folder /.git/hooks in your repository</li><li>Copy this code in a new file:</li></ul><pre>#!/bin/sh<br>#<br># Automatically adds branch name and branch description to every commit message.<br>#<br>NAME=$(git branch | grep &#39;*&#39; | sed &#39;s/* //&#39;) <br>DESCRIPTION=$(git config branch.&quot;$NAME&quot;.description)</pre><pre>echo &quot;YourProject-$NAME&quot;&#39;: &#39;$(cat &quot;$1&quot;) &gt; &quot;$1&quot;<br>if [ -n &quot;$DESCRIPTION&quot; ] <br>then<br>   echo &quot;&quot; &gt;&gt; &quot;$1&quot;<br>   echo $DESCRIPTION &gt;&gt; &quot;$1&quot;<br>fi</pre><ul><li>Change the YourProject- part to your jira project name or completely remove it if you’re not using jira</li><li>Save that file as prepare-commit-msg</li></ul><p>Now any new commit made will contain the branch name.</p><h4>Thanks for reading!</h4><h3>If you enjoyed this article, feel free to hit that clap button below 👏 to help others find it!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47a8fbf9ac76" width="1" height="1" alt=""><hr><p><a href="https://medium.com/naguibihab/3-dev-hacks-to-make-your-work-life-easier-47a8fbf9ac76">3 Dev hacks for Angular developers to make your work life easier</a> was originally published in <a href="https://medium.com/naguibihab">naguibihab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Productivity: Automate git pull and deploy a different branch without getting distracted]]></title>
            <link>https://medium.com/@naguibihab/angular-productivity-automate-git-pull-and-deploy-a-different-branch-without-getting-distracted-3b46b8294e9e?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b46b8294e9e</guid>
            <category><![CDATA[programming-tips]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Tue, 25 Jul 2017 23:07:44 GMT</pubDate>
            <atom:updated>2017-07-25T23:07:44.753Z</atom:updated>
            <content:encoded><![CDATA[<p>Yesterday I was in “the zone”, focused and determined to debug this piece of complex spaghetti code and fix it, taking down notes, listening to some nice music when all of a sudden someone taps on my shoulder and asks me to build branch 277 for them… now I have to stash my changes on git, checkout this other branch, run git build and copy it somewhere so that they can see what’s on that branch, it’s a process that takes a couple of minutes with the build so good luck getting back into that same zone after doing that.</p><p>It’s annoying isn’t it? The good news is, <strong><em>almost any kind of routine job can be automated</em></strong>, so here’s a way to automate that by just running a windows batch file:</p><h3>Step 1: Make a copy your current dev folder</h3><p>You don’t want to stash or commit your changes on the existing dev folder that you’re working on, instead make a copy of that folder and make sure its pointed to the same repository</p><h3>Step 2: Write this batch file</h3><pre><em>::inputs<br>set /P destination=Branch name:</em></pre><pre><em>::operations<br>D:<br>cd \Dev\App2<br>call git checkout %destination% — force<br>call git pull — force<br>call grunt build</em></pre><pre><em>xcopy “dist” “C:\xampp\htdocs\%destination%” /s/e/c/y/f</em></pre><pre><em>start “” http://10.0.2.65/%destination%</em></pre><p>What you need to change is the following:<br>- cd \Dev\App2 &lt;&lt; Change that to your copy of your dev folder<br>- xcopy “dist” “C:\xampp\htdocs\%destination%” /s/e/c/y/f &lt;&lt; Change the path to point to your xampp folder (or whatever other lamp tool you use to host your built code locally for others to view it)<br>- start “” http://10.0.2.65/%destination% &lt;&lt; If you have a local server that you share with others internally then change this ip address</p><p>You can add in there an SSH or AWS S3 upload if you want to upload whatever’s built to a remote server to share it with your clients or colleagues.</p><p><strong>That’s it!! </strong>now when someone comes over, taps you on the shoulder and asks you to build branch 700 for them you can simple run that batch file, type in 700 and it’ll do the job, once the browser page comes up just copy the URL and send it to them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b46b8294e9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pandora and the gap it leaves behind]]></title>
            <link>https://medium.com/@naguibihab/pandora-and-the-gap-it-leaves-behind-c5cc25ad1a8e?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5cc25ad1a8e</guid>
            <category><![CDATA[idea-validation]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[pandora]]></category>
            <category><![CDATA[ideas]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Wed, 19 Jul 2017 22:23:47 GMT</pubDate>
            <atom:updated>2017-07-19T22:23:47.895Z</atom:updated>
            <content:encoded><![CDATA[<p>I got this email from Pandora last week saying they’ll no longer be offering their services for Australia and New Zealand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*32v0FDn3ESwMzDb8eNXKJg.png" /></figure><p>For those of you who don’t know what Pandora is, it’s an online radio application that chooses music for you based on what you like and dislike, it’s not like itunes or spotify where you can choose what to listen to instead it will play different songs based on machine learning and AI, some you may have heard before and some you haven’t, an excellent tool to discover new music and artists.</p><p>Pandora launched in January 2000 in the states, and came to Australia twelve years later in 2012 and now five years later they are closing their Australian base, It is the third platform to cease local operations here in the past year, with Guvera and Deezer also closing their Australian bases.</p><p>There’s no clear reason as to why they are shutting down however, that leaves an interesting gap in the market, Pandora’s audience will be looking for an alternative, and entrepreneurs in the music industry will be looking to fill that gap and gain that audience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*Rw9X-tR1903SkVe60p2oTQ.png" /></figure><p>If you’ve had an idea for a music application, now is the time to launch it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5cc25ad1a8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to minimise your costs in aws rds]]></title>
            <link>https://medium.com/@naguibihab/how-to-minimise-your-costs-in-aws-rds-e029bd1c9880?source=rss-288fc6b41d91------2</link>
            <guid isPermaLink="false">https://medium.com/p/e029bd1c9880</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Naguib (Nick) ihab]]></dc:creator>
            <pubDate>Mon, 10 Jul 2017 12:30:34 GMT</pubDate>
            <atom:updated>2017-07-10T12:30:34.868Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re using AWS to host your applications then you’d probably be treading carefully when it comes to the RDS instances. AWS has introduced this nice new feature that allows you to stop an RDS instance which essentially deletes it and keeps a snapshot and just deploys that snapshot again when you want to start it, but it makes life a lot easier especially if you put that kind of function in a batch file and just run that file whenever you need to.</p><p>In this article I’ll show you how to stop your RDS instances automatically every night and start them up again in the morning using AWS CLI.</p><p><strong>Prerequisite: You have to have already setup your AWS CLI with your account and are able to run AWS commands, follow </strong><a href="http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html"><strong>this link</strong></a><strong> to set it up</strong></p><h3>Running it from Windows</h3><h3>Step #1 Update your CLI</h3><p>Update your CLI to the latest version by running pip install --upgrade awscli to upgrade or just <a href="http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html">download and install the latest version</a></p><p>Now when you type in aws --version in your terminal you should see something like this:</p><pre>C:<strong>\Users\nick</strong>&gt;aws --version<br>aws-cli/1.11.109 Python/3.4.3 Windows/8 botocore/1.5.72</pre><p>As I’m writing this on the 22nd of June 2017, the latest version for windows is 1.11.109</p><h3>Step #2 Writing the script</h3><p>Create a new batch file <em>.bat</em> and write the following script</p><pre>@echo off<br>set rdslist=rds-instance-1 rds-instance-2</pre><pre>:retryaction<br>set /P action=Would you like to (1)start <strong>or</strong> (2)stop these instances %rdslist%:</pre><pre>IF %action%==1 (<br>    set command=start<br>    goto :start<br>)<br>IF %action%==2 (<br>    set command=stop<br>    goto :start<br>)</pre><pre>goto :retryaction</pre><pre>:start<br>(<strong>for</strong> %%a in (%rdslist%) <strong>do</strong> (<br>    call aws rds %command%-db-instance --db-instance-identifier %%a<br>))<br>pause</pre><p>And replace the rds-instance &amp; rds-instance-2 with your own instances names.</p><p>What we’re doing here is that we’re creating a list of our RDS instances and then iterating over each one and either stopping or starting them. What you should see when you run this script is the following: <br>Would you like to (1)start or (2)stop these instances rds-instance-1 rds-instance-2: <br>once you choose the action you want to take the batch file will run the start-db-instance or stop-db-instance command on each of your RDS instances.</p><p>You need to maintain that file and add,edit or delete RDS instances in that line 2.</p><h3>At this stage you’re able to run that batch file and start or stop RDS instances at anytime.</h3><h3>Step #3 Automating the script</h3><p>If you want to schedule it from your PC or windows server you can use the Task Scheduler</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*7KxtiZrPZ3npaVmbecJ-hw.png" /></figure><p>Once you open it click on <em>Create a Basic Task</em> and give it the name “Start RDS”. Continue with the wizard and select the trigger that you’re after, for example you may want the RDS instances to start when you start the computer, when you login or automatically at a particular time every day. <br>Keep going until you get to this screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*7gqwP4lLEfRfY8VDv07pdA.png" /></figure><p>Add in the path to your batch file and the argument 1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*dyN6xcHvNHafN6oIuEu3Fw.png" /></figure><p>Continue through the wizard and finish the task. <br>Now we need to add a small modification to our script to have it accept parameters instead of prompting a question:</p><pre>@echo off<br>set rdslist=rds-instance-1 rds-instance-2</pre><pre>IF %1==1 (<br>    set command=start<br>)<br>IF %1==2 (<br>    set command=stop<br>)<br>(<strong>for</strong> %%a in (%rdslist%) <strong>do</strong> (<br>    aws rds %command%-db-instance --db-instance-identifier %%a<br>))</pre><p>That’s it! You now have two bash files, one that you can run manually to shut down and start instances whenever you need them and one that can run on a scheduled time or trigger.</p><p>Watch this space and I’ll publish how to do that using Linux pretty soon ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e029bd1c9880" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>