<?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 Ahmed Eshra on Medium]]></title>
        <description><![CDATA[Stories by Ahmed Eshra on Medium]]></description>
        <link>https://medium.com/@ah.eshra?source=rss-73a07ae282f7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L6Wgp1-vAFRq0JLwgrZn8A.png</url>
            <title>Stories by Ahmed Eshra on Medium</title>
            <link>https://medium.com/@ah.eshra?source=rss-73a07ae282f7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 23:26:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ah.eshra/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[Streamlining Software Development: Factory Design Pattern]]></title>
            <link>https://medium.com/@ah.eshra/streamlining-software-development-factory-design-pattern-83a1d1a191e6?source=rss-73a07ae282f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/83a1d1a191e6</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ahmed Eshra]]></dc:creator>
            <pubDate>Sun, 21 May 2023 23:37:35 GMT</pubDate>
            <atom:updated>2023-05-21T23:37:35.891Z</atom:updated>
            <content:encoded><![CDATA[<h3>Software Development: Factory Design Pattern</h3><h3>Introduction</h3><p>Creating robust and maintainable code is essential. One approach that helps achieve this goal is the Factory Design Pattern. This pattern enhances code reusability, flexibility, and overall system efficiency by providing a simple and concise solution to object creation.</p><h3>Understanding the Factory Design Pattern</h3><blockquote>The Factory Design Pattern is a creational design pattern that separates the process of creating objects from the classes that use them. It encapsulates object creation logic within a dedicated factory class, eliminating the need for the client code to directly instantiate objects. This promotes loose coupling and follows the principle of <a href="https://betterprogramming.pub/code-against-interfaces-not-implementations-37b30e7ab992">Code Against Interfaces, Not Implementations<em>.</em></a></blockquote><h3>Benefits of the Factory Design Pattern:</h3><ol><li>Enhanced Code Reusability: With the Factory Design Pattern, you can create multiple objects using a single interface.</li><li>Encapsulation of Object Creation Logic: By centralizing object creation in a factory class, you improve your code’s overall structure and readability. The creation process can be complex, involving various conditions which are abstracted away from the main codebase.</li><li>Reduced Dependencies: The Factory Design Pattern reduces dependencies between the client code and the concrete implementation classes. Clients only need to interact with the factory interface, making it easier to maintain and test the codebase.</li></ol><h3>To implement the Factory Design Pattern, follow these steps:</h3><ol><li>Define an interface or an abstract class representing the common behavior of the objects you want to create.</li><li>Create concrete classes that implement the interface/abstract class, representing different object types.</li><li>Create a factory class that encapsulates the object creation logic. This class provides a method(s) to create and return instances of the desired objects based on specific criteria.</li><li>Using the factory class to create objects in the client code instead of directly instantiating them. This promotes loose coupling and allows for easy maintenance and extensibility.</li></ol><h3>Conclusion</h3><p>The Factory Design Pattern simplifies complex object creation by encapsulating the creation logic within a dedicated factory class, which enhances code reusability, maintainability, and overall system efficiency.</p><p>By adopting this pattern, developers can achieve clean, maintainable, and extensible codebases while promoting good design principles in their software projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83a1d1a191e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Knowledge Officer; from MVP to scalable product architecture]]></title>
            <link>https://medium.com/knowledge-officer/knowledge-officer-from-mvp-to-scalable-product-architecture-959fbfb8d834?source=rss-73a07ae282f7------2</link>
            <guid isPermaLink="false">https://medium.com/p/959fbfb8d834</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Ahmed Eshra]]></dc:creator>
            <pubDate>Thu, 15 Feb 2018 16:06:54 GMT</pubDate>
            <atom:updated>2018-07-18T14:50:36.705Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORhZ1e3gBjg1kQFlsj0jvA.jpeg" /></figure><p><a href="https://goo.gl/3pamFx"><strong>Knowledge Officer</strong></a> is one of the newborn platforms in content management and data filtration. We work on managing the huge amount of content on the internet and translating it to defined learning paths, in order to help users reach their career goals. Today, I’ll share with you some of the technical challenges we have faced since the early days of this long journey and how we reshaped our architecture from a 1 month MVP to a scalable and maintainable product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QEDiKhSaOgi6W52S5QUHGg.png" /></figure><p><strong>Natural Language Processing</strong> &amp; <strong>Machine Learning</strong> are our 2 main players. We drive those 2 hot technologies to manage and deliver quality content to people who are starving for knowledge. On a day-to-day basis, we face many challenges, some of which are:</p><ul><li>content mining</li><li>content cleaning</li><li>text processing and information retrieval</li><li>text labeling and classification</li><li>personalized recommendations for our users</li></ul><p>Before diving into each challenge, I want to clarify that with startups, especially in the early days, EVERYTHING is unexpected and must be measured carefully from different points of view. There are 3 main factors you have to consider when faced with any decision making process in a startup’s early days; your team’s level of experience, the time required for actual implementation as well as current and future challenges you are likely to face.</p><p>So, instead of jumping right into implementation mode, we first start by searching for existing solutions and best practices. It’s can be very challenging, especially in the early days, to come up with a solution that will solve our current problems and any future unanticipated problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q0lDACYtcIRHBM4H." /><figcaption>Photo by <a href="https://unsplash.com/@nickeedoo?utm_source=medium&amp;utm_medium=referral">Nick Tiemeyer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>My team and I were responsible for implementing the initial version of<a href="https://goo.gl/3pamFx"> Knowledge Officer</a>; a platform that aggregates noise-free content from different sources in one place.</p><p>When putting the initial system design, we became aware that software architecture is a very widely-used term and that millions of articles on the web, talk about it, where each author fight to validate his point of view. We had to read as much as possible and learn from their experiences.</p><p>And so, we realized that the 3 main questions we have to answer are</p><ul><li>Which web technology will we use?</li><li>How can we store/represent our data?</li><li>And, what is the cost of deploying our application for production?</li></ul><h3><strong>Which Web technology will we use?</strong></h3><p>Our <a href="https://goo.gl/3pamFx">Knowledge Officer</a>’s team had good knowledge in <strong>Ruby on Rails</strong>. Also, RoR is very fast to setup any application from scratch. <strong>Time</strong> was critical and <strong>validating our idea</strong> was our number one priority. We came to the decision to learn <strong>ReactJS</strong> and have it be our front-end technology while using RoR for the backend. We regard this as a small investment we had to make at the time.</p><p>We realized that we need to challenge ourselves with learning new technologies; how are we supposed to encourage others to pursue continuous learning if we don’t start ourselves?!</p><h3><strong>How can we store/represent our data?</strong></h3><p>We stored our data in an RDBMS<strong> — PostgresSQL. </strong>You may wonder, why did we choose an SQL database for an application like that?</p><p>At the beginning, SQL was not bad at all. It was integrated very fast with Rails, compared to other NoSQL databases where their gems have a lot of problems working with Rails. The only challenge here was the data and how it would be stored for reuse in the future.</p><h3><strong>What is the cost of deploying our application to production?</strong></h3><p>Honestly, we didn’t care much about this. At this stage, you usually don’t have time to setup machines and it’s better to deploy on any cloud service instead. It could be a little bit more costly but you can start with the minimum requirements. In our case, we had an old machine setup that was ready for deployment after only minimal modifications.</p><blockquote><em>Reaching your ideal case from day one is impossible. Start quickly and validate quickly and </em><strong><em>don’t waste your time.</em></strong></blockquote><p>Within a month, we published the first version of the website. Our crawlers are now running every day to get fresh data. Our engines responsible for processing the crawled data were rake tasks in our Rails application that ran periodically. The Main application + Management Portal + Engines, were all hitting the same database.</p><p>After 2 months, the data size increased rapidly and our queries became very slow. We went with a basic quick fix; working on sharding our database by isolating the newly crawled articles from the live reviewed ones. Then, we indexed tables on the main columns that touch the most frequent queries.</p><blockquote><em>Go with basic quick fixes. Don’t over-engineer things or waste time on things that are not a top priority.</em></blockquote><p>So, our MVP achieved its target, and we got our idea validated. It’s now time to consider that everything can be built easily, except <strong>DATA</strong>. <br>Now, we are faced with what one might call a technical debt:</p><ul><li>All our data; live articles and training data were all in one place.</li><li>End-user application interacted with the same database that our engines are using to store new data i.e. a single point of failure.</li><li>RDMS wasn’t suitable for un-structure data, such as different types of articles from different sources.</li></ul><p>To solve this technical debt, it was now time to introduce a new architecture. Our <a href="https://goo.gl/3pamFx">Knowledge Officer</a>’s team became bigger and more familiar with different technologies and so we focused our attention on other factors like scalability, performance and, quality.</p><p>First, we thought about protecting our end-user application flow and isolating its data, in order to avoid unwanted data corruption. We developed our API as an independent application that handles our mobile/web applications requests. It can Read/Write data on an RDMS when new data is in the ready state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-mr-dEsmsHUPvLdE." /></figure><p>We have 3 engines built: <strong>Content Mining Engine</strong>, <strong>Processing Engine</strong> and, <strong>Classification Engine</strong>.</p><p>Each engine is running independently. All 3 engines are interacting with a NO-SQL database (Document-based database). This increases the isolation and security of our data moderation.</p><p>And so, we now have 3 isolated components, each with a specific mission and has its owner in the team. This architecture will help us maintain these components in the future.</p><p>Our next challenge was<strong> </strong>to decide how and when to migrate the data from the Document-based DB to production DB (RDMS); the user-facing database.</p><p>We have researched 2 approaches; <strong>Data-Driven</strong> vs <strong>Event-Driven</strong> architecture.</p><p>In my next article, I will discuss in detail each approach and how we managed to pick one.</p><h3>About us</h3><p><a href="https://app.knowledgeofficer.com/">Knowledge Officer</a> is a learning platform for professionals. Our <a href="https://medium.com/knowledge-officer/mind-the-skills-gap-treating-the-root-cause-3ad18615903c">mission</a> is to empower a generation of lifelong learners and to help people, however busy, learn something new and relevant every day and achieve their career goals.</p><p>If you want to progress in your career and learn from the best people and the best resources on the internet, then try our <a href="https://itunes.apple.com/us/app/knowledge-officer/id1327830032">mobile </a>and <a href="https://app.knowledgeofficer.com/">website</a> and support our campaign on <a href="https://www.producthunt.com/upcoming/knowledge-officer">ProductHunt</a>.</p><p>And we’d love to hear your thoughts! So send us at <a href="/service/mailto:team@knowledgeofficer.com">team@knowledgeofficer.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=959fbfb8d834" width="1" height="1" alt=""><hr><p><a href="https://medium.com/knowledge-officer/knowledge-officer-from-mvp-to-scalable-product-architecture-959fbfb8d834">Knowledge Officer; from MVP to scalable product architecture</a> was originally published in <a href="https://medium.com/knowledge-officer">Knowledge Officer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>