<?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 Sanduni Mayadunna on Medium]]></title>
        <description><![CDATA[Stories by Sanduni Mayadunna on Medium]]></description>
        <link>https://medium.com/@sandunisandathika98?source=rss-9e6234208b78------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2Bvnvlwe9WQaWSN7DHC3EA.jpeg</url>
            <title>Stories by Sanduni Mayadunna on Medium</title>
            <link>https://medium.com/@sandunisandathika98?source=rss-9e6234208b78------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 10:32:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sandunisandathika98/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[Types of Virtualization]]></title>
            <link>https://medium.com/@sandunisandathika98/types-of-virtualization-73ebb36c0587?source=rss-9e6234208b78------2</link>
            <guid isPermaLink="false">https://medium.com/p/73ebb36c0587</guid>
            <dc:creator><![CDATA[Sanduni Mayadunna]]></dc:creator>
            <pubDate>Thu, 12 Oct 2023 04:11:19 GMT</pubDate>
            <atom:updated>2023-10-19T11:14:46.481Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*_ohzW8tHLyjDYWLi.jpg" /></figure><h3>What is Virtualization?</h3><p>Virtualization is the creation of a virtual — rather than actual — version of something, such as an operating system (OS), a server, a storage device or network resources.</p><p>Virtualization uses software that simulates hardware functionality to create a virtual system. This practice allows IT organizations to operate multiple operating systems, more than one virtual system and various applications on a single server. The benefits of virtualization include greater efficiencies and economies of scale.</p><p>OS virtualization is the use of software to allow a piece of hardware to run multiple operating system images at the same time. The technology got its start on mainframes decades ago, allowing administrators to avoid wasting expensive processing power.</p><h3>How virtualization works</h3><p>Virtualization describes a technology in which an application, <a href="https://searchservervirtualization.techtarget.com/definition/guest-OS">guest OS</a> or data storage is abstracted away from the true underlying hardware or software.</p><p>Hypervisors take the physical resources and separate them so they can be utilized by the virtual environment. They can sit on top of an OS or they can be directly installed onto the hardware. The latter is how most enterprises virtualize their systems.</p><p>The Xen hypervisor is an open source software program that is responsible for managing the low-level interactions that occur between virtual machines (VMs) and the physical hardware. In other words, the Xen hypervisor enables the simultaneous creation, execution and management of various virtual machines in one physical environment.</p><p>With the help of the hypervisor, the guest OS, normally interacting with true hardware, is now doing so with a software emulation of that hardware; often, the guest OS has no idea it’s on virtualized hardware.</p><p>While the performance of this virtual system is not equal to the performance of the operating system running on true hardware, the concept of virtualization works because most guest operating systems and applications don’t need the full use of the underlying hardware.</p><p>This allows for greater flexibility, control and isolation by removing the dependency on a given hardware platform. While initially meant for server virtualization, the concept of virtualization has spread to applications, networks, data and desktops.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D69n7LlrktWj7NFP.jpg" /></figure><h3>Types of Virtualization</h3><p>You probably know a little about virtualization if you have ever divided your hard drive into different partitions. A partition is the logical division of a hard disk drive to create, in effect, two separate hard drives.</p><ol><li>Application Virtualization</li><li>Network Virtualization</li><li>Desktop Virtualization</li><li>Storage Virtualization</li><li>Server Virtualization</li><li>Data virtualization</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*bKFyhbjFHaW6gkoQ.png" /></figure><ol><li><strong>Application Virtualization:</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/0*QVbUTxdK_dYZViSu" /></figure><p>Application virtualization helps a user to have remote access to an application from a server. The server stores all personal information and other characteristics of the application but can still run on a local workstation through the internet. An example of this would be a user who needs to run two different versions of the same software. Technologies that use application virtualization are hosted applications and packaged applications.</p><p>Application virtualization is a process that deceives a standard app into believing that it interfaces directly with an operating system’s capacities when, in fact, it does not.</p><p>This ruse requires a virtualization layer inserted between the app and the OS. This layer, or framework, must run an app’s subsets virtually and without impacting the subjacent OS. The virtualization layer replaces a portion of the runtime environment typically supplied by the OS, transparently diverting files and registry log changes to a single executable file.</p><p>By diverting the app’s processes into one file instead of many dispersed across the OS, the app easily operates on a different device, and formerly incompatible apps can now run adjacently.</p><p>Used in conjunction with application virtualization is desktop virtualization — the abstraction of the physical desktop environment and its related app software from the end-user device that accesses it.</p><p><strong>2.</strong> <strong>Network Virtualization:</strong> The ability to run multiple virtual networks with each having a separate control and data plan. It co-exists together on top of one physical network. It can be managed by individual parties that are potentially confidential to each other. Network virtualization provides a facility to create and provision virtual networks, logical switches, routers, firewalls, load balancers, Virtual Private Networks (VPN), and workload security within days or even weeks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*n5KWF4wvJ_er536C.png" /></figure><p>The following are two approaches to network virtualization.</p><p><strong>Software-defined networking</strong></p><p>Software-defined networking (SDN) controls traffic routing by taking over routing management from data routing in the physical environment. For example, you can program your system to prioritize your video call traffic over application traffic to ensure consistent call quality in all online meetings.</p><p><strong>Network function virtualization</strong></p><p>Network function virtualization technology combines the functions of network appliances, such as firewalls, load balancers, and traffic analyzers that work together, to improve network performance.</p><p><strong>Benefits of network virtualization</strong></p><p>Network virtualization helps organizations achieve major advances in speed, agility, and security by automating and simplifying many of the processes that go into running a data center network and managing networking and security in the cloud. Here are some of the key benefits of network virtualization:</p><ul><li>Reduce network provisioning time from weeks to minutes</li><li>Achieve greater operational efficiency by automating manual processes</li><li>Place and move workloads independently of physical topology</li><li>Improve network security within the data center</li></ul><p><strong>3.</strong> <strong>Desktop Virtualization:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*p38OGom0o6x8IQv8" /></figure><p>Desktop virtualization allows the users’ OS to be remotely stored on a server in the data center. It allows the user to access their desktop virtually, from any location by a different machine. Users who want specific operating systems other than Windows Server will need to have a virtual desktop. The main benefits of desktop virtualization are user mobility, portability, and easy management of software installation, updates, and patches.</p><p><strong>Benefits of Desktop virtualization</strong></p><ul><li>Centralized Management</li><li>Improved Security</li><li>Reduce IT Costs</li><li>Flexible Infrastructure</li><li>Reduced Downtime</li><li>Improved Productivity</li><li>Power Efficiency</li></ul><p><strong>4.</strong> <strong>Storage Virtualization:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*TS-mRZICl5K7irKu" /></figure><p>Storage virtualization is an array of servers that are managed by a virtual storage system. The servers aren’t aware of exactly where their data is stored and instead function more like worker bees in a hive. It makes managing storage from multiple sources be managed and utilized as a single repository. storage virtualization software maintains smooth operations, consistent performance, and a continuous suite of advanced functions despite changes, breaks down, and differences in the underlying equipment.</p><p><strong>Benefits of Storage virtualization</strong></p><ul><li>Presents better space utilisation and storage options for unorganised data and resources.</li><li>Offers easy management of huge data enabling proper location and compiling.</li><li>Enhances the data backup by enabling snapshots of storage resources.</li><li>Provides an easy copy of data from one appliance to another at any specified location.</li><li>With a centralised system to manage numerous clients and vendors, storage virtualisation helps preserve time as well as money.</li><li>Allows migration of data to be completed quickly with fewer or no barriers to the movement.</li><li>Creates better workflows by eliminating multiple arrays for data storage with a central console</li><li>Reduces the need for hardware for storage, making it an easier and cheaper option for storage.</li></ul><p><strong>5.</strong> <strong>Server Virtualization: </strong>This is a kind of virtualization in which the masking of server resources takes place. Here, the central server (physical server) is divided into multiple different virtual servers by changing the identity number, and processors. So, each system can operate its operating systems in an isolated manner. Where each sub-server knows the identity of the central server. It causes an increase in performance and reduces the operating cost by the deployment of main server resources into a sub-server resource. It’s beneficial in virtual migration, reducing energy consumption, reducing infrastructural costs, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YEhwtPZIund9tX2i.png" /></figure><p><strong>Benefits of Server virtualization</strong></p><ul><li>mproved server reliability and availability,</li><li>Lower total operational cost.</li><li>More efficient utilization of physical servers.</li><li>More efficient utilization of power.</li><li>Virtual machine creation: create virtual machine to customer’s specifications for memory, CPU reservation, disk space and supported OS.</li></ul><p><strong>6.</strong> <strong>Data Virtualization: </strong>This is the kind of virtualization in which the data is collected from various sources and managed at a single place without knowing more about the technical information like how data is collected, stored &amp; formatted then arranged that data logically so that its virtual view can be accessed by its interested people and stakeholders, and users through the various cloud services remotely. Many big giant companies are providing their services like Oracle, IBM, At scale, Cdata, etc.</p><p><strong>Benefits of data virtualization</strong></p><p><strong>Speed-</strong>Data virtualization enables data consumers to access data, wherever it resides (including traditional databases, the cloud, or IoT systems) in seconds.</p><p><strong>Efficiency-</strong>Data virtualization doesn’t replicate data, so enterprises can save on governance and hardware, while enhancing the utilization of server and storage resources.</p><p><strong>Cost savings-</strong>Data virtualization software requires fewer resources, and costs a lot less than building a separate repository for consolidating and storing data.</p><p><strong>Security and governance-</strong>Data virtualization enables a centralized approach to data security and governance, ensuring that all data is consistent, protected, and high-quality.</p><p><strong>Access-</strong>Data virtualization allows for a self-service approach to accessing data, enabling quick access to data by any authorized data consumer</p><p><strong>Analytics-</strong>Data virtualization lets business users apply visualized, predictive, and streaming analytics across many different data sources</p><h3>Advantages of virtualization</h3><p>The advantages of utilizing a virtualized environment include the following:</p><ul><li><strong>Lower costs.</strong> Virtualization reduces the amount of hardware servers necessary within a company and data center. This lowers the overall cost of buying and maintaining large amounts of hardware.</li><li><strong>Easier disaster recovery.</strong> Disaster recovery is very simple in a virtualized environment. Regular snapshots provide up-to-date data, allowing virtual machines to be feasibly backed up and recovered. Even in an emergency, a virtual machine can be migrated to a new location within minutes.</li><li><strong>Easier testing.</strong> Testing is less complicated in a virtual environment. Even if a large mistake is made, the test does not need to stop and go back to the beginning. It can simply return to the previous snapshot and proceed with the test.</li><li><strong>Quicker backups.</strong> Backups can be taken of both the virtual server and the virtual machine. <a href="https://searchservervirtualization.techtarget.com/tip/Learn-the-differences-between-VM-snapshot-vs-backup">Automatic snapshots</a> are taken throughout the day to guarantee that all data is up-to-date. Furthermore, the virtual machines can be easily migrated between each other and efficiently redeployed.</li><li><strong>Improved productivity.</strong> Fewer physical resources result in less time spent managing and maintaining the servers. Tasks that can take days or weeks in a physical environment can be done in minutes. This allows staff members to spend the majority of their time on more productive tasks, such as raising revenue and fostering business initiatives.</li></ul><h3>Benefits of virtualization</h3><p>Virtualization provides companies with the benefit of maximizing their output. Additional benefit for both businesses and data centers include the following:</p><ul><li><strong>Single-minded servers.</strong> Virtualization provides a cost-effective way to separate email, database and web servers, creating a more comprehensive and dependable system.</li><li><strong>Expedited deployment and redeployment.</strong> When a physical server crashes, the backup server may not always be ready or up to date. There also may not be an image or clone of the server available. If this is the case, then the redeployment process can be time-consuming and tedious. However, if the data center is virtualized, then the process is quick and fairly simple. Virtual backup tools can expedite the process to minutes.</li><li><strong>Reduced heat and improved energy savings.</strong> Companies that use a lot of hardware servers risk overheating their physical resources. The best way to prevent this from happening is to decrease the number of servers used for data management, and the best way to do this is through virtualization.</li><li><strong>Better for the environment.</strong> Companies and data centers that utilize copious amounts of hardware leave a large carbon footprint; they must take responsibility for the pollution they are generating. Virtualization can help reduce these effects by significantly decreasing the necessary amounts of cooling and power, thus helping clean the air and the atmosphere. As a result, companies and data centers that virtualize will improve their reputation while also enhancing the quality of their relationship with customers and the planet.</li><li><strong>Easier migration to the cloud.</strong> Virtualization brings companies closer to experiencing a completely cloud-based environment. Virtual machines may even be deployed from the data center in order to build a cloud-based infrastructure. The ability to embrace a cloud-based mindset with virtualization makes migrating to the cloud even easier.</li><li><strong>Lack of vendor dependency.</strong> Virtual machines are agnostic in hardware configuration. As a result, virtualizing hardware and software means that a company does not need to depend on a vendor for these physical resources.</li></ul><h3>Limitations of virtualization</h3><p>Before converting to a virtualized environment, it is important to consider the various upfront costs. The necessary investment in virtualization software, as well as hardware that might be required to make the virtualization possible, can be costly. If the existing infrastructure is more than five years old, an initial renewal budget will have to be considered.</p><p>Fortunately, many businesses have the capacity to accommodate virtualization without spending large amounts of cash. Furthermore, the costs can be offset by collaborating with a managed service provider that provides monthly leasing or purchase options.</p><p>There are also software licensing considerations that must be considered when creating a virtualized environment. Companies must ensure that they have a clear understanding of how their vendors view software use within a virtualized environment. This is becoming less of a limitation as more software providers adapt to the increased use of virtualization.</p><p>Converting to virtualization takes time and may come with a learning curve. Implementing and controlling a virtualized environment demands each IT staff member to be trained and possess expertise in virtualization. Furthermore, some applications do not adapt well when brought into a virtual environment. The IT staff will need to be prepared to face these challenges and should address them prior to converting.</p><p>There are also security risks involved with virtualization. Data is crucial to the success of a business and, therefore, is a common target for attacks. The chances of experiencing a data breach significantly increase while using virtualization.</p><p>Finally, in a virtual environment, users lose control of what they can do because there are several links that must collaborate to perform the same task. If any part is not working, then the entire operation will fail.</p><h3>Uses of Virtualization</h3><ul><li>Data-integration</li><li>Business-integration</li><li>Service-oriented architecture data-services</li><li>Searching organizational data</li></ul><p><strong>Conclusion:</strong></p><p>With the help of Virtualization, multiple operating systems and applications can run on same machine and its same hardware at the same time, increasing the utilization and flexibility of hardware. The term virtualization is often synonymous with hardware virtualization, which plays a fundamental role in efficiently delivering Infrastructure-as-a-Service (IaaS) solutions for cloud computing. Moreover, virtualization technologies provide a virtual environment for not only executing applications but also for storage, memory, and networking.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73ebb36c0587" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed System Architectures and Architectural Styles]]></title>
            <link>https://medium.com/@sandunisandathika98/distributed-system-architectures-and-architectural-styles-477fb8407d79?source=rss-9e6234208b78------2</link>
            <guid isPermaLink="false">https://medium.com/p/477fb8407d79</guid>
            <dc:creator><![CDATA[Sanduni Mayadunna]]></dc:creator>
            <pubDate>Sun, 03 Sep 2023 16:24:26 GMT</pubDate>
            <atom:updated>2023-09-03T16:43:09.251Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wJXoUi-OdVcMRaQA.jpeg" /></figure><h3><strong>Introduction</strong></h3><p>In today’s fast-paced digital landscape, the demand for scalable, reliable, and high-performing systems has never been greater. Distributed system architectures have emerged as the cornerstone of modern software engineering, enabling organizations to meet these demands effectively. In this blog post, we’ll embark on a journey through the intricate world of distributed system architectures and explore the various architectural styles that underpin them.</p><h3>What is a Distributed System</h3><p>A distributed system is a software system that interconnects a collection of heterogeneous independent computers, where coordination and communication between computers only happen through message passing, with the intention of working towards a common goal. The idea behind distributed systems is to provide a viewpoint of being a single coherent system, to the outside world. So, the set of independent computers or nodes are interconnected through a Local Area Network (LAN) or a Wide Area Network (WAN).</p><h3>Distributed System Architectures</h3><p>In this blog, I would like to talk about the available Distributed System architectures that we see today and how they are being utilized in our day to day applications. Distributed system architectures are bundled up with components and connectors. Components can be individual nodes or important components in the architecture whereas connectors are the ones that connect each of these components.</p><ul><li>Component: A modular unit with well-defined interfaces; replaceable; reusable</li><li>Connector: A communication link between modules which mediates coordination or cooperation among components</li></ul><p>So the idea behind distributed architectures is to have these components presented on different platforms, where components can communicate with each other over a communication network in order to achieve specifics objectives.</p><h3>Architectural Styles</h3><p>There are four different architectural styles, plus the hybrid architecture, when it comes to distributed systems. The basic idea is to organize logically different components, and distribute those computers over the various machines.</p><ul><li>Layered Architecture</li><li>Object Based Architecture</li><li>Data-centered Architecture</li><li>Event Based Architecture</li><li>Hybrid Architecture</li></ul><p><strong>Layered Architecture</strong></p><p>The layered architecture separates layers of components from each other, giving it a much more modular approach. A well known example for this is the OSI model that incorporates a layered architecture when interacting with each of the components. Each interaction is sequential where a layer will contact the adjacent layer and this process continues, until the request is been catered to. But in certain cases, the implementation can be made so that some layers will be skipped, which is called cross-layer coordination. Through cross-layer coordination, one can obtain better results due to performance increase.</p><p>The layers on the bottom provide a service to the layers on the top. The request flows from top to bottom, whereas the response is sent from bottom to top. The advantage of using this approach is that, the calls always follow a predefined path, and that each layer can be easily replaced or modified without affecting the entire architecture. The following image is the basic idea of a layered architecture style.</p><p>The image given below, represents the basic architecture style of a distributed system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*C6GaXrxm0fTDC0_i.png" /></figure><p><strong>Object Based Architecture</strong></p><p>This architecture style is based on loosely coupled arrangement of objects. This has no specific architecture like layers. Like in layers, this does not have a sequential set of steps that needs to be carried out for a given call. Each of the components are referred to as objects, where each object can interact with other objects through a given connector or interface. These are much more direct where all the different components can interact directly with other components through a direct method call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*UVLLW8ci6aRzQJ4W.png" /></figure><p>As shown in the above image, communication between object happen as method invocations. These are generally called Remote Procedure Calls (RPC). Some popular examples are Java RMI, Web Services and REST API Calls. This has the following properties.</p><ul><li>This architecture style is less structured.</li><li>component = object</li><li>connector = RPC or RMI</li></ul><p>When decoupling these processes in space, people wanted the components to be anonymous and replaceable. And the synchronization process needed to be asynchronous, which has led to <strong>Data Centered Architectures </strong>and <strong>Event Based Architectures</strong>.</p><p><strong>Data Centered Architecture</strong></p><p>As the title suggests, this architecture is based on a data center, where the primary communication happens via a central data repository. This common repository can be either active or passive. This is more like a producer consumer problem. The producers produce items to a common data store, and the consumers can request data from it. This common repository, could even be a simple database. But the idea is that, the communication between objects happening through this shared common storage. This supports different components (or objects) by providing a persistent storage space for those components (such as a MySQL database). All the information related to the nodes in the system are stored in this persistent storage. In event-based architectures, data is only sent and received by those components who have already subscribed.</p><p>Some popular examples are distributed file systems, producer consumer, and web based data services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*F_Hg-HyktGfUfQYV.png" /></figure><p><strong>Event Based Architecture</strong></p><p>The entire communication in this kind of a system happens through events. When an event is generated, it will be sent to the bus system. With this, everyone else will be notified telling that such an event has occurred. So, if anyone is interested, that node can pull the event from the bus and use it. Sometimes these events could be data, or even URLs to resources. So the receiver can access whatever the information is given in the event and process accordingly. processes communicate through the propagation of events.</p><p>These events occasionally carry data. An advantage in this architectural style is that, components are loosely coupled. So it is easy to add, remove and modify components in the system. Some examples are, publisher — subscriber system, Enterprise Services Bus (ESB).</p><p>One major advantage is that, these heterogeneous components can contact the bus, through any communication protocol. But an ESB or a specific bus, has the capability to handle any type of incoming request and process accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*t5gobHpQ2wPelKjJ.png" /></figure><p>This architectural style is based on the publisher-subscriber architecture. Between each node there is no direct communication or coordination. Instead, objects which are subscribed to the service communicate through the event bus.</p><p>The event based architecture supports, several communication styles.</p><ul><li>Publisher-subscriber</li><li>Broadcast</li><li>Point-to-Point</li></ul><p>The major advantages of this architecture is that the <em>Components are decoupled in space — loosely coupled.</em></p><h3>System Level Architecture</h3><p>The two major system level architectures that we use today are <strong>Client-server</strong> and <strong>Peer-to-peer</strong> (P2P). We use these two kinds of services in our day to day lives, but the difference between these two are often misinterpreted.</p><p><strong>Client Server Architecture</strong></p><p>The client server architecture has two major components. The client and the server. The Server is where all the processing, computing and data handling is happening, whereas the Client is where the user can access the services and resources given by the Server (Remote Server). The clients can make requests from the Server, and the Server will respond accordingly. Generally, there is only one server that handles the remote side. But to be on the safe side, we do use multiple servers will load balancing techniques.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*qRRsDoZ_lWwFOgQ5.jpg" /></figure><p>As one common design feature, the Client Server architecture has a centralized security database. This database contains security details like credentials and access details. Users can’t log in to a server, without the security credentials. So, it makes this architecture a bit more stable and secure than Peer to Peer. The stability comes where the security database can allow resource usage in a much more meaningful way. But on the other hand, the system might get low, as the server only can handle a limited amount of workload at a given time.</p><p><strong>Advantages:</strong></p><ul><li>Easier to Build and Maintain</li><li>Better Security</li><li>Stable</li></ul><p><strong>Disadvantages:</strong></p><ul><li>Single point of failure</li><li>Less scalable</li></ul><p><strong>Peer to Peer (P2P)</strong></p><p>The general idea behind peer to peer is where there is no central control in a distributed system. The basic idea is that, each node can either be a client or a server at a given time. If the node is requesting something, it can be known as a client, and if some node is providing something, it can be known as a server. In general, each node is referred to as a Peer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*qQGxabNk47jV4Bk7.png" /></figure><p>In this network, any new node has to first join the network. After joining in, they can either request a service or provide a service. The initiation phase of a node (Joining of a node), can vary according to implementation of a network. There are two ways in how a new node can get to know, what other nodes are providing.</p><ul><li><strong>Centralized Lookup Server </strong>— The new node has to register with the centralized look up server an mention the services it will be providing, on the network. So, whenever you want to have a service, you simply have to contact the centralized look up server and it will direct you to the relevant service provider.</li></ul><p><strong>. Decentralized System</strong> — A node desiring for specific services must, broadcast and ask every other node in the network, so that whoever is providing the service will respond.</p><p><strong>A Comparison Between Client Server and Peer to Peer Architectures</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/0*b1tTqWdTJm3ZN1Rb.png" /></figure><h3>Centralized vs Decentralized Architectures</h3><p>The two main structures that we see within distributed system overlays are Centralized and Decentralized architectures. The centralized architecture can be explained by a simple client-server architecture where the server acts as a central unit. This can also be considered as centralized look up table with the following characteristics.</p><ul><li>Low overhead</li><li>Single point of failure</li><li>Easy to Track</li><li>AdditionalOverhead.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*soJfhCcfOYSrTVJY.jpg" /></figure><p>When it comes to distributed systems, we are more interested in studying more on the overlay and unstructured network topologies that we can see today. In general, the peer to peer systems that we see today can be separated into three unique sections.</p><ul><li><strong>Structured P2P</strong>: nodes are organized following a specific distributed data structure</li><li><strong>Unstructured P2P</strong>: nodes have randomly selected neighbors</li><li><strong>Hybrid P2P</strong>: some nodes are appointed special functions in a well-organized fashion</li></ul><p><strong>Structured P2P Architecture</strong></p><p>The meaning of the word structured is that the system already has a predefined structure that other nodes will follow. Every structured network inherently suffers from poor scalability, due to the need for structure maintenance. In general, the nodes in a structured overlay network are formed in a logical ring, with nodes being connected to the this ring. In this ring, certain nodes are responsible for certain services.</p><p>A common approach that can be used to tackle the coordination between nodes, is to use distributed hash tables (DHTs). A traditional hash function converts a unique key into a hash value, that will represent an object in the network. The hash function value is used to insert an object in the hash table and to retrieve it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*2MCGN9FZ89TyHtpT.png" /></figure><p>In a DHT, each key is assigned to a unique hash, where the random hash value needs to be of a very large address space, in order to ensure uniqueness. A mapping function is being used to assign objects to nodes based on the hash function value. A look up based on the hash function value, returns the network address of the node that stores the requested object.</p><ul><li><strong>Hash Function</strong>: Takes a key and produces a unique hash value</li><li><strong>Mapping Function</strong>: Map the hash value to a specific node in the system</li><li><strong>Lookup table</strong>: Return the network address of the node represented by the unique hash value.</li></ul><p><strong>Unstructured P2P Systems</strong></p><p>There is no specific structure in these systems, hence the name “unstructured networks”. Due to this reason, the scalability of the unstructured p2p systems is very high. These systems rely on randomized algorithms for constructing an overlay network. As in structured p2p systems, there is no specific path for a certain node. It’s generally random, where every unstructured system tried to maintain a random path. Due to this reason, the search of a certain file or node is never guaranteed in unstructured systems.</p><p>The basic principle is that each node is required to randomly select another node, and contact it.</p><ul><li>Let each peer maintain a partial view of the network, consisting of n other nodes</li><li>Each node P periodically selects a node Q from its partial view</li><li>P and Q exchange information and exchange members from their respective partial views</li></ul><p><strong>Hybrid P2P Systems</strong></p><p>Hybrid systems are often based on both client server architectures and p2p networks. A famous example is Bittorrent, which we use everyday. The torrent search engines provide a client server architecture, where the trackers provide a structured p2p overlay. The rest of nodes, which are also known as leechers and seeders, become the unstructured overlay of the network, allowing it to scale itself as needed and further. More on how Bittorrent works in the distributed context, will be written in a future blog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*sRhBAHobULD3UK0G.png" /></figure><h3>Summary on Structured and Unstructured P2P Systems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*-pL6oG3cECVVrSQm.png" /></figure><h3>Selecting the Right Architecture</h3><p>Choosing the appropriate architectural style for a distributed system depends on several factors:</p><ol><li>System Goals: What are you trying to achieve with your distributed system? Is it a web application, a data processing pipeline, or something else entirely?</li><li>Scalability Needs: Does your system need to handle variable workloads? If so, how easily can it scale up or down?</li><li>Fault Tolerance: How critical is it for your system to continue functioning in the face of hardware failures or network issues?</li><li>Development Team Expertise: What architectural style aligns with the skills and experience of your development team?</li><li>Cost and Resource Constraints: What are your budgetary and resource limitations?</li><li>Interoperability Requirements: Does your system need to interact with other systems or services?</li></ol><p>There is no one-size-fits-all solution, and hybrid approaches often emerge to address specific use cases. It’s crucial to carefully evaluate your project’s unique requirements and constraints before making an architectural decision.</p><h3><strong>Conclusion</strong></h3><p>Distributed system architectures are the backbone of modern software engineering, enabling organizations to build scalable, reliable, and high-performing systems. Understanding the various architectural styles available is crucial for making informed design decisions. Whether you opt for a client-server model, embrace microservices, or explore other styles, the key lies in aligning the architecture with the unique requirements of your distributed system. By doing so, you can navigate the maze of distributed systems and architect systems that meet the demands of the digital age.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=477fb8407d79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s a Software Design Pattern?]]></title>
            <link>https://medium.com/@sandunisandathika98/whats-a-software-design-pattern-f928af339cc5?source=rss-9e6234208b78------2</link>
            <guid isPermaLink="false">https://medium.com/p/f928af339cc5</guid>
            <dc:creator><![CDATA[Sanduni Mayadunna]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 16:30:46 GMT</pubDate>
            <atom:updated>2023-08-24T18:39:22.855Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TFmI7OFvgiQe5Gcv.png" /></figure><h3>Introduction</h3><p>In Computer Science, a software design pattern is a reusable, generic solution to a most commonly occurring problem within a given context in software design. It is not a complete design which can get transformed directly into the source code. It is like a template for how to solve a problem that can get used in different software. Design patterns are usually best practices that the developer have to use to solve common problems while designing an application or system. Design patterns first originated as an architectural concept by Christopher Alexander in 1977.</p><p>Design pattern speeds up the development process by providing tested, proven development in first paradigms. Effective software design requires considering issues that may not become visible on the first level in the implementation. The freshly written code can often have hidden subtle issues that take time to get detected, issues that sometimes can cause major problems later on. Using design patterns helps to prevent such undetected issues, and it also improves code readability for developers who are familiar with the patterns.</p><p>In general, a pattern can get planned newly into each application that uses it. Since some authors believe that this as a step backward from software reuse as provided by components, researchers have worked to turn patterns into components. Software Design patterns give general solutions, documented in a format that is not tied to a particular problem.</p><h3>What’s a Design Pattern in Software Engineering?</h3><p>In software engineering, a software design pattern is a general, reusable solution of how to solve a common problem when designing an application or system. Unlike a library or framework, which can be inserted and used right away, a design pattern is more of a template to approach the problem at hand.</p><p>Design patterns are used to support object-oriented programming (OOP), a paradigm that is based on the concepts of both objects (instances of a class; data with unique attributes) and classes (user-defined types of data).</p><h3>Uses of Design Patterns</h3><p>Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. Reusing design patterns helps to prevent subtle issues that can cause major problems and improves code readability for coders and architects familiar with the patterns.</p><p>Often, people only understand how to apply certain software design techniques to certain problems. These techniques are difficult to apply to a broader range of problems. Design patterns provide general solutions, documented in a format that doesn’t require specifics tied to a particular problem.</p><p>In addition, patterns allow developers to communicate using well-known, well understood names for software interactions. Common design patterns can be improved over time, making them more robust than ad-hoc designs.</p><h3>23 Design Patterns in Software Development</h3><p>Design patterns can be broken down into three types, organized by their intent into creational design patterns, structural design patterns, and behavioral design patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*QwKcyqgFJ1EJI3Zd.jpg" /></figure><h3>1. Creational Design Patterns</h3><p>These software design patterns are used for object creation, initialization, and class instantiation. What type of object should be initiated, what class object is to be instanced are the few problems solved by creational software design patterns. These can be further classified into class creational and object creational software patterns. These are used to improve the code reusability and flexibility.</p><p><strong>Example</strong></p><p>Suppose we are building a game where new players are joining continuously with new names as a guest. In such a case many instances of players will be created to work as a guest, but as soon as the person closes the game the guest player instance is of no use anymore. Such instances can be stored in an object pool and can be used when a request to create a new guest player is made.</p><ul><li><strong>Factory Method</strong>: Creates objects with a common interface and lets a class defer instantiation to subclasses.</li><li><strong>Abstract Factory</strong>: Creates a family of related objects.</li><li><strong>Builder</strong>: A step-by-step pattern for creating complex objects, separating construction and representation.</li><li><strong>Prototype</strong>: Supports the copying of existing objects without code becoming dependent on classes.</li><li><strong>Singleton</strong>: Restricts object creation for a class to only one instance.</li></ul><h3>2. Structural Design Patterns</h3><p>Structural Software Design Patterns are the practices that are used for developing different compositions of classes and objects. Here, you can create new objects with new functionalities that may be a composition of two or more existing classes. They make the software more efficient and flexible.</p><p><strong>Example</strong></p><p>Suppose you are building an application where you get the input in XML format, now if you want to add a new feature to the existing application and that feature needs the data in JSON format. In such situation you can use the Adapter structural design pattern. Adapter allows the objects in an application to adapt to incompatible interfaces/formats and work together.</p><ul><li><strong>Adapter</strong>: How to change or adapt an interface to that of another existing class to allow incompatible interfaces to work together.</li><li><strong>Bridge</strong>: A method to decouple an interface from its implementation.</li><li><strong>Composite</strong>: Leverages a tree structure to support manipulation as one object.</li><li><strong>Decorator</strong>: Dynamically extends (adds or overrides) functionality.</li><li><strong>Façade</strong>: Defines a high-level interface to simplify the use of a large body of code.</li><li><strong>Flyweight</strong>: Minimize memory use by sharing data with similar objects.</li><li><strong>Proxy</strong>: How to represent an object with another object to enable access control, reduce cost and reduce complexity.</li></ul><h3>3. Behavioral Design Patterns</h3><p>Behavioral software design patterns are the patterns associated with the communication between objects. These are the patterns that are concerned with the responsibility assigned to objects. By using these patterns, you can get flexibility in communication.</p><p><strong>Example</strong></p><p>Suppose we are building an application where we have a lot of components and there are components inside other components. In such applications when we want to access an information then we can use a chain of responsibility that reachs the outermost component first and then moves inner and inner until it reaches the desired component.</p><ul><li><strong>Chain of Responsibility</strong>: A method for commands to be delegated to a chain of processing objects.</li><li><strong>Command</strong>: Encapsulates a command request in an object.</li><li><strong>Interpreter</strong>: Supports the use of language elements within an application.</li><li><strong>Iterator</strong>: Supports iterative (sequential) access to collection elements.</li><li><strong>Mediator</strong>: Articulates simple communication between classes.</li><li><strong>Memento</strong>: A process to save and restore the internal/original state of an object.</li><li><strong>Observer</strong>: Defines how to notify objects of changes to other object(s).</li><li><strong>State</strong>: How to alter the behavior of an object when its stage changes.</li><li><strong>Strategy</strong>: Encapsulates an algorithm inside a class.</li><li><strong>Visitor</strong>: Defines a new operation on a class without making changes to the class.</li><li><strong>Template Method</strong>: Defines the skeleton of an operation while allowing subclasses to refine certain steps.</li></ul><p>n summary, these three categories of design patterns serve distinct purposes in software design:</p><ul><li>Structural patterns focus on object composition and relationships.</li><li>Creational patterns focus on object creation mechanisms and instantiation.</li><li>Behavioral patterns focus on interactions and collaborations between objects to accomplish tasks.</li></ul><h3>7 Best Software Design Patterns</h3><p>Although there are 23 design patterns listed in Design Patterns<em>: </em>Elements of<em> </em>Reusable Object-Oriented Software<em>,</em> of those there are 7 that are considered the most influential or important. This section outlines the 7 best software design patterns, why they are important, and when to use them.</p><h3>1. Singleton Design Pattern</h3><p>The singleton design pattern falls under the “creational” type, restricting object creation for a class to only one instance and providing global access to a global variable. For example, many web developers lock up the “sitemap” to a single version that has global scope. Further, other patterns such as factory method, builder, prototype can use singletons. Facade and state objects are also often singletons.</p><p>While you may only have or need one instance of a class, this does not necessarily mean that is the time to use a singleton pattern to lock that object up or to force it into a global state. Singletons are a controversial design pattern, with some even arguing that singletons are an antipattern to be avoided because locking up an object restricts future flexibility.</p><p><strong><em>Real-world analogy</em></strong>: President’s Office Key Explanation: Just like there’s only one key to access the President’s office, the Singleton pattern ensures that a class has only one instance and provides a global point of access to it. This can be useful for managing resources that should be shared across the entire application, such as a database connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*0PgArCjPMeDzqsDn.png" /></figure><pre>class Singleton:<br>    _instance = None<br>    <br>    def __new__(cls):<br>        if cls._instance is None:<br>            cls._instance = super().__new__(cls)<br>            cls._instance.value = None<br>        return cls._instance<br><br># Usage<br>instance1 = Singleton()<br>instance2 = Singleton()<br><br>instance1.value = &quot;Hello&quot;<br>print(instance2.value)  # Outputs: Hello<br>print(instance1 == instance2)  # Outputs: True</pre><p>In this example, the Singleton class ensures that only one instance of itself can be created. The _instance attribute keeps track of the single instance that has been created. The __new__ method is used to control the instantiation process and returns the existing instance if it already exists, or creates a new instance if it doesn&#39;t.</p><p>Both instance1 and instance2 point to the same object, and changes made to one instance are reflected in the other since they are essentially the same instance. The last print statement demonstrates that instance1 and instance2 are referring to the same object.</p><p>Please note that in Python, the Singleton pattern is not always necessary or recommended due to the Global Interpreter Lock (GIL) and other considerations. Using dependency injection or passing instances explicitly might be a more flexible approach in many cases.</p><p>Advantages:</p><p>1.Single Instance: The primary advantage of the Singleton pattern is that it ensures there’s only one instance of the class. This can be useful when you want to control access to shared resources or maintain a single point of control for a particular functionality.</p><p>2.Global Access: The Singleton instance is globally accessible. This can be beneficial when you need to provide a central point of access for operations that affect the entire application.</p><p>3.Lazy Initialization: Singleton instances can be initialized lazily, meaning they are created only when they are first needed. This can help optimize memory usage and improve performance.</p><p>4.Reduces Resource Consumption: Since there’s only one instance, the Singleton pattern helps reduce resource consumption by preventing multiple instances from being created unnecessarily.</p><p>5.Thread Safety: Properly implemented, the Singleton pattern can handle multi-threading scenarios and provide a thread-safe instance creation mechanism.</p><p>Disadvantages:</p><p>1.Global State: The Singleton pattern introduces a global point of access, which can lead to global state. Global state can make the code harder to understand, test, and maintain, as it’s not always clear where and when the Singleton instance is being modified.</p><p>2.Dependency Injection: Singleton can make it difficult to use dependency injection effectively. Since the instance is created and managed internally, it can hinder the ability to inject different instances for testing or alternate implementations.</p><p>3.Testing Challenges: Singleton instances can be hard to mock or substitute during testing. This can make it more challenging to isolate parts of the system for unit testing.</p><p>4.Tight Coupling: Code that relies heavily on Singleton instances can become tightly coupled, making it harder to change or refactor parts of the system without affecting other parts.</p><p>5.Concurrency Concerns: While Singleton patterns can be made thread-safe, implementing thread safety can be complex, and improper implementation might lead to subtle bugs related to concurrency.</p><p>6.Limited Extensibility: Singleton instances are often difficult to extend to support multiple instances if the need arises later in the development process.</p><p>7.Violation of Single Responsibility Principle: Depending on its implementation, a Singleton instance might end up handling multiple responsibilities, violating the Single Responsibility Principle.</p><h3>2. Factory Method Design Pattern</h3><p>In the factory method, a “creation” design pattern, developers create objects with a common interface but allow a class defer instantiation to subclasses. The factory method promotes loose coupling and code reuse, a “virtual constructor” that works with any class implementing the interface and allowing greater freedom for the sub-classes to choose the objects being created. When new classes are needed, they can be added to the factory.</p><p>The factory method is not appropriate for simple scenarios, an instance where developers risk over-complicating processes in order to use a design pattern.</p><p><strong><em>Real-world analogy:</em></strong> Car Manufacturing Plant Explanation: In a car manufacturing plant, different models of cars are produced, each following a predefined process. Similarly, the Factory Method pattern allows creating objects of different classes that all implement a common interface. This is useful when you want to delegate the creation logic to subclasses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*wFvvGtrZux6eCrb-.jpg" /></figure><pre>from abc import ABC, abstractmethod<br><br># Abstract Product<br>class Animal(ABC):<br>    @abstractmethod<br>    def speak(self):<br>        pass<br><br># Concrete Products<br>class Dog(Animal):<br>    def speak(self):<br>        return &quot;Woof!&quot;<br><br>class Cat(Animal):<br>    def speak(self):<br>        return &quot;Meow!&quot;<br><br># Abstract Creator<br>class AnimalCreator(ABC):<br>    @abstractmethod<br>    def create_animal(self):<br>        pass<br><br># Concrete Creators<br>class DogCreator(AnimalCreator):<br>    def create_animal(self):<br>        return Dog()<br><br>class CatCreator(AnimalCreator):<br>    def create_animal(self):<br>        return Cat()<br><br># Client code<br>def get_animal_speech(animal_creator):<br>    animal = animal_creator.create_animal()<br>    return animal.speak()<br><br># Usage<br>dog_creator = DogCreator()<br>cat_creator = CatCreator()<br><br>print(get_animal_speech(dog_creator))  # Outputs: Woof!<br>print(get_animal_speech(cat_creator))  # Outputs: Meow!</pre><p>In this example, the Factory Method design pattern is used to create instances of different types of animals. The Animal class is an abstract class that defines the interface for the products (different types of animals) to implement. The Dog and Cat classes are concrete implementations of the Animal interface.</p><p>The AnimalCreator is an abstract creator class that defines the factory method create_animal(), which the concrete creator classes (DogCreator and CatCreator) override to create specific animal instances.</p><p>The client code (get_animal_speech) takes an AnimalCreator as an argument and uses the factory method to create an animal instance and retrieve its speech.</p><p>This pattern allows for easy extension with new types of animals (new concrete products) and new creators without modifying existing code.</p><p>Advantages:</p><ol><li>Decoupling: The Factory Method pattern decouples the client code from the specific classes it creates. Clients interact with the factory interface, not with concrete classes, reducing dependencies and enhancing flexibility.</li><li>Extensibility: The pattern supports easy addition of new product classes without modifying existing code. By creating a new factory subclass, you can introduce new products without altering the client code.</li><li>Open-Closed Principle: The Factory Method pattern adheres to the Open-Closed Principle, as you can extend functionality without modifying existing code. You can add new products or variations without affecting the client.</li><li>Dependency Inversion: The pattern promotes dependency inversion, as client code depends on abstractions (the factory interface) rather than concrete implementations.</li><li>Code Reusability: Factories can be reused across different parts of the application or even in different projects, reducing code duplication.</li><li>Controlled Object Creation: Factory methods centralize the creation process, allowing you to apply consistent instantiation logic, validation, or customization to objects.</li></ol><p>Disadvantages:</p><ol><li>Increased Complexity: Implementing the Factory Method pattern can lead to an increase in the number of classes and abstraction layers, potentially making the code more complex and harder to understand.</li><li>Additional Classes: For every product type, you need to create a corresponding factory class, which can lead to a proliferation of classes in larger applications.</li><li>Learning Curve: Developers new to the Factory Method pattern might require time to understand the concepts and correctly implement the pattern.</li><li>Indirection: The pattern introduces an extra layer of indirection between the client code and the created objects, which can affect the code’s readability and traceability.</li><li>Maintenance Overhead: With the introduction of factory classes, maintenance might involve managing not only product classes but also corresponding factories.</li><li>Increased Abstraction: Depending on the structure of the pattern, it might introduce additional levels of abstraction, making it harder to see the direct relationships between classes.</li><li>Creation Complexity: In scenarios where the creation logic is simple and unlikely to change, using the Factory Method pattern might introduce unnecessary complexity.</li></ol><h3><strong>3. Facade Design Pattern</strong></h3><p>The facade design pattern is a “structural” design pattern that helps provide one interface (class) for access to a large body of code / various objects. A facade hides complexities of various sub-systems (often organized into a class) with a simple interface. For example, an eCommerce customer only wants one point of interacting with a brand, rather than individually communicating (interfacing) with each system to support the sale such as product inventory, authentication, security, payment processing, order fulfillment, etc. In this case, the Facade has encapsulated all the “order” activities and systems to provide a single interface — the customer remains completely unaware of what’s going on behind the scenes. Facade is an important concept to support the loosely coupled microservices architecture.</p><p><strong><em>Real-world analogy:</em></strong> Smartphone Explanation: A smartphone has a user-friendly interface (the screen) that hides the complex internal workings (processors, memory, software). The Facade pattern provides a simplified interface to a complex system, making it easier for clients to interact with it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/0*oau9m1VpTvLdXaK5.png" /></figure><pre># Complex subsystems<br>class SubsystemA:<br>    def operation_a(self):<br>        return &quot;Subsystem A operation&quot;<br><br>class SubsystemB:<br>    def operation_b(self):<br>        return &quot;Subsystem B operation&quot;<br><br>class SubsystemC:<br>    def operation_c(self):<br>        return &quot;Subsystem C operation&quot;<br><br># Facade<br>class Facade:<br>    def __init__(self):<br>        self.subsystem_a = SubsystemA()<br>        self.subsystem_b = SubsystemB()<br>        self.subsystem_c = SubsystemC()<br><br>    def operation(self):<br>        results = []<br>        results.append(self.subsystem_a.operation_a())<br>        results.append(self.subsystem_b.operation_b())<br>        results.append(self.subsystem_c.operation_c())<br>        return &quot;\n&quot;.join(results)<br><br># Client code<br>def client_code(facade):<br>    print(facade.operation())<br><br># Usage<br>facade = Facade()<br>client_code(facade)</pre><p>In this example, the Facade design pattern is used to provide a simplified interface to a complex system composed of multiple subsystems (SubsystemA, SubsystemB, SubsystemC). The Facade class encapsulates the interaction with these subsystems, providing a single interface for the client code to interact with.</p><p>The client code (client_code) takes a Facade instance and uses it to perform operations on the subsystems without needing to interact with them directly. This simplifies the usage of the complex system and hides its internal details.</p><p>The Facade pattern is particularly useful when dealing with complex systems, APIs, or libraries where there are many intricate interactions between components. It promotes a cleaner and more organized codebase by providing a high-level interface for common tasks.</p><p><strong>Advantages:</strong></p><ol><li>Simplifies Client Interaction: The primary advantage of the Facade pattern is that it simplifies the interaction between clients and a complex system. Clients only need to interact with the facade’s simple interface, hiding the intricacies of the underlying subsystem.</li><li>Abstraction of Complexity: The pattern abstracts the complex interactions and dependencies among subsystem classes, allowing clients to work with a high-level, easy-to-understand interface.</li><li>Encapsulation: Facades encapsulate the complex logic and interactions within the subsystem, promoting separation of concerns and modular design.</li><li>Reduced Dependency: Clients only depend on the facade class, reducing their dependency on individual components of the subsystem. This enhances decoupling and minimizes the impact of changes to the subsystem.</li><li>Code Organization: The pattern promotes better organization of code by centralizing complex interactions within a single facade class. This improves code readability and maintainability.</li><li>Ease of Use: Facades provide a user-friendly interface that is tailored to the needs of specific clients, enhancing the usability of the system.</li></ol><p><strong>Disadvantages:</strong></p><ol><li>Limited Flexibility: The Facade pattern might limit the flexibility of clients that require more fine-grained control over interactions with the subsystem. Advanced clients may find the facade’s simplified interface restrictive.</li><li>Introducing a Single Point of Failure: Since clients interact primarily with the facade, any issues or changes to the facade could impact a large portion of the application.</li><li>Maintenance Overhead: If the subsystem’s components change frequently, the facade might need to be updated to reflect these changes. This could introduce maintenance challenges.</li><li>Potential for Bloat: Over time, the facade might accumulate additional methods to cater to different client needs. This could lead to a bloated facade class that deviates from its original intent.</li><li>Misalignment with SOLID Principles: Depending on how it’s implemented, the Facade pattern might violate the Single Responsibility Principle if the facade takes on too many responsibilities.</li><li>Increased Indirection: The introduction of a facade adds another layer of indirection between clients and the actual subsystem, which could impact performance and traceability.</li></ol><h3>4. Strategy Design Pattern</h3><p>The strategy design pattern is a “behavioral” software design pattern that is sometimes known as a policy pattern. In the strategy pattern, interchangeable algorithms are encapsulated together into a “family” with one of the algorithms being selected at runtime as needed. For example, a family of algorithms may be related to “sorting” products in an <a href="https://www.netsolutions.com/hub/digital-commerce">eCommerce</a> website — by size, colour, prize, etc. The strategy is implemented based upon the actions of the customer.</p><p>The strategy design pattern is incredibly powerful in personalization marketing strategies, responding to client location, inputs, or actions in order to deliver a different experience to each user.</p><p><strong><em>Real-world analogy:</em></strong> Payment Options Explanation: When you make a payment, you can choose between different payment methods like credit card, PayPal, or cash. The Strategy pattern allows you to select a behavior (strategy) from a family of interchangeable behaviors, making it easy to switch between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*qtWKvQODlwG0N4Lo.jpg" /></figure><pre>from abc import ABC, abstractmethod<br><br># Strategy interface<br>class PaymentStrategy(ABC):<br>    @abstractmethod<br>    def pay(self, amount):<br>        pass<br><br># Concrete strategies<br>class CreditCardPayment(PaymentStrategy):<br>    def __init__(self, card_number, expiry_date):<br>        self.card_number = card_number<br>        self.expiry_date = expiry_date<br>    <br>    def pay(self, amount):<br>        return f&quot;Paid ${amount} using credit card {self.card_number}&quot;<br><br>class PayPalPayment(PaymentStrategy):<br>    def __init__(self, email):<br>        self.email = email<br>    <br>    def pay(self, amount):<br>        return f&quot;Paid ${amount} using PayPal account {self.email}&quot;<br><br># Context<br>class ShoppingCart:<br>    def __init__(self, payment_strategy):<br>        self.items = []<br>        self.payment_strategy = payment_strategy<br>    <br>    def add_item(self, item):<br>        self.items.append(item)<br>    <br>    def calculate_total(self):<br>        return sum(item.price for item in self.items)<br>    <br>    def checkout(self):<br>        total = self.calculate_total()<br>        return self.payment_strategy.pay(total)<br><br># Usage<br>credit_card_payment = CreditCardPayment(&quot;1234-5678-9012-3456&quot;, &quot;12/25&quot;)<br>paypal_payment = PayPalPayment(&quot;example@example.com&quot;)<br><br>cart1 = ShoppingCart(credit_card_payment)<br>cart1.add_item(Item(&quot;Item 1&quot;, 50))<br>cart1.add_item(Item(&quot;Item 2&quot;, 30))<br>print(cart1.checkout())<br><br>cart2 = ShoppingCart(paypal_payment)<br>cart2.add_item(Item(&quot;Item 3&quot;, 20))<br>print(cart2.checkout())</pre><p>In this example, the Strategy design pattern is used to implement different payment strategies (CreditCardPayment and PayPalPayment) that can be used interchangeably. The PaymentStrategy interface defines the common method pay that concrete strategies must implement.</p><p>The ShoppingCart class represents the context in which the payment strategies are used. It takes a payment strategy as a parameter and uses it to process payments during checkout. This allows you to switch between different payment methods without changing the ShoppingCart class itself.</p><p>The Strategy pattern is useful when you have multiple algorithms or behaviors that can be selected and swapped out at runtime. It promotes flexibility and allows for easier maintenance and extension of your codebase.</p><p><strong>Advantages:</strong></p><ol><li>Flexibility: One of the main advantages of the Strategy pattern is its flexibility. It allows you to switch between different algorithms or strategies at runtime without changing the client code. This is particularly useful when you need to accommodate varying requirements or preferences.</li><li>Modularity: By encapsulating each algorithm or strategy in its own class, the Strategy pattern promotes modularity and separation of concerns. This makes the codebase more organized and easier to maintain.</li><li>Single Responsibility Principle: The pattern adheres to the Single Responsibility Principle by ensuring that each strategy class focuses on a specific algorithm, promoting clear and maintainable code.</li><li>Code Reusability: Strategies can be reused across different parts of the application or even in different projects. This promotes code reuse and consistency.</li><li>Ease of Testing: Strategies can be tested independently, which simplifies unit testing and ensures that each algorithm functions correctly.</li><li>Open-Closed Principle: The Strategy pattern supports the Open-Closed Principle, allowing you to add new strategies without modifying existing client code.</li></ol><p><strong>Disadvantages:</strong></p><ol><li>Increased Number of Classes: The Strategy pattern can lead to an increase in the number of classes, as each strategy requires its own class. This could potentially make the codebase more complex.</li><li>Indirection: The introduction of strategy classes adds an extra layer of indirection between the client and the actual algorithm being executed. This can slightly impact performance and code traceability.</li><li>Learning Curve: Developers new to the Strategy pattern might require time to understand the concepts and implement the pattern correctly.</li><li>Runtime Overhead: Switching between different strategies at runtime could introduce a small runtime overhead, as the client must interact with the context and the selected strategy.</li><li>Complexity for Simple Problems: For simple problems that don’t require multiple interchangeable algorithms, using the Strategy pattern might introduce unnecessary complexity.</li><li>Overhead for Small Projects: In small projects with a limited number of strategies, the overhead of creating separate strategy classes might outweigh the benefits of flexibility.</li><li>Maintenance of Strategy Classes: If strategies change frequently or need maintenance, managing a larger number of strategy classes could become challenging.</li></ol><h3>5. Observer Design Pattern</h3><p>The observer design pattern is “behavioral,” linking an object (subject) to dependents (observers) in a one-to-many pattern. When any of the observers change, the subject is notified. The observer design pattern is useful in any kind of event-driven programming such as notifying a user of a new comment on Facebook, sending an email when an item ships, etc.</p><p><strong><em>Real-world analogy:</em></strong> Newspaper Subscriptions Explanation: When you subscribe to a newspaper, you’re an observer. The newspaper publisher notifies you whenever a new issue is available. Similarly, the Observer pattern lets an object (the subject) notify its dependents (observers) about changes, ensuring that multiple objects stay in sync.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*Q5SihW0sjNw3xUbI.jpg" /></figure><pre>class Observer:<br>    def update(self, message):<br>        pass<br><br>class ConcreteObserver(Observer):<br>    def __init__(self, name):<br>        self.name = name<br>    <br>    def update(self, message):<br>        print(f&quot;{self.name} received message: {message}&quot;)<br><br>class Subject:<br>    def __init__(self):<br>        self._observers = []<br>    <br>    def attach(self, observer):<br>        self._observers.append(observer)<br>    <br>    def detach(self, observer):<br>        self._observers.remove(observer)<br>    <br>    def notify(self, message):<br>        for observer in self._observers:<br>            observer.update(message)<br><br># Usage<br>subject = Subject()<br><br>observer1 = ConcreteObserver(&quot;Observer 1&quot;)<br>observer2 = ConcreteObserver(&quot;Observer 2&quot;)<br><br>subject.attach(observer1)<br>subject.attach(observer2)<br><br>subject.notify(&quot;Hello observers!&quot;)<br><br>subject.detach(observer1)<br><br>subject.notify(&quot;Observer 1 detached&quot;)<br><br></pre><p>In this example, the Observer design pattern is demonstrated. The Observer interface defines the update method that concrete observers must implement. The ConcreteObserver class is a concrete implementation of the observer, and it holds a name to identify each observer.</p><p>The Subject class represents the subject being observed. It has methods to attach, detach, and notify observers. When something of interest happens within the subject (in this case, a message is sent), it notifies all attached observers, calling their update methods.</p><p>The client code creates a subject and two concrete observers. It attaches the observers to the subject and then notifies them. Later, it detaches one observer and notifies the remaining observer.</p><p>The Observer pattern is particularly useful in situations where an object needs to notify multiple other objects about changes without tightly coupling the subject and observers together.</p><p><strong>Advantages:</strong></p><ol><li>Loose Coupling: The Observer pattern promotes loose coupling between the subject (observable) and its observers. Observers are only aware of the subject’s interface, not its internal details.</li><li>Modular Design: Observers are separate entities from the subject. This modular design makes it easier to add new observers without modifying the subject or other observers.</li><li>Separation of Concerns: The pattern separates concerns between the subject and its observers, promoting a cleaner and more maintainable codebase.</li><li>Dynamic Binding: Observers can be attached or detached dynamically at runtime, allowing for flexible and dynamic updates based on changing requirements.</li><li>One-to-Many Relationship: The Observer pattern handles one-to-many relationships, where a single change in the subject can affect multiple observers simultaneously.</li><li>Broadcasting Updates: The pattern facilitates broadcasting updates to multiple observers in a straightforward manner.</li><li>Open-Closed Principle: The Observer pattern supports the Open-Closed Principle, allowing you to introduce new observers without modifying the existing subject or observer code.</li></ol><p><strong>Disadvantages:</strong></p><ol><li>Unexpected Updates: If observers are not carefully managed, changes in the subject might lead to unexpected updates in observers, causing performance issues or unintended behavior.</li><li>Memory Leaks: If observers are not detached properly when they are no longer needed, memory leaks can occur, especially in long-running applications.</li><li>Ordering of Notifications: The order in which observers are notified might be crucial in certain scenarios. Managing the order of notifications can introduce complexity.</li><li>Debugging Challenges: In complex systems, debugging issues related to notifications and updates can be challenging due to the distributed nature of the pattern.</li><li>Potential for Spaghetti Code: Without proper organization, the pattern can lead to excessive interdependencies between subjects and observers, leading to a form of spaghetti code.</li><li>Potential for Performance Impact: The pattern could introduce a performance overhead, especially if there are a large number of observers to notify.</li><li>Implicit Dependencies: The subject might become dependent on the observers’ implementations, potentially leading to code maintenance challenges when changing or adding observers.</li></ol><h3><strong>6. Builder Design Pattern</strong></h3><p>The builder design pattern is “creational,” separating the object construction from the representation. This design pattern allows greater control over the design process (more a step-by-step), but it also decouples the representation to support multiple representations of an object using the same base construction code (the ConcreteBuilder step).</p><p>The builder pattern executes in sequential steps as the object is being built, calling only those steps that are necessary for each iteration of the object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/0*Dd1RVItgTnpUbjHp.jpg" /></figure><pre>class Computer:<br>    def __init__(self, cpu, memory, storage, gpu=None):<br>        self.cpu = cpu<br>        self.memory = memory<br>        self.storage = storage<br>        self.gpu = gpu<br>    <br>    def display_info(self):<br>        info = f&quot;CPU: {self.cpu}\nMemory: {self.memory}\nStorage: {self.storage}&quot;<br>        if self.gpu:<br>            info += f&quot;\nGPU: {self.gpu}&quot;<br>        print(info)<br><br>class ComputerBuilder:<br>    def __init__(self, cpu, memory, storage):<br>        self.computer = Computer(cpu, memory, storage)<br>    <br>    def add_gpu(self, gpu):<br>        self.computer.gpu = gpu<br>        return self<br>    <br>    def build(self):<br>        return self.computer<br><br># Usage<br>builder = ComputerBuilder(&quot;Intel i7&quot;, &quot;16GB&quot;, &quot;512GB SSD&quot;)<br>computer = builder.add_gpu(&quot;Nvidia GTX 1660&quot;).build()<br>computer.display_info()</pre><p>In this example, the Builder design pattern is used to construct a Computer object. The Computer class represents the complex object to be created.</p><p>The ComputerBuilder class is responsible for constructing the Computer object step by step. It has methods for adding optional components like a GPU. Finally, the build method is used to return the fully constructed Computer object.</p><p>This pattern is useful when the creation of a complex object involves multiple steps and configurations, and when you want to separate the construction process from the main object’s class. It also helps in creating objects with different configurations while keeping the construction logic in one place.</p><p><strong>Advantages:</strong></p><ol><li>Separation of Concerns: The Builder pattern separates the construction logic from the actual product, promoting a clear separation of concerns and enhancing modularity.</li><li>Complex Object Creation: The pattern is particularly useful for creating complex objects with many optional components. It simplifies the process of constructing such objects step by step.</li><li>Variability: The Builder pattern allows you to create different variations of a complex object using the same construction process. This is useful for creating objects with different configurations.</li><li>Readability and Maintainability: The pattern’s clear step-by-step approach makes the construction process more readable and maintainable, especially when dealing with complex object creation.</li><li>Fluent Interface: Many implementations of the Builder pattern use a fluent interface, allowing for a more expressive and concise way of configuring and creating objects.</li><li>Immutable Objects: By using the Builder pattern, you can create immutable objects, which can enhance safety and thread-safety in multi-threaded environments.</li></ol><p><strong>Disadvantages:</strong></p><ol><li>Increased Complexity: Implementing the Builder pattern can introduce additional classes and complexity, especially for objects that don’t have a complex structure.</li><li>Code Duplication: If the construction process for different variations of an object is largely similar, the Builder pattern could lead to code duplication across different builders.</li><li>Learning Curve: Developers new to the Builder pattern might require time to understand the concepts and implement the pattern correctly.</li><li>Overhead for Simple Objects: For objects with simple structures or configurations, using the Builder pattern could introduce unnecessary overhead.</li><li>Design Overhead: If the application doesn’t require multiple ways of constructing an object, introducing the Builder pattern might be considered overengineering.</li><li>Tighter Coupling: Depending on the implementation, the Builder pattern could introduce tight coupling between the director and the specific builder classes.</li><li>Potential for Inefficiency: Some implementations of the Builder pattern might result in a less efficient object creation process compared to direct construction</li></ol><h3>7. Adapter Design Pattern</h3><p>The adapter design pattern is a “wrapper” that converts one kind of interface into another existing kind of interface. The adapter design pattern helps classes work together when they are incompatible, allowing code to work together. Adapter patterns are useful to take mixed interfaces and make them a consistent API.</p><p><strong><em>Real-world analogy:</em></strong> Power Plug Adapter Explanation: When you travel to a different country, you might need an adapter to plug your devices into a different type of power outlet. The Adapter pattern allows objects with incompatible interfaces to work together. Just as the adapter converts the power plug to fit the socket, the adapter class converts one interface to another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/0*3fxrJD3vGL-JnA9s.jpg" /></figure><pre>class EuropeanSocket:<br>    def voltage(self):<br>        return 230<br><br>class USASocket:<br>    def voltage(self):<br>        return 120<br><br>class EuropeanToUSAdapter:<br>    def __init__(self, socket):<br>        self.socket = socket<br>    <br>    def voltage(self):<br>        return self.socket.voltage() / 2<br><br># Usage<br>european_socket = EuropeanSocket()<br>usa_socket = USASocket()<br><br>print(&quot;European socket voltage:&quot;, european_socket.voltage())<br>print(&quot;USA socket voltage:&quot;, usa_socket.voltage())<br><br>adapter = EuropeanToUSAdapter(european_socket)<br>print(&quot;European socket adapted to USA voltage:&quot;, adapter.voltage())</pre><p>In this example, the Adapter design pattern is used to allow a European socket to be adapted for use with a USA socket voltage. The EuropeanSocket and USASocket classes represent incompatible interfaces with different voltage levels.</p><p>The EuropeanToUSAdapter class adapts the EuropeanSocket to work with the expected USA socket voltage. It takes a EuropeanSocket instance as a parameter and adjusts the voltage accordingly.</p><p>The client code demonstrates the voltages of the original sockets and then shows how the EuropeanSocket is adapted to work with the USA voltage using the adapter.</p><p>The Adapter pattern is useful when you have two incompatible interfaces that need to work together. It allows you to create a middle layer that adapts one interface to match the expectations of the other, without modifying the existing classes.</p><p><strong>Advantages:</strong></p><ol><li>Interface Compatibility: The primary advantage of the Adapter pattern is that it enables objects with incompatible interfaces to collaborate and work together, allowing components from different systems to be integrated.</li><li>Reuse of Existing Code: The pattern allows you to reuse existing classes and components by adapting them to work with other components that have different interfaces.</li><li>Flexibility: Adapters can be created to adapt new components without altering the existing codebase, promoting flexibility and modularity.</li><li>Open-Closed Principle: The Adapter pattern supports the Open-Closed Principle by allowing you to introduce new adapters without modifying the existing client code or target objects.</li><li>Integration with Legacy Systems: The Adapter pattern is often used to integrate new components with legacy systems that have older interfaces.</li></ol><p><strong>Disadvantages:</strong></p><ol><li>Complexity: Introducing adapter classes can add complexity to the codebase, especially if there are multiple adapters involved in the system.</li><li>Performance Overhead: The additional layer introduced by the adapter can lead to a slight performance overhead due to the translation of method calls.</li><li>Increased Indirection: The Adapter pattern adds an extra layer of indirection between the client and the actual target object, which can affect code traceability and understandability.</li><li>Maintenance Overhead: As the number of adapters increases, managing and maintaining the adapters could become challenging, especially in larger systems.</li><li>Potential for Overuse: While adapters are valuable for integrating components with incompatible interfaces, overusing the pattern can lead to a proliferation of adapters and increased complexity.</li><li>Reduced Clarity: If not used carefully, the introduction of adapters can make the code less clear and harder to understand, especially for developers unfamiliar with the pattern.</li><li>Name Clashes: If there are naming conflicts between the existing code and the adapted code, managing name clashes can become challenging.</li><li>Potential for Tight Coupling: Depending on how the adapters are implemented, there’s a risk of introducing tight coupling between adapters and client code.</li></ol><h3>Why Do We Need Design Patterns?</h3><p>Design patterns offer a best practice approach to support object-oriented software design, which is easier to design, implement, change, test and reuse. These design patterns provide best practices and structures.</p><h3>1. Proven Solution</h3><p>Design patterns provide a proven, reliable solution to a common problem, meaning the software developer does not have to “reinvent the wheel” when that problem occurs.</p><h3>2. Reusable</h3><p>Design patterns can be modified to solve many kinds of problems — they are not just tied to a single problem.</p><h3>3. Expressive</h3><p>Design patterns are an elegant solution.</p><h3>4. Prevent the Need for Refactoring Code</h3><p>Since the design pattern is already the optimal solution for the problem, this can avoid refactoring.</p><h3>5. Lower the Size of the Codebase</h3><p>Each pattern helps software developers change how the system works without a full redesign. Further, as the “optimal” solution, the design pattern often requires less code.</p><h3>Benefits of Design Patterns in Software Engineering</h3><p>As noted above under “Why do we need design patterns?”, the best software design patterns will leverage a common language, making it easier for developers to communicate about problems and to improve code readability and architecture in early stages of the planning. When used well, design patterns can both speed up the development process and generally reduce the chance of errors.</p><p>Design patterns are also language agnostic (for object-oriented languages), although some patterns are more useful with certain languages vs others.</p><h3>Advantages of Software Design pattern</h3><p>1.Modularity and Reusability: Design patterns promote modular design, which breaks down complex systems into smaller, manageable components. These components can be reused in different parts of the application or even in other projects, saving time and effort in development.</p><p>2.Code Organization: Design patterns provide a structured way to organize code. This makes the codebase more understandable and easier to navigate, leading to improved readability and maintainability.</p><p>3.Scalability: Patterns help design systems that can scale as requirements change or grow. By promoting loose coupling and clear interfaces, patterns enable developers to add new features or modify existing ones without affecting the entire system.</p><p>4.Maintainability: With their clear structure and separation of concerns, design patterns make it easier to maintain and update software over time. Changes to one part of the system are less likely to impact other parts, reducing the risk of unintended side effects.</p><p>5.Common Vocabulary: Design patterns provide a shared vocabulary for developers to communicate complex concepts and solutions. This common language improves collaboration and understanding among team members.</p><p>6.Best Practices: Design patterns embody best practices and proven solutions to recurring design problems. By following these patterns, developers can avoid reinventing the wheel and implement solutions that have been vetted in various contexts.</p><p>7.Adaptability and Flexibility: Patterns help create flexible architectures that can adapt to changing requirements or technological advancements. This adaptability reduces the likelihood of architectural overhaul in the face of changes.</p><p>8.Reduction of Errors: Patterns encourage well-tested and well-understood solutions. This reduces the chances of introducing errors and helps maintain a higher level of code quality.</p><p>9.Documentation and Communication: Patterns serve as a form of documentation. They communicate design decisions, making it easier for new developers to understand the system’s structure and design choices.</p><p>10.Efficiency: Patterns streamline the development process by providing reusable templates for common tasks. Developers can focus on the unique aspects of a problem rather than reinventing basic solutions.</p><p>11.Consistency: Using design patterns promotes consistency across the codebase. Consistent design and coding practices lead to fewer surprises and a more cohesive application.</p><p>12.Encapsulation and Abstraction: Patterns encourage encapsulation and abstraction, which reduce the complexity of individual components and allow developers to work at higher levels of abstraction, leading to clearer and more maintainable code.</p><p>13.Design Evolution: Patterns provide a foundation for incremental design evolution. They allow developers to add new features or change existing ones without the need to redesign the entire system.</p><h3><strong>Disadvantages of Software Design pattern</strong></h3><p>1.Overengineering: One potential disadvantage is the risk of overengineering. Applying design patterns when they’re not truly necessary can lead to unnecessarily complex code and increased development time. It’s important to evaluate whether a pattern fits the problem at hand before implementing it.</p><p>2.Learning Curve: Some design patterns can be complex, especially for developers who are new to them. Learning and understanding these patterns might take time, and inexperienced developers could misuse or misapply them.</p><p>3.Increased Abstraction: Design patterns often introduce an additional layer of abstraction. While this can lead to more modular and flexible code, it can also make the codebase harder to understand, especially for those who are not familiar with the patterns being used.</p><p>4.Maintenance Complexity: While design patterns can make the initial development process more streamlined, they can add complexity to the maintenance phase. As the codebase evolves, patterns might need to be adapted or updated, and this can lead to challenges in understanding how different patterns interact with each other.</p><p>5.Code Readability: Some design patterns can lead to code that’s less intuitive for developers who are not familiar with those patterns. This can affect the overall readability of the codebase.</p><p>6.Performance Impact: In some cases, design patterns might introduce performance overhead due to the additional layers of abstraction or indirection they introduce. Careful consideration is needed, especially in performance-critical applications.</p><p>7.Code Bloat: Incorrect or overuse of design patterns can result in code bloat — excessive lines of code that are harder to manage and understand. This can lead to maintenance challenges and potential bugs.</p><p>8.Antipatterns: Design patterns can become antipatterns if used improperly. For instance, applying a pattern just for the sake of using a pattern, even when it doesn’t fit the problem, can lead to convoluted code.</p><p>9.Dependency Management: Some design patterns involve managing dependencies between objects or components. This can sometimes lead to tight coupling if not managed carefully, making the codebase less adaptable to changes.</p><p>10.Standardization Over Creativity: Relying too heavily on design patterns might stifle creativity and innovation in software development. Developers might become more focused on fitting solutions into established patterns rather than thinking critically about unique solutions.</p><h3>Conclusion</h3><p>In conclusion, software design patterns are essential tools that guide developers in creating well-structured, efficient, and maintainable software systems. These patterns offer proven solutions to recurring design problems, representing distilled wisdom from years of collective experience in the software engineering community.</p><p>Design patterns provide a common language that enhances communication among developers, enabling them to express complex architectural concepts clearly. By promoting modularity and encapsulation, patterns make codebases more organized and understandable, easing maintenance and updates.</p><p>The adaptability of design patterns is a standout advantage. They enable systems to evolve gracefully, accommodating changing requirements without causing major disruptions. This flexibility extends to both the development process, where patterns expedite solutions to common challenges, and the onboarding of new team members, who can quickly grasp the architectural principles embedded in these patterns.</p><p>However, it’s important to strike a balance. While design patterns offer solutions, they shouldn’t be applied dogmatically. Thoughtful consideration of the problem context is essential to ensure that patterns align with the specific project needs.</p><p>In a fast-paced technology landscape, design patterns offer stability and time-tested strategies. They empower developers to build software that stands strong against the pressures of change, adhering to best practices while fostering innovation. Incorporating design patterns into software development practices is a testament to a commitment to quality, ensuring that software not only meets functional requirements but also embodies elegance and longevity in its design.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f928af339cc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Web Services (AWS)]]></title>
            <link>https://medium.com/@sandunisandathika98/amazon-web-services-aws-1bacfb34d116?source=rss-9e6234208b78------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bacfb34d116</guid>
            <dc:creator><![CDATA[Sanduni Mayadunna]]></dc:creator>
            <pubDate>Wed, 21 Sep 2022 01:56:07 GMT</pubDate>
            <atom:updated>2022-09-21T01:56:07.463Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Is-mzDFAMsM6ChGH.png" /></figure><p><strong>What is AWS in simple words?</strong></p><p>Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centers globally.</p><h3>History of AWS</h3><ul><li>In the year 2002 — AWS services were launched</li><li>In the year 2006- AWS cloud products were launched</li><li>In the year 2012 — AWS had its first customer event</li><li>In the year 2015- AWS achieved $4.6 billion</li><li>In the year 2016- Surpassed the $10 billion revenue target</li><li>In the year 2016- AWS snowball and AWS snowmobile were launched</li><li>In the year 2019- Released approximately 100 cloud services</li></ul><p>Moving forward, we will learn more about AWS services.</p><h3>How Does AWS Work?</h3><p>AWS usually works in several different configurations depending on the user’s requirements. However, the user must be able to see the type of configuration used and the particular server map with respect to the AWS service.</p><h3>Advantages of AWS</h3><ol><li>AWS provides a user-friendly programming model, architecture, database as well as operating system that has been already known to employers.</li><li>AWS is a very cost-effective service. There is no such thing as long-term commitments for anything you would like to purchase.</li><li>It offers billing and management for the centralized sector, hybrid computing, and fast installation or removal of your application in any location with few clicks.</li><li>There is no need to pay extra money on running data servers by AWS.</li><li>AWS offers a total ownership cost at very reasonable rates in comparison to other private cloud servers.</li></ol><h3>Disadvantages of AWS</h3><ol><li>AWS has supportive paid packages for intensive or immediate response. Thus, users might need to pay extra money for that.</li><li>There might be some cloud computing problems in AWS especially when you move to a cloud Server such as backup protection, downtime, and some limited control.</li><li>From region to region, AWS sets some default limitations on resources such as volumes, images, or snapshots.</li><li>If there is a sudden change in your hardware system, the application on the cloud might not offer great performance.</li></ol><h3>What is Cloud Computing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*IMv7ecL0TxCmYrPI.png" /></figure><p>Cloud computing is the on-demand delivery of IT resources over the Internet with pay-as-you-go pricing. Instead of buying, owning, and maintaining physical data centers and servers, you can access technology services, such as computing power, storage, and databases, on an as-needed basis from a cloud provider like Amazon Web Services (AWS).</p><h3>Difference Between Cloud Computer And AWS</h3><p>Google Cloud is a suite of Google’s public cloud computing resources &amp; services whereas AWS is a secure cloud service developed and managed by Amazon. Google Cloud offers Google Cloud Storage, while AWS offers Amazon Simple Storage Services.</p><h3>Applications of AWS</h3><p>The most common applications of AWS are storage and backup, websites, gaming, mobile, web, and social media applications. Some of the most crucial applications in detail are as follows:</p><h3>1. Storage and Backup</h3><p>One of the reasons why many businesses use AWS is because it offers multiple types of storage to choose from and is easily accessible as well. It can be used for storage and file indexing as well as to run critical business applications.</p><h3>2. Websites</h3><p>Businesses can host their websites on the AWS cloud, similar to other web applications.</p><h3>3. Gaming</h3><p>There is a lot of computing power needed to run gaming applications. AWS makes it easier to provide the best online gaming experience to gamers across the world.</p><h3>4. Mobile, Web and Social Applications</h3><p>A feature that separates AWS from other cloud services is its capability to launch and scale mobile, e-commerce, and Saas applications. API-driven code on AWS can enable companies to build uncompromisingly scalable applications without requiring any OS and other systems.</p><h3>5. Big Data Management and Analytics (Application)</h3><ul><li>Amazon Elastic MapReduced to process large amounts of data via the Hadoop framework.</li><li>Amazon Kinesis to analyze and process the streaming data.</li><li>AWS Glue to handle, extract, transform and load jobs.</li><li>Amazon Elasticsearch Service to enable a team to perform log analysis, and tool monitoring with the help of the open source tool, Elastic-search.</li><li>Amazon Athena to query data.</li><li>Amazon QuickSight to visualize data.</li></ul><h3>6. Artificial Intelligence</h3><ul><li>Amazon Lex to offer voice and text chatbot technology.</li><li>Amazon Polly to translate text-to-speech translation such as Alexa Voice Services and echo devices.</li><li>Amazon Rekognition to analyze the image and face.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7Zp3bQAj2IVe_bvX.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bacfb34d116" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are the Keys in DBMS?]]></title>
            <link>https://medium.com/@sandunisandathika98/what-are-the-keys-in-dbms-8b340b4964f1?source=rss-9e6234208b78------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b340b4964f1</guid>
            <dc:creator><![CDATA[Sanduni Mayadunna]]></dc:creator>
            <pubDate>Fri, 02 Sep 2022 15:54:35 GMT</pubDate>
            <atom:updated>2022-09-03T14:04:14.921Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BEaXE8GtF2DZXfOV.jpg" /></figure><p>A key in <a href="https://www.upgrad.com/blog/dbms-project-ideas-for-beginners/">DBMS</a> is an attribute or a set of attributes that help to uniquely identify a tuple (or row) in a relation (or table). Keys are also used to establish relationships between the different tables and columns of a relational database. Individual values in a key are called key values.</p><h3>Types of Keys in DBMS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kQY3tMy27Q1wUuSZ" /></figure><p>There are broadly seven types of keys in DBMS. All these types of keys in SQL must be implemented appropriately for the relevant database to negate redundancy. Correct identification will lead to database accuracy, improving results in a limited time. Let’s explore these DBMS keys to learn more about what are keys in SQL.</p><ol><li>Primary Key</li><li>Candidate Key</li><li>Super Key</li><li>Foreign Key</li><li>Composite Key</li><li>Alternate Key</li><li>Unique Key</li></ol><h3>1. Primary Key</h3><p>If you’re wondering what is primary key in DBMS, primary key is a column of a table or a set of columns that helps to identify every record present in that table uniquely. There can be only one primary Key in a table. Also, the primary Key cannot have the same values repeating for any row. Every value of the primary key must be different with no repetitions. Amid many details, a primary key is the most significant one to understand what are keys and what is primary key in DBMS.</p><p>The PRIMARY KEY (PK) constraint put on a column or set of columns will not allow them to have any null values or any duplicates. One table can have only one primary key constraint. Any value in the primary key cannot be changed by any foreign keys (explained below) which refer to it.</p><h3>NOTES-</h3><ul><li>The value of primary key can never be NULL.</li><li>The value of primary key must always be unique.</li><li>The values of primary key can never be changed i.e. no updation is possible.</li><li>The value of primary key must be assigned when inserting a record.</li><li>A relation is allowed to have only one primary key.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*IYRMnARVcfOBzOPI.png" /></figure><h3>2. Super Key</h3><p>Super Key is the set of all the keys which help to identify rows in a table uniquely. This means that all those columns of a table than capable of identifying the other columns of that table uniquely will all be considered super keys.</p><p>Super Key is the superset of a candidate key (explained below). The Primary Key of a table is picked from the super key set to be made the table’s identity attribute.</p><h3>NOTE-</h3><p>All the attributes in a super key are definitely sufficient to identify each tuple uniquely in the given relation but all of them may not be necessary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dsvlnf2edYzVqzvH.jpg" /></figure><h3>3. Candidate Key</h3><p>Candidate keys are those attributes that uniquely identify rows of a table. The Primary Key of a table is selected from one of the candidate keys. So, candidate keys have the same properties as the primary keys explained above. There can be more than one candidate keys in a table.</p><p>There can be more candidate keys than just one for any table, but they can never be empty. Every candidate key carries unique information and value. Besides these characteristics, a combination of attributes also works as a set of candidate keys.</p><h3>NOTES-</h3><ul><li>All the attributes in a candidate key are sufficient as well as necessary to identify each tuple uniquely.</li><li>Removing any attribute from the candidate key fails in identifying each tuple uniquely.</li><li>The value of candidate key must always be unique.</li><li>The value of candidate key can never be NULL.</li><li>It is possible to have multiple candidate keys in a relation.</li><li>Those attributes which appears in some candidate key are called as <strong>prime attributes</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/0*DffpgJ-lDYR1YMPl.jpg" /></figure><h3>4. Alternate Key</h3><p>As stated above, a table can have multiple choices for a primary key; however, it can choose only one. So, all the keys which did not become the primary Key are called alternate keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/0*8xP71p2LeuNfXYe_.jpg" /></figure><h3>5. Foreign Key</h3><p>Foreign Key is used to establish relationships between two tables. A foreign key will require each value in a column or set of columns to match the Primary Key of the referential table. Foreign keys help to maintain data and referential integrity.</p><p>Foreign keys are essential for maintaining a difference between two entities that might be linked with the same information but do not share similar information. In such cases, the tables are linked to maintaining a connection but do not entirely work as a replacement for each other. For instance, any individual working for the marketing department might have marketing department information in its employee table, but that does not mean the table can be similar to the department table held by the marketing department.</p><h3>NOTES-</h3><ul><li>Foreign key references the primary key of the table.</li><li>Foreign key can take only those values which are present in the primary key of the referenced relation.</li><li>Foreign key may have a name other than that of a primary key.</li><li>Foreign key can take the NULL value.</li><li>There is no restriction on a foreign key to be unique.</li><li>In fact, foreign key is not unique most of the time.</li><li>Referenced relation may also be called as the master table or primary table.</li><li>Referencing relation may also be called as the foreign table.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bimtwypBZ26On-ZE.gif" /></figure><h3>6. Composite Key</h3><p>A composite Key is a set of two or more attributes that help identify each tuple in a table uniquely. The attributes in the set may not be unique when considered separately. However, when taken all together, they will ensure uniqueness. The ‘concatenated key’ is another name for a composite key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*kU9-2GllkM5ugmSY.png" /></figure><h3>7. Unique Key</h3><p>Unique Key is a column or set of columns that uniquely identify each record in a table. All values will have to be unique in this Key. A unique Key differs from a primary key because it can have only one null value, whereas a primary Key cannot have any null values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*2emtgbUIuJqLAUWD.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b340b4964f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evaluation of Database Management System]]></title>
            <link>https://medium.com/@sandunisandathika98/evaluation-of-database-management-system-e7fa7095fea3?source=rss-9e6234208b78------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7fa7095fea3</guid>
            <dc:creator><![CDATA[Sanduni Mayadunna]]></dc:creator>
            <pubDate>Thu, 21 Jul 2022 16:33:28 GMT</pubDate>
            <atom:updated>2022-07-21T16:33:28.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4BVKIPP0WLLLzcaInrMspA.jpeg" /><figcaption>DBMS</figcaption></figure><p><strong>Database Management System</strong></p><ul><li>Database management system is a software which is used to manage the database. For example: <a href="https://www.javatpoint.com/mysql-tutorial">MySQL</a>, <a href="https://www.javatpoint.com/oracle-tutorial">Oracle</a>, etc are a very popular commercial database which is used in different applications.</li><li>DBMS provides an interface to perform various operations like database creation, storing data in it, updating data, creating a table in the database and a lot more.</li><li>It provides protection and security to the database. In the case of multiple users, it also maintains data consistency.</li></ul><p><strong>DBMS allows users the following tasks:</strong></p><ul><li><strong>Data Definition:</strong> It is used for creation, modification, and removal of definition that defines the organization of data in the database.</li><li><strong>Data Updation:</strong> It is used for the insertion, modification, and deletion of the actual data in the database.</li><li><strong>Data Retrieval:</strong> It is used to retrieve the data from the database which can be used by applications for various purposes.</li><li><strong>User Administration:</strong> It is used for registering and monitoring users, maintain data integrity, enforcing data security, dealing with concurrency control, monitoring performance and recovering information corrupted by unexpected failure.</li></ul><p>Database management systems can be classified based on a variety of criteria such as the data model, the database distribution, or user numbers. The most widely used types of DBMS software are relational, distributed, hierarchical, object-oriented, and network.</p><h4>Distributed database management system</h4><p>A distributed DBMS is a set of logically interrelated databases distributed over a network that is managed by a centralized database application. This type of DBMS synchronizes data periodically and ensures that any change to data is universally updated in the database.</p><h4>Hierarchical database management system</h4><p>Hierarchical databases organize model data in a tree-like structure. Data storage is either a top-down or bottom-up format and is represented using a parent-child relationship.</p><h4>Network database management system</h4><p>The network database model addresses the need for more complex relationships by allowing each child to have multiple parents. Entities are organized in a graph that can be accessed through several paths.</p><h4>Relational database management system</h4><p>Relational database management systems (RDBMS) are the most popular data model because of its user-friendly interface. It is based on normalizing data in the rows and columns of the tables. This is a viable option when you need a data storage system that is scalable, flexible, and able to manage lots of information.</p><h4>Object-oriented database management system</h4><p>Object-oriented models store data in objects instead of rows and columns. It is based on object-oriented programming (OOP) that allows objects to have members such as fields, properties, and methods.</p><h3>Evaluation of Database Management System</h3><p>There are various database management systems available in the market. Each type has its features and can be used for varied purposes. The large number of DBMS makes it difficult to choose the DBMS that should be implemented to solve our problem. To choose the most suitable DBMS, we need to evaluate from various systems. We perform a structured approach to evaluate the database systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*TT3RCw4k--FfrNOC.png" /></figure><h3>Evaluation Methodology</h3><p>This step involves two analyses; both these analyses should be performed to determine the most suited DBMS.</p><p>These two analyses are:</p><ol><li><strong>Feature analysis:</strong> In this phase, we determine whether the DBMS provides all the features required for the operations that are to be performed on the data and shortlist the DBMS.</li><li><strong>Performance Analysis:</strong> In this phase, we analyse only those shortlisted DBMS, evaluate the systems’ efficiency, and choose one with maximum efficiency.</li></ol><h3>Feature Analysis</h3><p>This analysis serves two purposes:</p><ul><li>It directly eliminates the DBMS that is not competent to fulfil all the needs of the user.</li><li>We can rank the remaining systems based on the features provided by them.</li></ul><p>This is a subjective approach as the database implementation is not necessary and can only be done with the help of reading the documentation of the database management system. This is relatively cheaper as compared to any other approach. This method does not measure the actual performance of the management system. Therefore, it cannot be decisively determined the best database management system.</p><h3>Performance Analysis</h3><p>The purpose of this analysis is:</p><ul><li>To analyse the behaviour of the database management system in the user system.</li><li>To gather the data on the performance of the DBMS and rank them accordingly.</li></ul><p>Using this method, we can decide the best DBMS that should be implemented to give the maximum result.</p><p>Techniques to Analyse the Performance of DBMS</p><p>There are various methods to judge the performance of the database management system. Some of the most used methods are Analytical and Stimulation modelling and Benchmarking.</p><p>Now, discuss these methods individually.</p><h3>Analytical Modelling Technique</h3><p>In this model, we use certain equations that are used to map the performance of the database management system to system parameters. This is quite an accurate method to perform performance analysis. Two models that are used under this technique are Queueing models and Cost models.</p><h3>Queueing Models</h3><p>The database system is provided with various resource systems and tasks are provided to the database management system. The system performance is evaluated based on the performance of the system while performing these assigned tasks.</p><h3>Cost Models</h3><p>This model effectively calculates the performance of physical databases. They are used to estimate the storage cost. We can determine the average response time to perform a task by the database management system.</p><h3>Simulating Modelling</h3><p>In simulation modelling, we construct a real-time model of the system to replicate the behaviour of the actual system. It performs the task and gathers the data, using this gathered data it evaluates the real-time performance of the system. It constitutes an application program, database system, operating system and hardware environment. This is more suitable for evaluating the performance of complex systems. But as the complexity of the system increases the evaluation of the performance of the system becomes more difficult.</p><h3>Benchmarking</h3><p>This technique is preferred when there is less number of databases that are to be evaluated. It requires implementing the management system in an almost similar environment so that the data acquired using this method is closest. As the environment for each database management system is created separately, this method is costly and consumes a lot of time in setting up the environment. This method is still performed because this method produces the most accurate result upon which the performance of the management system is evaluated.</p><p>In this method, we need to define and implement system configuration, a database and a workload. The key component in this method is the workload that can either be specific to an application or it can be general. All the test is performed using this workload. Various systems operate on these workloads and the result and data from each implementation is used to compare and evaluate the database management system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vCdzyV95TRian7Cb.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*8Cc31us757IZlkEByLSzMQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7fa7095fea3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File System vs Database Management System]]></title>
            <link>https://medium.com/@sandunisandathika98/file-system-vs-database-management-system-6f8eb02ef67d?source=rss-9e6234208b78------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f8eb02ef67d</guid>
            <category><![CDATA[dbms]]></category>
            <category><![CDATA[filesystem]]></category>
            <category><![CDATA[dbms-vs-file-system]]></category>
            <dc:creator><![CDATA[Sanduni Mayadunna]]></dc:creator>
            <pubDate>Thu, 07 Jul 2022 06:48:16 GMT</pubDate>
            <atom:updated>2022-07-07T06:48:16.869Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*pI6YTOGd-BPuZA6OEaeyWw.jpeg" /><figcaption>DBMS vs File System</figcaption></figure><h3><strong>What is a File System?</strong></h3><p>The file system is basically a way of arranging the files in a storage medium like a hard disk. The file system organizes the files and helps in the retrieval of files when they are required. File systems consist of different files which are grouped into directories. The directories further contain other folders and files. The file system performs basic operations like management, file naming, giving access rules, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*6xtKcetiFfuNAiUIX7RBuw.png" /><figcaption><em>File System</em></figcaption></figure><p><strong><em>In order to work, a file system is required by most of the applications you come into contact with; therefore, each partition should have one. Furthermore, if a program is built for use in macOS, you will be unable to use this program on windows because programs are file system-dependent.</em></strong></p><h4>Examples of file systems: FAT,GFS,HFS,NTFS,UDF</h4><h3>What is Database Management System?</h3><p>Database management system is a software which is used to manage the database. For example: <a href="https://www.javatpoint.com/mysql-tutorial">MySQL</a>, <a href="https://www.javatpoint.com/oracle-tutorial">Oracle</a>, etc are a very popular commercial database which is used in different applications.</p><p>DBMS provides an interface to perform various operations like database creation, storing data in it, updating data, creating a table in the database and a lot more.It provides protection and security to the database. In the case of multiple users, it also maintains data consistency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*B5MJXcc4yoRiMsmkarJ7xw.png" /><figcaption>DBMS</figcaption></figure><h4>Characteristics of DBMS</h4><ul><li>It uses a digital repository established on a server to store and manage the information.</li><li>It can provide a clear and logical view of the process that manipulates data.</li><li>DBMS contains automatic backup and recovery procedures.</li><li>It contains ACID properties which maintain data in a healthy state in case of failure.</li><li>It can reduce the complex relationship between data.</li><li>It is used to support manipulation and processing of data.</li><li>It is used to provide security of data.</li><li>It can view the database from different viewpoints according to the requirements of the user.</li></ul><h3>File System vs Database Management System</h3><h3><strong>Structure</strong></h3><p><strong><em>File System </em></strong>-:The file system is software that manages and organizes the files in a storage medium within a computer.</p><p><strong><em>DBMS</em></strong> -:DBMS is software for managing the database.</p><h3>Data Redundancy</h3><p><strong><em>File System </em></strong>-:Redundant data can be present in a file system.</p><p><strong><em>DBMS</em></strong> -:In DBMS there is no redundant data.</p><h3>Backup and Recovery</h3><p><strong><em>File System </em></strong>-:It doesn’t provide backup and recovery of data if it is lost.</p><p><strong><em>DBMS</em></strong> -:It provides backup and recovery of data even if it is lost.</p><h3>Query processing</h3><p><strong><em>File System </em></strong>-:There is no efficient query processing in the file system.</p><p><strong><em>DBMS</em></strong> -:Efficient query processing is there in DBMS.</p><h3>Consistency</h3><p><strong><em>File System </em></strong>-:There is less data consistency in the file system.</p><p><strong><em>DBMS</em></strong> -:There is more data consistency because of the process of normalization.</p><h3>Complexity</h3><p><strong><em>File System </em></strong>-:It is less complex as compared to DBMS.</p><p><strong><em>DBMS</em></strong> -:It has more complexity in handling as compared to the file system.</p><h3>Security Constraints</h3><p><strong><em>File System </em></strong>-:File systems provide less security in comparison to DBMS.</p><p><strong><em>DBMS</em></strong> -:DBMS has more security mechanisms as compared to file systems.</p><h3>Cost</h3><p><strong><em>File System </em></strong>-:It is less expensive than DBMS.</p><p><strong><em>DBMS</em></strong> -:It has a comparatively higher cost than a file system.</p><h3>Data Independence</h3><p><strong><em>File System </em></strong>-:There is no data independence.</p><p><strong><em>DBMS</em></strong> -:In DBMS data independence exists.</p><h3>User Access</h3><p><strong><em>File System </em></strong>-:Only one user can access data at a time.</p><p><strong><em>DBMS</em></strong> -:Multiple users can access data at a time.</p><h3>Meaning</h3><p><strong><em>File System </em></strong>-:The user has to write procedures for managing databases</p><p><strong><em>DBMS</em></strong> -:The user not required to write procedures.</p><h3>Sharing</h3><p><strong><em>File System </em></strong>-:Data is distributed in many files. So, not easy to share data</p><p><strong><em>DBMS</em></strong> -:Due to centralized nature sharing is easy</p><h3>Data Abstraction</h3><p><strong><em>File System </em></strong>-:It give details of storage and representation of data</p><p><strong><em>DBMS</em></strong> -:It hides the internal details of Database</p><h3>Integrity Constraints</h3><p><strong><em>File System </em></strong>-:Integrity Constraints are difficult to implement</p><p><strong><em>DBMS</em></strong> -:Integrity constraints are easy to implement</p><h3>Example</h3><p><strong><em>File System </em></strong>-:Cobol, C++</p><p><strong><em>DBMS</em></strong> -:Oracle, SQL Server</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f8eb02ef67d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>