<?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 Zinjurdesainath on Medium]]></title>
        <description><![CDATA[Stories by Zinjurdesainath on Medium]]></description>
        <link>https://medium.com/@zinjurdesainath?source=rss-5823daddc573------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-7AgTjb4jQXwCzvu</url>
            <title>Stories by Zinjurdesainath on Medium</title>
            <link>https://medium.com/@zinjurdesainath?source=rss-5823daddc573------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 00:55:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zinjurdesainath/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[Working with XML Layouts in Android]]></title>
            <link>https://medium.com/@zinjurdesainath/working-with-xml-layouts-in-android-2de677a3e6bf?source=rss-5823daddc573------2</link>
            <guid isPermaLink="false">https://medium.com/p/2de677a3e6bf</guid>
            <category><![CDATA[layout]]></category>
            <dc:creator><![CDATA[Zinjurdesainath]]></dc:creator>
            <pubDate>Sun, 15 Mar 2026 15:52:48 GMT</pubDate>
            <atom:updated>2026-03-15T15:52:48.852Z</atom:updated>
            <content:encoded><![CDATA[<p>Android applications use <strong>XML layouts</strong> to design the user interface (UI). XML layout files define how UI components such as buttons, text fields, images, and lists appear on the screen. These layouts are stored in the <strong>res/layout/</strong> directory of an Android project.</p><p>XML layouts help developers separate <strong>design from logic</strong>, making the app easier to maintain and update.</p><p>In this blog, we will discuss:</p><ol><li>LinearLayout, RelativeLayout, and ConstraintLayout</li><li>Styling and Themes</li><li>Adapter, RecyclerView, and Drawable Shapes</li></ol><p><strong>LinearLayout, RelativeLayout, and ConstraintLayout</strong></p><p>Layouts control how UI components are arranged on the screen.</p><p><strong>LinearLayout</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*3YSaltxAbW4q4gFA4K65aQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*DhLRes4k6xf6cdcVs8yWyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*nm9Ts8fRMhoyaFSMzbHCjw.png" /></figure><p><strong>LinearLayout</strong> arranges elements in a <strong>single direction</strong>, either vertically or horizontally.</p><ul><li>Vertical → Top to Bottom</li><li>Horizontal → Left to Right</li></ul><p>The direction is controlled by the <strong>orientation attribute</strong>.</p><p><strong>Advantages</strong></p><ul><li>Easy layout arrangement</li><li>Good for forms and simple screens</li></ul><p>Example:</p><p>&lt;LinearLayout<br> android:layout_width=”match_parent”<br> android:layout_height=”match_parent”<br> android:orientation=”vertical”&gt;<br> <br> &lt;TextView<br> android:text=”Hello Android”<br> android:layout_width=”wrap_content”<br> android:layout_height=”wrap_content”/&gt;<br> <br> &lt;/LinearLayout&gt;</p><p>Key Features:</p><ul><li>Simple and easy to use</li><li>Supports <strong>layout_weight</strong> for proportional spacing</li><li>Suitable for simple UI designs</li></ul><p>LinearLayout arranges all child views sequentially in one direction.</p><h4><strong>RelativeLayout</strong></h4><p><strong>RelativeLayout</strong> positions elements relative to other elements or the parent layout.</p><p><strong>Advantages</strong></p><ul><li>More control over positioning</li><li>Efficient for medium-complex UI designs</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/217/1*GUlojsfYwuJT0D3bhjwOSA.png" /></figure><p>Example:</p><p>&lt;RelativeLayout<br> android:layout_width=”match_parent”<br> android:layout_height=”match_parent”&gt;<br> <br> &lt;Button<br> android:id=”@+id/button1&quot;<br> android:text=”Click”<br> android:layout_centerInParent=”true”<br> android:layout_width=”wrap_content”<br> android:layout_height=”wrap_content”/&gt;<br> <br> &lt;/RelativeLayout&gt;</p><p>Key Features:</p><ul><li>Flexible positioning</li><li>Can align views relative to each other</li><li>Reduces nested layouts</li></ul><h4><strong>ConstraintLayout</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*xLamzuJe3RVqJiNEy_Za4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*bBnLm2mRlYA41BPIq7BqeA.png" /></figure><p><strong>ConstraintLayout</strong> is the most advanced layout used in modern Android development.</p><p>It allows developers to position views using <strong>constraints</strong> (relationships between UI elements).</p><p><strong>Example:</strong></p><p>&lt;androidx.constraintlayout.widget.ConstraintLayout<br> android:layout_width=”match_parent”<br> android:layout_height=”match_parent”&gt;<br> <br> &lt;Button<br> android:id=”@+id/button”<br> android:text=”Submit”<br> android:layout_width=”wrap_content”<br> android:layout_height=”wrap_content”/&gt;<br> <br> &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</p><p><strong>Features</strong></p><ul><li>Flexible UI design</li><li>Reduces nested layouts</li><li>Improves app performance</li></ul><p><strong>Advantages:</strong></p><ul><li>Flat view hierarchy (better performance)</li><li>Drag-and-drop support in Android Studio</li><li>Flexible UI design</li></ul><h4><strong>2. Styling and Themes</strong></h4><p><strong>Styles and themes</strong> help maintain a consistent appearance throughout the application.</p><p><strong>Styles</strong></p><p>A <strong>style</strong> defines the appearance of a single UI component.</p><p>Example:</p><p>&lt;style name=”MyButtonStyle”&gt;<br> &lt;item name=”android:textColor”&gt;#FFFFFF&lt;/item&gt;<br> &lt;item name=”android:background”&gt;#6200EE&lt;/item&gt;<br> &lt;/style&gt;</p><p>Use in XML:</p><p>&lt;Button<br> style=”@style/MyButtonStyle”<br> android:text=”Submit”/&gt;</p><p>Benefits:</p><ul><li>Reusable design</li><li>Reduces repeated code</li><li>Improves UI consistency</li></ul><h4><strong>Themes</strong></h4><p>A <strong>theme</strong> applies styling to the entire application.</p><p>Example:</p><p>&lt;style name=”AppTheme” parent=”Theme.MaterialComponents.Light.DarkActionBar”&gt;<br> &lt;item name=”colorPrimary”&gt;#6200EE&lt;/item&gt;<br> &lt;item name=”colorAccent”&gt;#03DAC5&lt;/item&gt;<br> &lt;/style&gt;</p><p>Themes control:</p><ul><li>Colors</li><li>Fonts</li><li>Background styles</li><li>App-wide UI behavior</li></ul><h4><strong>3. Adapter, RecyclerView, and Drawable Shapes</strong></h4><p>These components are used to display and customize data in Android apps.</p><p><strong>Adapter</strong></p><p>An <strong>Adapter</strong> acts as a bridge between <strong>data and UI components</strong>.</p><p>It converts data into view items that can be displayed in a list or grid.</p><p><strong>Example uses:</strong></p><ul><li>ListView</li><li>RecyclerView</li><li>Spinner</li></ul><p><strong>Example:</strong></p><p>ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;&gt;(<br> this,<br> android.R.layout.simple_list_item_1,<br> dataList);</p><h4><strong>RecyclerView</strong></h4><p><strong>RecyclerView</strong> is an advanced version of ListView used to display large data sets efficiently.</p><p>Features:</p><ul><li>Better performance</li><li>View recycling</li><li>Custom layouts</li></ul><p><strong>Example:</strong></p><p>&lt;androidx.recyclerview.widget.RecyclerView<br> android:id=”@+id/recyclerView”<br> android:layout_width=”match_parent”<br> android:layout_height=”match_parent”/&gt;</p><p>RecyclerView works with:</p><ul><li>Adapter</li><li>ViewHolder</li><li>LayoutManager</li></ul><h4><strong>Drawable Shapes</strong></h4><p>Drawable shapes are XML files used to create <strong>custom UI graphics</strong> such as backgrounds, borders, and buttons.</p><p>Example:</p><p>&lt;shape xmlns:android=”http://schemas.android.com/apk/res/android&quot;&gt;<br> &lt;solid android:color=”#6200EE”/&gt;<br> &lt;corners android:radius=”10dp”/&gt;<br> &lt;/shape&gt;</p><p>Uses:</p><ul><li>Button backgrounds</li><li>Card layouts</li><li>Custom UI elements</li></ul><p>Benefits:</p><ul><li>No need for image files</li><li>Lightweight</li><li>Easy customization</li></ul><h4><strong>Conclusion</strong></h4><p>Working with XML layouts is essential for designing Android user interfaces. Layouts like <strong>LinearLayout, RelativeLayout, and ConstraintLayout</strong> help organize UI components effectively. Styling and themes maintain consistency across the app, while <strong>Adapters, RecyclerView, and Drawable shapes</strong> improve data display and visual appearance.</p><p>Understanding these concepts helps developers build <strong>responsive, efficient, and visually appealing Android applications</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2de677a3e6bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NoSQL and Sharding — How Modern Data Scalability is being Revolutionized]]></title>
            <link>https://medium.com/@zinjurdesainath/nosql-and-sharding-how-modern-data-scalability-is-being-revolutionized-b0c6a5fb2d5c?source=rss-5823daddc573------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0c6a5fb2d5c</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sharding]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[key-value-database]]></category>
            <category><![CDATA[graph-database]]></category>
            <dc:creator><![CDATA[Zinjurdesainath]]></dc:creator>
            <pubDate>Mon, 15 Sep 2025 15:20:51 GMT</pubDate>
            <atom:updated>2025-09-15T15:20:51.728Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>NoSQL and Sharding — How Modern Data Scalability is being Revolutionized</strong></h3><p><strong>1. Introduction</strong></p><p>Data is the new fuel in today’s digital era. Every time we scroll on social media, place an order for food online, watch movies online, or transfer money via UPI, massive volumes of data are being created. Efficient management of this data is essential to provide seamless user experiences.</p><p>Historically, Relational Database Management Systems (RDBMS) like MySQL, Oracle, and PostgreSQL ruled the roost when it came to storing data. They keep data within structured tables with rows and columns. These systems performed admirably for decades when data were scant, organized, and workloads were pre-determined. But as enterprises and web consumers grew, relational databases struggled with scalability, performance, and flexibility.</p><p>This gave birth to the NoSQL (Not Only SQL) databases, a novel technology created to manage contemporary data requirements. NoSQL accommodates dynamic data models, enormous scalability, and high availability, and it is the foundation of most contemporary applications such as Facebook, Amazon, Netflix, and Twitter.</p><p>But in the world of NoSQL, there is one complex concept — Sharding — that is very important for scaling systems. Sharding enables data to be distributed on several servers, so that systems can manage billions of records and millions of requests without getting slow.</p><p>Here in this blog, we are going to discuss the fundamentals of NoSQL, its ecosystem, strengths, applications, and limitations first, and then dive deeper into Sharding, how it functions, its strengths and weaknesses, and real-world case studies.</p><p><strong>2. Fundamentals of NoSQL</strong></p><p>NoSQL databases were developed to resolve the issues of relational systems. The name represents “Not Only SQL,” indicating that these databases are not restricted to the classical relational model.</p><p><strong>Important Features of NoSQL:</strong></p><p>Schema Flexibility — In contrast to relational databases in which a static schema is necessary, NoSQL supports records with different structures. For instance, the “phone number” field can be included in a user profile for one record but not for another.</p><p>Horizontal Scalability — Rather than purchasing larger, more costly servers (vertical scaling), NoSQL spreads data among several less costly servers (horizontal scaling).</p><p>Support for Various Data Models<strong>:</strong></p><p>1. <strong>Document Databases (MongoDB, CouchDB) </strong>-A document-oriented database stores data in documents similar to JSON (JavaScript Object Notation) objects. Each document contains pairs of fields and values. The values can typically be a variety of types, including things like strings, numbers, booleans, arrays, or even other objects. A document database offers a flexible data model, much suited for semi-structured and typically unstructured data sets. They also support nested structures, making it easy to represent complex relationships or hierarchical data. Examples of document databases are MangoDB and Couchbase. A typical document will look like the following:</p><p>{</p><p>“_id”: “12345”,</p><p>“name”: “foo bar”,</p><p>“email”: “foo@bar.com”,</p><p>“address”: {</p><p>“street”: “123 foo street”,</p><p>“city”: “some city”,</p><p>“state”: “some state”,</p><p>“zip”: “123456”</p><p>},</p><p>“hobbies”: [“music”, “guitar”, “reading”] 12}</p><p>2. <strong>Key-Value Stores (Redis, DynamoDB)</strong> -A key-value store is a simpler type of database where each item contains keys and values. Each key is unique and associated with a single value. They are used for caching and session management and provide high performance in reads and writes because they tend to store things in memory. Examples are Amazon DynamoDB and Redis. A simple view of data stored in a key-value database is given below:</p><p>Key: user:12345</p><p>Value: {“name”: “foo bar”, “email”: “foo@bar.com”, “designation”: “software developer”}</p><p>3. <strong>Column-Family Databases (Cassandra, HBase) </strong>— Wide-column stores store data in tables, rows, and dynamic columns. The data is stored in tables. However, unlike traditional SQL databases, wide-column stores are flexible, where different rows can have different sets of columns. These databases can employ column compression techniques to reduce the storage space and enhance performance. The wide rows and columns enable efficient retrieval of sparse and wide data. Some examples of wide-column stores are Apache Cassandra and HBase. A typical example of how data is stored in a wide column is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*ooQgODEgK_R_A3t0NTGvnw.png" /></figure><p>4. <strong>Graph Databases (Neo4j) </strong>— A graph database stores data in the form of nodes and edges. Nodes typically store information about people, places, and things (like nouns), while edges store information about the relationships between the nodes. They work well for highly connected data, where the relationships or patterns may not be very obvious initially. Examples of graph databases are Neo4J and Amazon Neptune. Below is an example of how data is stored:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*tn81kqejqy1lEFd384spFg.png" /></figure><p>Due to these characteristics, NoSQL is now the go-to option for new-generation applications that need real-time performance and storing unstructured or semi-structured data.</p><p><strong>3. Architecture and Ecosystem of NoSQL</strong></p><p>The ecosystem of NoSQL is enormous, with numerous databases tailored for certain use cases. Some of the most widely used are:</p><p>MongoDB -A popular document database that has support for indexing, querying, and sharding.</p><p>Cassandra -A distributed database written for coping with lots of writes.</p><p>Redis — An in-memory key-value store that is mostly utilized for caching and session storage.</p><p>Neo4j — A graph database for social networks, fraud prevention, and recommendation systems.</p><p>Amazon DynamoDB — A cloud-based fully managed key-value and document database.</p><p>Common Architectural Principles:</p><p>Decentralization — No single point of failure; systems are written to be operable across clusters. Replication -Data is copied across servers to provide fault tolerance and high availability.</p><p>Eventual Consistency — Many NoSQL systems follow the BASE principle (Basically Available, Soft State, Eventually Consistent) instead of strict ACID rules.</p><p>Elastic Scalability -New servers can be added seamlessly as data grows.</p><p>This ecosystem gives developers freedom to choose the right tool depending on application requirements.</p><p><strong>4. Strengths of NoSQL</strong></p><p>NoSQL databases provide several advantages over traditional systems:</p><p>· Massive Scalability — Scalable to handle petabytes and terabytes of data by increasing servers.</p><p>· High Availability -Replication makes the system keep running even if a server is down.</p><p>· Flexibility — Handles structured, semi-structured, and unstructured data.</p><p>· Performance — Tuned for read or write-intensive loads.</p><p>· Cost-Effective -Runs on commodity hardware rather than high-end machines.</p><p>· Big Data Compatibility -Suitable for real-time analytics, IoT, and machine learning pipelines.</p><p><strong>5. Applications of NoSQL</strong></p><p>NoSQL databases find application in nearly every sector these days.</p><p>1. Social Media — Facebook stores posts and messages in Cassandra; Twitter stores suggestions for new followers using graph-like structures.</p><p>2. E-commerce — Amazon DynamoDB drives shopping carts and product catalogs; Flipkart uses NoSQL for search and recommendation.</p><p>3. Streaming Services — Netflix uses Cassandra to store users’ watch history and preferences.</p><p>4. Finance — Fraud detection employs graph databases to study relationships between transactions.</p><p>5. Healthcare &amp; IoT — Real-time data from sensors, wearables, and hospital monitoring are handled by NoSQL databases.</p><p><strong>6. Limitations of NoSQL</strong></p><p>NoSQL has limitations despite the advantages:</p><p>1. Weaker Consistency -Most NoSQL databases compromise on ACID properties in exchange for speed and scalability.</p><p>2. Complex Querying -Does not support SQL-like joins of multiple tables.</p><p>3. Operational Complexity — Needs proper setup, monitoring, and scaling.</p><p>4. Data Duplication — Without joins, the same data might have to be duplicated in many places.</p><p>5. Not Always Necessary -For tiny-scale usage, relational databases can still be preferable.</p><p><strong>6.</strong> <strong>Advanced Concept: Sharding</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*4EwsDhVb-J35dJ8DsLJIEQ.png" /></figure><p><strong>What is Sharding?</strong></p><p>Sharding is the process of dividing a huge database into chunks that are smaller, quicker, and easier to manage, known as “shards.” Every shard contains some portion of data, and collectively they hold the complete dataset.</p><p>Imagine sharding as splitting a phone book into different books for every city, rather than having one humongous directory for the whole country.</p><p><strong>Why Sharding is Required</strong></p><p>With data increasing to billions of entries, one machine is not capable of storing or processing everything. Sharding splits data between servers, providing:</p><p>Faster queries</p><p>Increased storage</p><p>Improved scalability</p><p><strong>Sharding Process</strong></p><p>1. Shard Key — A column such as user_id or region dictates how data is split.</p><p>2. Distribution — Data is divided among servers according to the shard key.</p><p>3. Query Routing — A router sends the request to the appropriate shard.</p><p>4. Rebalancing -When new shards are created, data is redistributed.</p><p><strong>Sharding Types</strong></p><p>There are different ways to implement sharding, depending on the nature of your data and application. The most common methods are:</p><p>1. <strong>Range-Based Sharding</strong>: In this approach, data is split into ranges based on a specific attribute, such as a date or user ID. For example, user IDs from 1 to 1000 might go into Shard 1, while IDs from 1001 to 2000 go into Shard 2. While simple, this method can result in uneven load distribution if data is not uniformly distributed.</p><p>2. <strong>Hash-Based Sharding</strong>: This method uses a hash function to distribute data more evenly across shards. The sharding key is run through a hash function, and the result determines which shard the data belongs to. Hash-based sharding avoids the uneven distribution problem but can complicate queries.</p><p>3. <strong>Geographic Sharding</strong>: In cases where data is heavily location-based, geographic sharding can be useful. For instance, users from Europe might be stored in a European data center, while users from Asia are stored in an Asian data center. This helps in improving performance for users by storing data closer to them.</p><p><strong>Advantages of Sharding</strong></p><p>Facilitates infinite scalability.</p><p>Faster queries since only pertinent shards are queried.</p><p>Relies on high availability.</p><p>Cost-effective compared to vertical scaling.</p><p><strong>Drawbacks of Sharding</strong></p><p>Selecting an inferior shard key makes it develop hotspots (one shard being overloaded).</p><p>Joins and transactions between shards are complex.</p><p>Operations such as rebalancing are complicated.</p><p>Applications need to be designed keeping in mind sharding.</p><p><strong>Examples of Sharding in Real Life</strong></p><p>· MongoDB — Facilitates auto-sharding using mongos.</p><p>· Cassandra -Utilizes consistent hashing to distribute data evenly.</p><p>· Amazon DynamoDB — Automatically handles sharding behind the scenes.</p><p><strong>8. Case Studies</strong></p><p>1. Netflix</p><p>Stores user watch history on different continents using Cassandra with sharding.</p><p>Maintains low latency and seamless streaming globally.</p><p>2. Amazon DynamoDB</p><p>Shopping cart application utilizes automated sharding to handle millions of transactions.</p><p>3. Facebook</p><p>Utilizes sharded MySQL and NoSQL databases for profiles and chat.</p><p><strong>9. Conclusion</strong></p><p>NoSQL databases have revolutionized the way data is stored and handled in today’s world. Due to their flexibility, scalability, and support for unstructured data, they are perfectly suited for use in applications of social media, e-commerce, finance, and IoT.</p><p>Of all NoSQL ideas, Sharding is the foundation of scalability. Sharding breaks up data over multiple servers to make sure databases can process billions of records without sluggishness. Although sharding creates complexity, it’s necessary for systems that have to support millions of users at scale.</p><p><strong>10. References</strong></p><ol><li>MongoDB Documentation — <a href="https://www.mongodb.com/docs/">https://www.mongodb.com/docs/</a></li><li>Apache Cassandra Project — <a href="https://cassandra.apache.org/">https://cassandra.apache.org/</a></li><li>GeeksforGeeks. (2022). <em>Introduction to NoSQL</em>. Retrieved from: <a href="https://www.geeksforgeeks.org/introduction-to-nosql/">https://www.geeksforgeeks.org/introduction-to-nosql/</a></li><li>AWS. (2023). <em>What is Database Sharding?</em>. Retrieved from: <a href="https://aws.amazon.com/what-is/database-sharding/?utm_source=chatgpt.com">https://aws.amazon.com/what-is/database-sharding/</a></li><li>MongoDB Documentation. (2023). <em>Sharding Concepts</em>. Retrieved from: <a href="https://www.mongodb.com/docs/manual/sharding/">https://www.mongodb.com/docs/manual/sharding/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0c6a5fb2d5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>