<?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 Fahmi Al-Najjar on Medium]]></title>
        <description><![CDATA[Stories by Fahmi Al-Najjar on Medium]]></description>
        <link>https://medium.com/@fahminajjar?source=rss-f3c691e079e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IPiaH6H1tD1Oj1OwasQ4Fw.jpeg</url>
            <title>Stories by Fahmi Al-Najjar on Medium</title>
            <link>https://medium.com/@fahminajjar?source=rss-f3c691e079e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 19:09:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fahminajjar/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[Why Technical Debt is Important & How to Tackle it?]]></title>
            <link>https://fahminajjar.medium.com/why-technical-debt-is-important-how-to-tackle-it-ce083ecacfab?source=rss-f3c691e079e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce083ecacfab</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[technical-debt]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Fahmi Al-Najjar]]></dc:creator>
            <pubDate>Wed, 05 May 2021 20:37:26 GMT</pubDate>
            <atom:updated>2021-05-05T20:37:26.906Z</atom:updated>
            <content:encoded><![CDATA[<p>Address &amp; tackle technical debt strategically</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*poAk1h2eNbSk-vhD1NS_JA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jeshoots">JESHOOTS</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>In this article, I will talk about the following:</p><ul><li><strong>Introduction</strong></li><li><strong>What is Technical Debt?</strong></li><li><strong>Why is it Important?</strong></li><li><strong>Causes of Technical Debt</strong></li><li><strong>How to Address &amp; Tackle Technical Debt?</strong></li></ul><h3>Introduction</h3><p>The world is moving fast, maintaining competition is becoming more challenging, companies have to adapt to that fact. They should grow rapidly and respond to change to stay alive in the market, so most of the tech companies worldwide follow the <a href="https://en.wikipedia.org/wiki/Agile_software_development">Agile</a> methodology to achieve that.</p><p>As we all know, any technical product needs time to be designed and developed especially if we want to follow the best practices and solve many problems in an optimal way to make it well-designed, performant, efficient, maintainable, and scalable.</p><p>Business people want to adapt to change really quickly and this is expected otherwise they will be dropped out from the market. On the other hand, technical people want to develop products in an optimal way following best practices and this costs time. Business people don’t prefer to waste too much time in developing products, they want to see results as soon as possible, and if you think about it for a while you will find that it makes sense. If there is a fast way to reach the expected result (product, feature, etc.) why not go with it, right?</p><p>If you developed your product in the fastest way possible regardless of best practices and software engineering principles you will reach your results quickly and launch your product or feature to your audience and everything will be as expected! BUT eventually, you will end up struggling with the development in later phases. It’s like a bank credit card, you can use the money now to make purchases but you should pay it back later with some interest. The earlier you pay back, the lower interest you pay.</p><h3>What is Technical Debt?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B45w07Y4xLq8MJ-86FBOBA.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@gabby-k">Gabby K</a> on <a href="https://www.pexels.com/">Pexels</a></figcaption></figure><p>Technical debt is the result of prioritizing speed software delivery over perfect code. It’s the result of writing a piece of software functionality by the development team that later needs to be refactored.</p><p>Let’s walk through the following simple scenario:</p><p><strong>Business requirement:</strong> We have to develop a feature to allow users to chat with each other and we want this to be done in 1 month.</p><p><strong>Development team:</strong> This feature needs around 3 months of development using approach A — which follows best practices — but we can deliver it in 1 month using approach B — which is another faster approach — and we can go back and refactor it later.</p><p>In the above scenario, approach A is the optimal approach that should be followed to make sure the code stays readable, maintainable, and scalable but it costs 3 months, thus it costs more money. Approach B is the fast one that will make sure to be delivered quickly in 1 month.</p><p>Let’s say that two software engineers will work on this feature, and they take 2000 USD per month.</p><p><strong>Cost of approach A:</strong> 3 months * (2 engineers * 2000 USD) = <strong>12000 USD</strong></p><p><strong>Cost of approach B:</strong> 1 month * (2 engineers * 2000 USD) = <strong>4000 USD</strong></p><p>It seems that approach B is the winner BUT let’s go forward in time, imagine that this chatting feature has been developed and launched, and now after some while, we want to add more functionalities to it like sending photos and videos in the chat conversation between two users. The code is messy and the development team cannot add any additional functionality before refactoring the old code of that feature and tackle the technical debt. You will reach a point where you have to take the decision to refactor the code then add the additional functionality.</p><p>Let’s say refactoring the current code takes 4 months from 2 engineers and adding the newly required functionality takes 1 month from 2 engineers.</p><p><strong>Cost of refactoring the current code:</strong> 4 months * (2 engineers * 2000 USD) = <strong>16000 USD</strong></p><p><strong>Cost of adding the new required functionality:</strong> 1 month * (2 engineers * 2000 USD) = <strong>4000 USD</strong></p><p><strong>The total cost is:</strong> 16000 (refactoring) + 4000 (new functionality) = <strong>20000 USD</strong></p><p>Finally, the company ended up paying <strong>24000 USD</strong> while they could have just paid <strong>16000 USD </strong>(12000 + 4000),<strong> </strong>which is the cost of approach A (the optimal approach) plus the cost of adding the newly required functionality. Sometimes, you need to deliver fast but be aware of how much technical debt this introduces to the product. Be smart about it!</p><blockquote>Technical debt (also known as design debt or code debt) is a concept in software development that reflects the implied cost of additional rework caused by choosing an easy (limited) solution now instead of using a better approach that would take longer.</blockquote><blockquote>— Wikipedia</blockquote><h3>Why is it Important?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kCgGWPxVDG1cEwc6u6ZFWQ.png" /><figcaption>Image credit: <a href="https://caylent.com/">caylent</a></figcaption></figure><h4>It’s bad for software developers</h4><p>Code that is difficult to work with generally hampers the productivity of developers and results in less stable code.</p><ul><li>Adding new features and functionalities will become more difficult</li><li>Fixing problems will be challenging</li><li>Developers lose motivation</li><li>More stress</li></ul><h4>It’s bad for the development team</h4><p>It also affects the development team. The cost of losing a developer is really high, not to mention the knowledge loss that occurs when a team member leaves a company.</p><ul><li>Higher turnover</li><li>Reduced team agility and velocity</li><li>Bad time estimations</li></ul><h4>It’s bad for the organization</h4><p>In the modern age, technical debt can be a daunting obstacle to maintaining competition. Everyone knows that agility and resilience are strategic imperatives for companies with a product built optimally from the ground up.</p><ul><li>Greater friction between teams</li><li>Slower growth in the business</li><li>Reduced value of software artifacts</li></ul><p>The higher the technical debt, the more complicated it is to add features. Companies usually start to recognize the importance of high technical debt at a later time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*4ssaltBsJl4aJH-iVvPRkw.png" /></figure><h3>Causes of Technical Debt</h3><p>There are many causes for technical debt but the following are the main ones:</p><ul><li><strong>Lack of knowledge about technical debt</strong></li></ul><p>If you don’t know your problem, you can’t solve it, you have to admit it first. Technical debt occurs when the development team and even business leaders lack knowledge about it because if you don’t know what does technical debt mean then you don’t know what’s your problem. W. Edwards Deming once said “Lack of knowledge — that is the problem”.</p><ul><li><strong>Lack of clear requirements</strong></li></ul><p>It’s important to make your business and technical requirements clear to everyone because vague requirements lead to technical debt.</p><ul><li><strong>Lack of standards across teams and individuals</strong></li></ul><p>If you didn’t set rules and standards on how teams work across the company you will end up with high technical debt. Especially in software development teams — which are the individuals that produce your software — you should set how they must design and write code.</p><ul><li><strong>Lack of code testing</strong></li></ul><p>Code without tests cannot survive for years. Tests make your software more reliable and high quality so it will force you to reduce technical debt along the way.</p><ul><li><strong>Poor technical leadership</strong></li></ul><p>Good technical leadership is a very important factor in reducing technical debt, they should fight against any sort of technical debt, and they should argue more with non-technical leaders who seem to be OK with incurring more technical debt. Therefore, they should develop a healthy attitude towards incurring technical debt.</p><ul><li><strong>Strict deadlines and pressure that prioritize speedy delivery over perfect code</strong></li></ul><p>Sometimes, decisions are done by the product owner or the business leadership only. In general, the product owner or the business leadership is responsible for maximizing the value of delivery, while the engineering team owns the software and is responsible for its quality.</p><p>Therefore, decisions should be taken by collaboration between the two roles and trade-offs should be made on both sides.</p><h3>How to Address &amp; Tackle Technical Debt?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s4iXlI4B37OLSubXvPkk-A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@ryoji__iwata">Ryoji Iwata</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><ul><li><strong>Define technical debt</strong></li></ul><p>Admitting you have a problem is the first step in fixing the problem.</p><ul><li><strong>Track technical debt</strong></li></ul><p>You can track it by documenting technical debt issues. Such documentation is helpful to bring visibility into technical debt across the teams and you can go back and fix them later in a managed way.</p><p>Project Management tools (like Jira, Trello, etc) can also be used to track technical debt, you can add issues to the backlog and solve them gradually in each sprint. Be careful not to prioritize these issues, you will end up with a lot of technical debt issues in the backlog.</p><p>Use linter tools to give you a report of all errors, bugs, stylistic errors, and suspicious constructs.</p><ul><li><strong>Set standards, especially coding standards</strong></li></ul><p>You can also use linter tools to help you enforce some coding standards across the team.</p><ul><li><strong>Give high priority for code reviews</strong></li></ul><p>Code reviews are the line of defense for your software, reviewers must make sure that the introduced code doesn’t increase technical debt, especially the code of junior engineers.</p><p>Technical debt might increase when any engineer in the team does the code review, the reviewer must be an experienced software engineer and he/she should be familiar with the module that he/she is reviewing. A well-experienced engineer will make sure your software stays robust.</p><ul><li><strong>Write tests</strong></li></ul><p>Write tests for your code, especially the newly introduced code to make sure you have handled all the edge cases, and always try to cover more than 70% to maintain high test coverage.</p><ul><li><strong>Refactor code frequently</strong></li></ul><p>Having a technical debt in your software is normal. However, not solving them frequently is a big problem.</p><p>Make it a habit to solve a couple of technical debt issues in each sprint. If you used a project management tool to track issues, you can take issues from the backlog and move them to your sprints, you can tackle them one by one based on priority.</p><h3>Conclusion</h3><p>All tech products have technical debt, it’s a matter of how much technical debt you have and how frequently you tackle that debt.</p><p>In my opinion, technical debt is not always bad. For example, in startups, you don’t need to develop the product in the best approach, you just want to launch your business and see if it’s going to succeed or not, it will be a waste of time to go with the costly approach because you are not sure about anything yet, all you have is assumptions.</p><p>On the other hand, when your product reaches a point where it’s so much big and complicated you should pay attention to how much technical debt you are going to leave in your code while you are developing your product.</p><p>I would like to thank you for going through this article, If you liked it please don’t forget to give it some claps!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce083ecacfab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build RESTful APIs? The Unknown Hero Under The Hood (Part 2)]]></title>
            <link>https://medium.com/edraak-engineering/how-to-build-restful-apis-the-unknown-hero-under-the-hood-part-2-fd2190455d4a?source=rss-f3c691e079e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd2190455d4a</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Fahmi Al-Najjar]]></dc:creator>
            <pubDate>Sun, 17 Jan 2021 15:49:16 GMT</pubDate>
            <atom:updated>2021-01-27T20:32:42.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vGVKA5c_f6_6ORivdp7drA.jpeg" /></figure><p><a href="https://medium.com/edraak-engineering/how-to-build-restful-apis-the-unknown-hero-under-the-hood-part-1-4c1df16c0258">In Part 1</a>, we talked about how applications communicate and interact with each other, we said that each service has its own API and we use REST to provide a unified style of designing an API and to set a list of constraints to standardize how applications communicate with each other. We talked about the 6 main constraints of REST, and lastly, we discussed the benefits of REST.</p><h3>How to build a REST API?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*HIgma42-VdsuL9WXBsuC0A.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@nubelsondev">Nubelson Fernandes</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>Imagine that you are working in a big online learning platform and you have been requested to build a Course Service that provides CRUD (create, read, update, and delete) methods to deal with a course resource.</p><p>First, let’s go through DOs and DONTs, important principles, and best practices in RESTful APIs then I’ll walk you through hands-on steps on how you can build your RESTful API.</p><h4>RESTful API Best Practices</h4><ul><li><strong>Keep it simple</strong></li><li><strong>Use nouns instead of verbs</strong> unless you are based on business actions and you really need them</li></ul><pre># GOOD<br>/courses<br>/courses/&lt;int:course_id&gt;</pre><pre># BAD<br>/get_courses<br>/get_course/&lt;int:course_id&gt;</pre><ul><li><strong>Use URL parameters</strong> for filtering, pagination, ordering, and any other use case</li></ul><pre># GOOD<br>/courses?name=python&amp;page=1</pre><pre># BAD<br>/python_courses</pre><ul><li><strong>Use nested resources for data relationships<br></strong>For example, if you have many lessons for each course the URL would be as follows:</li></ul><pre># GOOD<br>/courses/88/lessons</pre><pre># BAD<br>/lessons</pre><ul><li><strong>Use the right HTTP methods</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*46e2a3bcNVA4yg82lGzJYQ.png" /><figcaption>CRUD operations for course resource</figcaption></figure><ul><li><strong>Use the right HTTP status codes<br></strong>There are many <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status">HTTP status codes</a> but the following are the most used ones:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IKqIeS2kSK80aZOi_Kmd8g.png" /><figcaption>Sample of HTTP Status Codes</figcaption></figure><ul><li><strong>Use pagination</strong><br>It’s highly recommended to use pagination in your API to prevent returning huge data. Let’s say that a client requested all courses, the result could be a massive response.</li><li><strong>Unify your API content format</strong><br>You should decide if your requests and responses will be in JSON or XML format.</li><li><strong>Handle errors</strong><br>You should return the HTTP status code that indicates what kind of error occurred with some informative details to eliminate confusion.</li><li><strong>API documentation</strong><br>You should provide your clients with clear API documentation to inform them about how they can communicate with your service. For each API endpoint, you should include endpoint URL, expected request data, expected headers, a sample of the response, and a list of errors that could happen when calling the endpoint. I would recommend <a href="https://swagger.io/">Swagger</a> as a good tool for generating API documentation.</li></ul><p>There are numerous ways of building a REST API but I would like to show you an example of my favorite one. Let’s walk through steps on how you can build a RESTful API for this service:</p><h4>Step 0: Installation</h4><ul><li>We’ll use Python3.x so make sure that you have <a href="https://www.python.org/">Python3.x</a> installed on your machine</li><li>We’ll use <a href="https://www.sqlite.org/index.html">SQLite</a> as it’s easy for this demonstration purpose</li><li>We’ll create a virtual Python environment for our application using <a href="https://docs.python-guide.org/dev/virtualenvs/#lower-level-virtualenv">virtualenv</a></li></ul><h4>Step 1: Set up the application</h4><ul><li>First, create a directory for this application called course_service , the structure of your application will look like this:</li></ul><pre>course_service<br>|-- app<br>|   |-- __init__.py     # App entry point<br>|   |-- api.py          # API endpoints<br>|   |-- errors.py       # API errors<br>|   |-- models.py       # App models<br>|   |-- configs.py      # App configurations<br>|-- requirements.txt    # App dependencies and requirements</pre><ul><li>Next, create a virtual environment for the application called venv :</li></ul><pre>$ cd course_service<br>$ virtualenv -p python3 venv</pre><ul><li>Activate the virtual environment:</li></ul><pre>$ source venv/bin/activate</pre><ul><li>Now add the application requirements to the requirements.txt file. The good thing about Flask that it’s a micro-library and you can add extensions to your application as you need.</li></ul><p>We’ll be using Flask microframework, Flask-Restful extension to add support for REST APIs, Flask-SQLAlchemy extension to add support for SQLAlchemy, Flask-Script to provide support for writing command-line scripts, Flask-Migrate to handle SQLAlchemy database migrations for the Flask application, marshmallow (ORM/ODM/framework-agnostic library) to convert complex data types, such as objects, to and from native Python datatypes, and marshmallow-sqlalchemy because Flask-SQLAlchemy integration requires it to be installed:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5021d6019de5f2edbd4c14b616591af/href">https://medium.com/media/d5021d6019de5f2edbd4c14b616591af/href</a></iframe><h4>Step 2: Install application requirements</h4><p>Download and install all application requirements that we added to the requirements.txt file:</p><pre>$ pip install -r requirements.txt</pre><h4>Step 3: Configure the application</h4><p>Add the following configurations to the app/configs.py module, configurations might be database configs, debug mode, and so on:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e19b4f59bc8df27a5eeb326140ca75a/href">https://medium.com/media/1e19b4f59bc8df27a5eeb326140ca75a/href</a></iframe><h4>Step 4: Create errors module</h4><p>The app/errors.py module contains all errors that might occur in the API methods. There are two errors that might occur in the API methods, NoDataProvided which will be raised if a client didn’t send data with the request and CourseAlreadyExist if there is an existing course in the database with the same provided course name (course name is a unique field).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd7caba87b7684f0dc4ac9965513d13f/href">https://medium.com/media/dd7caba87b7684f0dc4ac9965513d13f/href</a></iframe><h4>Step 5: Create the application entry point</h4><p>The app/__init__.py module will be the entry point of our application, it initializes a new Flask application with the given configurations and it defines resource routing.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6cd6b56592abf2015a6d88750213cd2/href">https://medium.com/media/b6cd6b56592abf2015a6d88750213cd2/href</a></iframe><p>As you can see, I’m connecting the API errors dictionary with the API object, it will tell the API class to handle the errors that are defined in the app/errors.py module. You just have to raise exceptions in the API methods and it will take care of returning the response for clients.</p><p>Both /courses/&lt;int:course_id&gt; and /courses URLs route to the CourseAPI class.</p><p>Flask provides a great command-line interface (CLI). But, it only supports three commands, such as flask routes that shows the routes for the app, flask run that runs a development server, and flask shell that runs a shell in the app context. We want to add an extra extension to the Flask CLI which is flask db in order to perform database migrations, the following line does that:</p><pre>Migrate(app=app, db=db)</pre><h4>Step 6: Create the models</h4><p>In the app/models.py module, create a simple Course model (resource) that has an id as the primary key and a name field. CourseSchema uses marshmallow to define the output format (serialization/deserialization) of a course object.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d1e44d60e05d78913ef89bb1b3d5228e/href">https://medium.com/media/d1e44d60e05d78913ef89bb1b3d5228e/href</a></iframe><h4>Step 7: Create API endpoints</h4><p>Flask-Rest provides a Resource class that defines routing from any given URL to the intended HTTP method. Define CourseAPI in the app/api.py module.</p><p>CourseAPI class will have 4 methods, a get method to handle course/s retrieve (either a list of courses or a specific course), a create method to handle course creation, a put method to handle updates for a specific course, and delete to delete a specific course.</p><p>As you can see, we’re using pagination in the get method to prevent returning a huge list of courses.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fee267162d50fbea55e0922e78ab81a/href">https://medium.com/media/2fee267162d50fbea55e0922e78ab81a/href</a></iframe><h4>Step 8: Run the application server</h4><ul><li>First, initialize the database for the application. This command creates a new migration directory:</li></ul><pre>flask db init</pre><ul><li>Next, generate migration scripts (Python scripts) for the new models with detected changes, as in our case, a migration script to create the courses table:</li></ul><pre>$ flask db migrate</pre><ul><li>Run the generated migrations to apply them to the database:</li></ul><pre>$ flask db upgrade</pre><ul><li>Finally, you are good to go:</li></ul><pre>$ flask run</pre><p>Try to manipulate a course resource using the CRUD-operations. You can use the basic <a href="https://www.geeksforgeeks.org/curl-command-in-linux-with-examples/#:~:text=curl%20is%20a%20command%20line,TELNET%2C%20LDAP%20or%20FILE).">CURL</a> command or any other tool like <a href="https://www.postman.com/">Postman</a>:</p><ul><li><strong>[GET, POST]:</strong> localhost:5000/api/courses</li><li><strong>[GET, PUT, DELETE]:</strong> localhost:5000/api/courses/{ID}</li></ul><p>I pushed the code of the application to Github, you can check it out at this link: <a href="https://github.com/Fahminajjar/rest-api-example">https://github.com/Fahminajjar/rest-api-example</a></p><h3>Conclusion</h3><p>In case you need to communicate superior, APIs are the way to go, but if you designed them badly it will increase confusion. So you should design them very well.</p><p>Hopefully, you can now build your own REST API using Flask. I would like to thank you for going through this article, don’t forget to give it a few claps if you like it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd2190455d4a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/edraak-engineering/how-to-build-restful-apis-the-unknown-hero-under-the-hood-part-2-fd2190455d4a">How to Build RESTful APIs? The Unknown Hero Under The Hood (Part 2)</a> was originally published in <a href="https://medium.com/edraak-engineering">Edraak Engineering</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 Build RESTful APIs? The Unknown Hero Under The Hood (Part 1)]]></title>
            <link>https://medium.com/edraak-engineering/how-to-build-restful-apis-the-unknown-hero-under-the-hood-part-1-4c1df16c0258?source=rss-f3c691e079e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c1df16c0258</guid>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[https]]></category>
            <dc:creator><![CDATA[Fahmi Al-Najjar]]></dc:creator>
            <pubDate>Tue, 12 Jan 2021 09:36:05 GMT</pubDate>
            <atom:updated>2021-01-22T19:23:39.386Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vGVKA5c_f6_6ORivdp7drA.jpeg" /></figure><p>We use technology with almost everything in our life, to communicate and socialize with friends and family, to purchase and buy things from stores, and to learn new things.</p><p>How does this happen? How does data get from one place to another? How different applications and devices communicate with each other to allow us to upload a video for our friends to watch on Facebook, to chat with family, or to enroll in an online course to learn something new?</p><p>APIs (application programming interfaces) help us achieve all of that, it’s the unknown hero under the hood. In this article, I will talk about the following:</p><ul><li><strong>Introduction to APIs </strong>— Part 1</li><li><strong>What is REST?</strong> — Part 1</li><li><strong>Why REST API?</strong> — Part 1</li><li><strong>Summary</strong> — Part 1</li><li><strong>How to build a REST API?</strong> — Part 2</li></ul><h3>Introduction to APIs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZMVmAT9HQwcys9nw3pl51g.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@thejohnnyme">Nikola Mirkovic</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>A long time ago, car manufacturers were used to building cars as one function or entity, they manufacture the car engine, doors, wheels, and all other parts of the car by themselves. Then, they started to build each part in the car as a separate function independently, nowadays, the market is really huge, there are a lot of companies and manufacturers that are specialized in manufacturing car engines for example, and that’s the only thing they do, and there are other companies that are specialized in manufacturing car wheels and so on. This makes cars more perfect because each company focuses on one small part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*nwdU4pEGO1aQTs3JUw76eg.jpeg" /><figcaption>One Function VS Micro Functions — Image source: Experfy</figcaption></figure><p>In the software industry, we were developing software as one monolithic application, we faced a lot of problems back then but nowadays, we separate logical functionalities in one software into multiple logical independent units (we usually call them services), let’s take an online learning platform as an example, the following are the logical units for the online learning platform:</p><ul><li>Authentication service</li><li>Student enrollment service</li><li>Content building service</li><li>Learning management system</li></ul><p>The authentication service deals with user login, registration, and authorization logic. Student enrollment service deals with everything that is related to student enrollments in courses. The content building service deals with course content creation. The learning management system deals with student states, grades, and progress in courses.</p><p>As you can see each service has its own responsibilities, it only handles its part of the job, no one can touch any logic related to the other services. That’s cool, right?</p><p>Software services need to interact with each other to provide users with the intended full experience. APIs (application programming interface) is a way for applications to communicate with each other without having to know how other applications are implemented, this provides flexibility, simplification, and a big room for innovation.</p><blockquote>An application programming interface (API) is a computing interface that defines interactions between multiple software intermediaries. It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc. It can also provide extension mechanisms so that users can extend existing functionality in various ways and to varying degrees.</blockquote><blockquote>— Wikipedia</blockquote><h3>What is REST?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p2X6bW3vM_tc90Pw6PVLKw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@tingeyinjurylawfirm">Tingey Injury Law Firm</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>Imagine that each application uses its own approach of building an API without unified standards, eventually, it will lead to a missy situation so we need to introduce some unified standards or a unified style of building APIs.</p><p>Thanks to REST, it provides a unified style of designing an API and it sets a list of constraints to standardize how applications communicate with each other. RESTful APIs allow clients to access and manipulate data using a textual representation of resources like XML and JSON.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*hMIqEMzV6ga93WL9HZEsyg.png" /><figcaption>JSON logo</figcaption></figure><p>Most of the RESTful APIs use JSON as a textual representation for resources. JSON (JavaScript Object Notation) is a lightweight data-interchange format, that is easy for humans to read and understand, at the same time it’s easy for machines to parse.</p><blockquote>Representational state transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services. Web services that conform to the REST architectural style, called RESTful Web services, provide interoperability between computer systems on the internet. RESTful Web services allow the requesting systems to access and manipulate textual representations of Web resources by using a uniform and predefined set of stateless operations.</blockquote><blockquote>— Wikipedia</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*H8X2wNHa9Ry9vDlr44_Dqg.png" /><figcaption>Image source: Systango</figcaption></figure><p>Some people mix between HTTP and REST, they are different things. <strong>HTTP </strong>(<strong>Hypertext Transfer Protocol</strong>) is an application-layer protocol for transmitting hypermedia documents, such as HTML (Hypertext Markup Language). <strong>REST</strong> (<strong>Representational State Transfer</strong>) is a set of rules, that when followed, enable you to build a distributed application that has a specific set of desirable constraints, it uses HTTP to transport messages between applications.</p><p>Interacting with REST APIs often involves the use of CRUD-like functions because they are built around resources, which can be created, updated, read, and deleted. The best practice of using CRUD-like functions in REST is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*46e2a3bcNVA4yg82lGzJYQ.png" /><figcaption>CRUD operations for course resource</figcaption></figure><p>When we want to create a new resource we usually use the <strong>POST</strong> HTTP method, <strong>PUT</strong> method with updating a specific resource, <strong>DELETE</strong> method with deleting a specific resource, and <strong>GET</strong> method with retrieving either a list of resources or a specific resource.</p><p>In order to design a RESTful API you have to follow the following 6 constraints:</p><ul><li><strong>Client-server — </strong>By separating the user interface from the backend logic and database storage, we improve backend scalability and improve portability for the user interface.</li><li><strong>Stateless — </strong>Each request from the client to the server must contain all the necessary information without using any existing state context in the backend, each request cannot know anything about any other request.</li><li><strong>Uniform interface</strong> — Must decide an API interface for resources inside the application. Each resource in the application should have one URI only. All resources should be accessed through a common approach like the above CRUD methods. It’s used in REST in order to simplify things.</li><li><strong>Cachable — </strong>Resources must declare if they are cachable or not, caching shall be applied to them when applicable. Caching can be on the client-side or the server-side, it doesn’t matter.</li><li><strong>Layered system — </strong>Allows you to use layered system architecture, you can deploy your APIs to a server, data storage to another server, and do some other logic on a third server.</li><li><strong>Code on demand (optional) — </strong>Most of the time you will be returning resources in the form of JSON or XML but it’s allowed to return an executable code in REST to the client-side (e.g. a client can call the API to request a UI widget to render).</li></ul><h3>Why REST APIs?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQqwvugWZe2FnzNSpTWODg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@cristian1">Cristian Escobar</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>Designing our API with REST constraints in mind will provide you with the following advantages:</p><ul><li><strong>Scalability</strong><br>Because the client-side is separated from the server-side, the application might be scaled easily without facing any challenges. Application services can remain stable while adapting to changes, upgrades, overhauls, and resource reduction.</li><li><strong>Flexibility and Portability</strong><br>Because application components are loosely coupled, the application will have the ability to adapt to possible or future changes in requirements, It is possible to migrate from one server to another at any time, it can adapt when external changes occur, and it can respond to uncertainty. Also, the frontend and the backend can be hosted on different servers.</li><li><strong>Independence</strong><br>Due to the separation between client-side and server-side, REST makes it easier for teams to develop multiple areas of an application independently, it offers the ability to try numerous environments during development because it always adapts to the working syntax and platform.</li></ul><h3>Summary</h3><p>So now you know how applications communicate and interact with each other, each service has its own API and we use REST to provide a unified style of designing an API and to set a list of constraints to standardize how applications communicate with each other. Also, you know the 6 main constraints of REST and we follow them to take the advantage of scalability, flexibility, portability, and independence.</p><h3>Next Part: How to build a REST API?</h3><p>In the <a href="https://medium.com/edraak-engineering/how-to-build-restful-apis-the-unknown-hero-under-the-hood-part-2-fd2190455d4a">next part</a>, we’ll go through DOs and DONTs, the important technical principles, and best practices in RESTful APIs. Then, we’ll walk through steps on how you can build a RESTful API using Flask microframework from A-Z.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c1df16c0258" width="1" height="1" alt=""><hr><p><a href="https://medium.com/edraak-engineering/how-to-build-restful-apis-the-unknown-hero-under-the-hood-part-1-4c1df16c0258">How to Build RESTful APIs? The Unknown Hero Under The Hood (Part 1)</a> was originally published in <a href="https://medium.com/edraak-engineering">Edraak Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Personalization in Online Learning Platforms]]></title>
            <link>https://medium.com/edraak-engineering/personalization-in-online-learning-platforms-67519cf8d49d?source=rss-f3c691e079e------2</link>
            <guid isPermaLink="false">https://medium.com/p/67519cf8d49d</guid>
            <category><![CDATA[recommender-systems]]></category>
            <category><![CDATA[education-reform]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[personalization]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <dc:creator><![CDATA[Fahmi Al-Najjar]]></dc:creator>
            <pubDate>Sat, 24 Oct 2020 15:02:28 GMT</pubDate>
            <atom:updated>2021-01-23T22:07:18.709Z</atom:updated>
            <content:encoded><![CDATA[<p>The art of recommendation systems</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6BCD8ZZzhPw-2w5BiIXAgw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@chuklanov">Avel Chuklanov</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>I once taught a group of kids Python programming. It was one of the most insightful and joyful experiences I ever had. Kids are super smart! They are creative and fast learners — there is no limit to their imagination.</p><p>Going into this experience, I had expected all students to learn in the exact same manner. This was far from true. While several students picked up the topic quickly, others didn’t. While some were eager to learn, others were barely interested.</p><p>That’s when it occurred to me to adjust my teaching methods. After conducting some research, I decided to adopt a well-known learning methodology, known as “peer learning”. whereby students interact with and learn from one another. The result would be a pace-driven and personalized learning process that is fun, engaging, and tailored to every student’s needs.</p><p>I don’t believe there is one optimal way of teaching all students within a class, for every one of them has different strengths, capabilities, and interests. Nevertheless, personalizing the learning experience remains one of the biggest challenges in education. But by providing courses and learning materials for students to study at their own pace, online learning platforms are leading the way towards personalized learning as opposed to traditional offline learning.</p><h3>What is Personalized learning?</h3><blockquote>Personalized learning refers to instruction in which the pace of learning and the instructional approach are optimized for the needs of each learner. Learning objectives, instructional approaches, and instructional content (and its sequencing) may all vary based on learner needs. In addition, learning activities are meaningful and relevant to learners, driven by their interests, and often self-initiated.</blockquote><blockquote>— Office of Educational Technology</blockquote><p>There are different definitions for personalized learning but I would highlight it in the following 4 principles:</p><ol><li><strong>Learning pace is adjustable for each learner</strong></li><li><strong>Learning objectives and approaches are tailored for each learner</strong></li><li><strong>Learning is driven by learner interest</strong></li><li><strong>Learners have the choice in what, how, and where they learn</strong></li></ol><p>In this article, I will talk about one way of personalizing the learning experience for the learners in online learning platforms..</p><h3>Recommendation Systems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwh4ElgPDfTIF0AfGxrdxQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@franki">Franki Chamaki</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>We live in a world that values data as much as, if not more than, oil. Technology has made our lives easier, particularly artificial intelligence (AI), which we can leverage to personalize the student learning experience. To this end, recommendation systems play a pivotal role.</p><p>A recommendation system is an intelligent system designed to propose items to users based on numerous factors, such as their usage history on a certain platform and the behavior of similar users. Within the online learning context, the recommended items could be learning materials or paths that resemble the student’s learning history and the behavior of similar students.</p><h3>Recommendation System Types</h3><p>There are three types of recommendation systems, which I will discuss within the online learning context:</p><p><strong>1- Course-Based Recommendations (content-based)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*B-1eA-OweTqSiDNp9wOMHg.png" /></figure><p>In course-based filtering, the system recommends courses similar to those in which the student is enrolled in.</p><p><strong>2- Student-Based Recommendations (collaborative-based)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*Dqjzp2IjGFi6KgrA7c7-VQ.png" /></figure><p>Unlike course-based filtering, student-based filtering recommends courses taken by other similar students. The similarity is measured based on previously taken courses.</p><p><strong>3- Hybrid-Based Recommendations<br></strong>Hybrid-based filtering is a combination of course-based and student-based filtering, offering the best of both.</p><p>There are many applications for recommendation systems in online learning platforms. We can achieve our goal of personalizing students’ experiences by:</p><h4>Recommending learning paths</h4><p>Suggesting or placing a student on an optimal learning path based on his/her behavior, preferences, and learning activities.</p><h4>Recommending learning materials</h4><ol><li>Suggesting courses based on previous course enrollments.</li><li>Suggesting a specific learning object (lesson, video, exercise, etc.) based on the student’s learning progress.</li></ol><p>Therefore, Learning objectives and approaches will be tailored for each learner and the learning process will be driven by learners&#39; interests.</p><h3>Recommendation System in Edraak Platform</h3><p>In <a href="https://go.edraak.org/med-re/">Edraak</a> (an Arabic MOOC platform), we use course-based filtering to recommend courses that a student might find interesting.</p><p>The list of recommended courses is shared with students via email, on the courses landing page, or — ideally — on the dashboard, which is the platform’s frequently-visited entry point.</p><p>Take a look at the following example. Here, the user is enrolled in the “<a href="https://www.edraak.org/en/course/course-v1:Edraak+IoT+2018_T1/">Internet of Things</a>” course under the “Technology” category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aehv4yIUHMSR5GO6jql0iw.png" /><figcaption>Enrolled-In Courses (Learner Dashboard)</figcaption></figure><p>Accordingly, the user will receive the below recommendations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pNZu9vGUgBCuetYz4J2XCA.png" /><figcaption>Recommended Courses (Learner Dashboard)</figcaption></figure><p>Thus, the learner has gained a personalized experience based on his/her interests.</p><h3>Cold Start Problem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*_c6gIkEFVLo9ehouOHY3aw.png" /></figure><p>A common issue faced with recommendation systems is the cold start problem. Basically, when new students join the platform we lack usage history from which to recommend courses.</p><p>At Edraak, we resolved this issue by introducing an onboarding process. Instead of showing an empty dashboard, we ask new students a few questions to capture their preferences and interests. Doing so helps us build an initial student profile that enables us to recommend suitable courses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HzQMfUv9aJMpM0ocmXhQ7w.png" /><figcaption>Onboarding Process (first step)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SurwEywZR3yHhVQUk70dlA.png" /><figcaption>Onboarding Process (second step)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5cA1AKWoJeFhnE9FvskJFQ.png" /><figcaption>Onboarding Process (third step)</figcaption></figure><h3>Recommendation Engine Model</h3><p>The recommendation model is built using <a href="https://en.wikipedia.org/wiki/Tf%E2%80%93idf">Term Frequency-Inverse Document Frequency</a> (TF-IDF), a numerical statistic that highlights how important a word is to a course in a collection of courses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*UYh1WtN5IoQnmjYd8ecpCw.jpeg" /><figcaption>TF-IDF</figcaption></figure><p>The model scans the course content and highlights its most important parts. It then uses the cosine similarity measurement, which gauges the similarity between two non-zero vectors of an inner product space. This measurement evaluates the similarity between two courses and builds a matrix (2D array), where each cell contains the similarity score between course A and course B. For example, similarity[A][B] = 0.897 means the similarity score between course A and course B is 89.7%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CmE2yb1BRPq8hLU7TgtvSQ.png" /><figcaption>Cosine Similarity Between Course A and B</figcaption></figure><p>This model aims to predict user interests, given that it is more likely for a student to enroll in a course that is similar to the one they are currently enrolled in (i.e. courses with a high similarity score).</p><h3>Effect on Edraak’s Platform</h3><p>The introduction of the personalization features (recommendation engine and onboarding process) positively impacted user behavior:-</p><ul><li>User enrollments increased by 35%.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kV-iWiaYY5JAE0K2NGCw6w.jpeg" /></figure><ul><li>The dashboard exit rate decreased by 53%.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9wHuBkEpXeJiV0yO-33IQ.jpeg" /></figure><h3>Conclusion</h3><p>There are many ways to personalize a student learning experience on an online learning platform. However, recommendation systems remain a personal favorite! Their ability to predict what we will most likely prefer — even if not 100% accurate — makes them highly valuable within the education field, as it motivates online students to learn more via a personalized experience.</p><p>I would like to thank you for going through this article, don’t forget to give it a few claps if you like it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67519cf8d49d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/edraak-engineering/personalization-in-online-learning-platforms-67519cf8d49d">Personalization in Online Learning Platforms</a> was originally published in <a href="https://medium.com/edraak-engineering">Edraak Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>