<?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 Krushna More on Medium]]></title>
        <description><![CDATA[Stories by Krushna More on Medium]]></description>
        <link>https://medium.com/@kmore2355?source=rss-209e4b5022c2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*iau28wpfuqCvRyTd</url>
            <title>Stories by Krushna More on Medium</title>
            <link>https://medium.com/@kmore2355?source=rss-209e4b5022c2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 00:57:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kmore2355/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[Java Basics for Android Development]]></title>
            <link>https://medium.com/@kmore2355/java-basics-for-android-development-0f29aa9814cd?source=rss-209e4b5022c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f29aa9814cd</guid>
            <category><![CDATA[variables]]></category>
            <category><![CDATA[loop]]></category>
            <category><![CDATA[conditional-statements]]></category>
            <category><![CDATA[data-type]]></category>
            <dc:creator><![CDATA[Krushna More]]></dc:creator>
            <pubDate>Sun, 15 Mar 2026 06:59:16 GMT</pubDate>
            <atom:updated>2026-03-15T06:59:16.485Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want to build Android apps, Java is one of the most important programming languages to learn. Even though Kotlin is widely used today, many Android applications, libraries, and learning resources still rely on Java. Understanding Java basics makes it easier to understand how Android apps work and also helps developers transition to Kotlin later.</p><p>When developing Android applications, programmers frequently use Java concepts such as variables, data types, conditional statements, and loops. These concepts help store user data, make decisions in the application, and perform repeated tasks efficiently. In this beginner-friendly guide to Java programming, we will explore the core concepts every Android developer should understand.</p><h4><strong>1.Variables</strong></h4><p><strong>What is a Variable?</strong></p><p>A variable is a container used to store data in a program. Its value can change during execution. For example in an Android app:</p><ul><li>Store user input from an EditText.</li><li>Track a score or result in a game.</li><li>Count button clicks.</li></ul><p><strong>Example:</strong></p><p>public class Main <br>{<br> public static void main(String[] args) <br> {<br> int age = 20;<br> String name = “XYZ”;</p><p>System.out.println(“Name: “ + name);<br> System.out.println(“Age: “ + age);<br> }<br>}</p><p><strong>Explanation of the Code:</strong></p><p>• int age = 20; int is the data type, age is the name, 20 is the value.<br> • String name = “XYZ”; String holds text data.<br> • System.out.println() outputs to the console.</p><p><strong>Variables in Android:</strong></p><p>Variables track dynamic data:<br> • Store EditText input: String username = editText.getText().toString();<br> • Save SharedPreferences: user settings or themes.<br> • Count clicks: int clickCount = 0;</p><h4><strong>2.Data Types</strong></h4><p>A data type specifies what kind of data a variable holds. It tells the Java compiler how much memory should be allocated for the variable and what type of value it can store. It has two categories:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*6kcOu85iG2rqm5qWgeXXCw.jpeg" /></figure><p><strong>1.Primitive Data Types</strong></p><p>Primitive data types are the basic built-in data types in Java. They store simple values and are directly supported by the language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*Vu0UEfE_60MSdLLcVSTcuA.png" /></figure><p><strong>Example:</strong></p><p>public class PrimitiveDataTypes <br>{<br> public static void main(String[] args) <br> {<br> int age = 21;<br> double price = 199.99;<br> float rating = 4.5f;<br> boolean isActive = true;</p><p>System.out.println(age);<br> System.out.println(price);<br> System.out.println(rating);<br> System.out.println(isActive);<br> }<br>}</p><p><strong>2. Non-Primitive Data Types</strong></p><p>Non-primitive data types are used to store more complex data. These data types are created by programmers and can store multiple values or objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*ila-Se0D-T6JjkyUNcGmEA.png" /></figure><p><strong>Example</strong>:</p><p>public class NonPrimitiveDataTypes <br>{<br> public static void main(String[] args) <br> {<br> int age = 21;<br> double price = 199.99;<br> float rating = 4.5f;<br> boolean isActive = true;<br> String name = “Android”;</p><p>System.out.println(age);<br> System.out.println(price);<br> System.out.println(rating);<br> System.out.println(isActive);<br> System.out.println(name);<br> }<br>}</p><p><strong>Data Types in Android:</strong></p><ul><li>int: Scores, list positions.</li><li>double/float: Prices, ratings. •</li><li>boolean: Login status (isLoggedIn).</li><li>String: Messages, usernames.</li></ul><p>Example: boolean isLoggedIn = true; shows dashboard or login screen.</p><h4><strong>3. Conditional Statements</strong></h4><p>Conditionals let programs decide based on conditions. In Android, use for login checks, input validation, or button actions.</p><p><strong>3.1 if Statement</strong></p><p>The if statement is used to execute a block of code only when a specified condition is true. If the condition is true, the program runs the code inside the if block; otherwise, it skips it.</p><p><strong>Example:</strong></p><p>int age = 18;</p><p>if (age &gt;= 18) <br>{<br> System.out.println(“You are eligible to vote.”);<br>}</p><p><strong>Android example:</strong></p><p>if (password.length() &gt;= 6) <br>{<br> Toast.makeText(this, “Valid Password”, Toast.LENGTH_SHORT).show();<br>}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*nXfxJAOiHSgsKv98AOeX1Q.jpeg" /></figure><p><strong>3.2 if-else Statement</strong></p><p>The if-else statement is used when a program needs to choose between two options. If the condition is true, the code inside the if block runs. If the condition is false, the code inside the else block runs instead.</p><p><strong>Example:</strong></p><p>int marks = 40;</p><p>if (marks &gt;= 50) <br>{<br> System.out.println(“Pass”);<br>} <br>else <br>{<br> System.out.println(“Fail”);<br>}</p><p><strong>Android Example:</strong></p><p>if (username.equals(“admin”)) <br>{<br> System.out.println(“Login Successful”);<br>} <br>else <br>{<br> System.out.println(“Invalid Username”);<br>}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*7Wy6qeVVKyOuqBCwbb0Q6Q.jpeg" /></figure><p><strong>3.3 switch Statement</strong></p><p>The switch statement is used when a program needs to select one option from multiple choices. It checks the value of a variable and executes the matching case.</p><p><strong>Example:</strong></p><p>int day = 3;</p><p>switch (day) <br>{<br> case 1:<br> System.out.println(“Monday”);<br> break;</p><p>case 2:<br> System.out.println(“Tuesday”);<br> break;</p><p>case 3:<br> System.out.println(“Wednesday”);<br> break;</p><p>default:<br> System.out.println(“Invalid Day”);<br>}</p><p><strong>Android Example</strong>:</p><p>switch (view.getId()) <br>{<br> case R.id.btnAdd:<br> System.out.println(“Add Button Clicked”);<br> break;</p><p>case R.id.btnSubtract:<br> System.out.println(“Subtract Button Clicked”);<br> break;<br>}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*DPgRIaveTyPyuqeRQF_t5Q.jpeg" /></figure><h4><strong>4. Loops</strong></h4><p>Loops are used to repeat code many times in a program. It help to avoid writing same code again and again. In Android apps, loops are used for lists, data processing, or repeating tasks.</p><p><strong>4.1 for Loop</strong></p><p>The for loop is used when we know how many times the code should run. It repeats the code for a fixed number of times.</p><p><strong>Example</strong>:</p><p>for (int i = 1; i &lt;= 5; i++) <br>{<br> System.out.println(“Number: “ + i);<br>}</p><p><strong>Android Example:</strong></p><p>Populate RecyclerView items.</p><p><strong>4.2 while Loop</strong></p><p>The while loop is used when the code needs to repeat as long as a condition is true. It runs until the condition becomes false.</p><p><strong>Example:</strong></p><p>int i = 1;</p><p>while (i &lt;= 5) <br>{<br> System.out.println(i);<br> i++;<br>}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*dnv0yoA6OR-AvRIJEX8qbg.png" /></figure><p><strong>4.3 do-while Loop</strong></p><p>The do-while loop runs the code at least one time before checking the condition. After that, it repeats the code while the condition is true.</p><p><strong>Example:</strong></p><p>int i = 1;</p><p>do <br>{<br> System.out.println(i);<br> i++;<br>} <br>while (i &lt;= 5);</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*1HP3ZbaoVuH59mvnEX2POg.jpeg" /></figure><h4><strong>Conclusion</strong></h4><p>Understanding Java basics — variables, data types, conditionals, and loops — is essential for Android development. These concepts form the foundation of almost every Android app. By practicing them regularly in Android Studio, you can quickly build the skills needed to create real Android applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f29aa9814cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distribution Models In NOSQL]]></title>
            <link>https://medium.com/@kmore2355/distribution-models-in-nosql-7e9e7ad9dd50?source=rss-209e4b5022c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e9e7ad9dd50</guid>
            <category><![CDATA[sharding]]></category>
            <category><![CDATA[master-slave-replication]]></category>
            <category><![CDATA[peer-to-peer]]></category>
            <category><![CDATA[single-server]]></category>
            <category><![CDATA[nosql]]></category>
            <dc:creator><![CDATA[Krushna More]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 17:30:59 GMT</pubDate>
            <atom:updated>2025-09-14T17:30:59.324Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Distribution Models In NOSQL</strong></p><p>Today, data is everywhere. We create millions of data points every second not only with social media apps like Instagram and Facebook but also with online shopping platforms like Amazon and Flipkart. One of the biggest problems in computer science is the management and storage of this enormous volume of data. Traditional databases, which are also called relational databases, are in essence robust and dependable, however, when the amount of data becomes too large, they frequently have difficulty in performing at the same speed. This is where NoSQL databases fit.</p><p>NoSQL databases are designed specifically to handle big data that is distributed over several servers. They have a number of advantages such as flexibility, scalability, and they are faster for some tasks. One of the key ideas in NoSQL is distribution models that imply how data is managed, copied, and stored in multiple servers.</p><p>The data distribution is contained in two methods: replication and sharding. Replication copies the data that is saved in one node on other nodes. While with sharding, the data is divided, so each node has different data. Replication and sharding are orthogonal in a way that you can use either one or both simultaneously. Replication can be divided into two categories: master-slave and peer-to-peer. We will now talk about these methods starting from the easiest and moving to the more complicated: first single-server, then master-slave replication, then sharding, and finally peer-to-peer replication</p><p><strong>Why Distribution Models Are Needed ?</strong></p><p>Suppose you make a college project app. 100 users. SQL fine. But one day, it goes viral. 1 million users. Your single laptop server crashes.</p><p>Two problems:</p><p><strong>Storage</strong>: Too much data for one machine.</p><p><strong>Speed</strong>: Queries too slow. Users leave.</p><p>Solution for this is?. Break big data into pieces. Spread across many servers. This spreading is called distribution. Think like group project. One person cannot finish all slides. So you divide tasks. Same in databases.</p><p><strong>What is a Distribution Model?</strong></p><p>A method describes the way in which a database spreads its data between different nodes. It maintains the features of scalability, reliability, and high availability. Big applications without distribution would still have performance bottlenecks.</p><p>The different distribution models used in NoSQL are :</p><p><strong>1.</strong> <strong>Single Server Model</strong></p><p>A single-server NoSQL database is essentially a NoSQL database that is created on a single physical or virtual machine. In this case, the database, the data processing, as well as the storage operations, are done by one server, and there is no replication or sharding across different nodes. The likes of MongoDB, Cassandra, Redis, and CouchDB that are NoSQL databases can be set up to run on a single server, which is mostly the case in development, testing, or small-scale applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*v_plqCQ7gniV_Dl2mcdXbA.png" /></figure><p><strong>Examples of Using Single Server Distribution in NoSQL Single server distribution</strong></p><p>• Development and Testing: A single server is fast and easy to set up, making it perfect for development and testing-</p><p>• Small Applications: Applications that have very few users and very little data can successfully run a single server distribution and have no concerns.</p><p>• Prototyping: When developing an application that has little data and little workload early in the development process, a single server solution is a more straightforward and less expensive choice.</p><p><strong>Key Characteristics of Single-Server:</strong></p><ul><li>Non-Distributed Architecture<br> All data resides on one machine. There’s no replication or partitioning across servers.</li><li>Simpler Configuration<br> No need to configure clusters, replication, or sharding. Suitable for small setups.</li></ul><p><strong>Advantages:</strong></p><ul><li>Simplicity: In comparison to distributed systems, the installation, configuration, and managing a single-server NoSQL database is much easier. There is no need to take into account problems caused by network latency, replication, or partitioning strategies.</li><li>Cost-Effective: The required hardware is only a single machine, and this can reduce Cloud or hosting costs considerably. There is no Managing complex infrastructure.</li><li>Immediate Consistency: Since no operations are done concurrently, thus only one server is used, there is no need for a mechanism that makes sure the data is updated in an eventual manner or a conflict resolution one.</li></ul><p><strong>Examples of Single-Server:</strong></p><p>1. MongoDB (Document-Based</p><ul><li>Used for content management in small apps like blogs.</li><li>Scaling requires multiple servers through sharding and replication.</li></ul><p>2. Redis (Key-Value Store)</p><ul><li>Primarily used for caching or session storage in small web applications.</li><li>Limited by memory size in single-server setups.</li></ul><p>3. Neo4j (Graph Database)</p><ul><li>Suitable for complex relationships in small recommendation engines.</li><li>Larger datasets require distributed setups.</li></ul><p><strong>2. Sharding (Data Partitioning)</strong></p><p>Basically, if the data is too large to be kept in one server, we can split the data into smaller parts and store them in different servers. It is known as sharding. Every shard holds a portion of the data. Hence, all shards combined represent the complete dataset. This method not only increases performance but availability as well which are the main features of the NoSQL databases like MongoDB, Cassandra, or DynamoDB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*u57Fwo-8XWAZFHrxQEbhOg.png" /></figure><p><strong>Key Characteristics:</strong></p><ul><li>Shard Key: One field or a couple of fields that are used to decide in which shard the data will be located. For instance, in a user database, user ID, or location where the user lives, could be the shard key.</li><li>Horizontal Scaling: As opposed to vertical, where one can add more power to one machine, with horizontal, one can add more machines. Sharding allows for more nodes to be added to increase capacity and thus better handle heavy loads.</li><li>Sharding Unit: The smallest unit of data that is taken from one shard and moved to another, normally it is a piece of a collection or a table.</li></ul><p><strong>Advantages:</strong></p><ul><li>Scalability: The usage of shards enables one to support millions of users and perform tens of thousands transactions per second at the same time, which would be a single server that is not allowed.</li><li>Performance: As each shard only takes care of its part and thus operates independently on a smaller portion of the data, the queries are of a smaller size, and so, shorter in time.</li><li>Cost Efficiency: It is quite cheap because it is made up of several low-cost PCs rather than one powerful high-end server.</li></ul><p><strong>Sharding in Popular NoSQL:</strong></p><ul><li>MongoDB: The sharding can be either range or hash to be applied. The metadata is stored in one or more config servers, and through a router (mongos), the queries are accessed. The distribution of shard keys plays a key role in achieving the unskewed allocation of data.</li><li>DynamoDB: It breaks up data automatically by using partition keys. The sharding and scaling are managed by AWS, which is done entirely out of the user’s sight.</li></ul><p><strong>3. Master-Slave Replication</strong></p><p>One of the fundamental design principles is the master-slave architecture. The system coordination is completely changed by the process of task assignment between the central and subordinate units. The concept of Master-Slave Architecture that underpins modern computing is ubiquitous in applications ranging from content delivery networks to database management. The article will first identify the components of the system, followed by data flow mechanisms and finally, introducing the applications of the system in the real world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*FAkCkmuRww1HEAWjU_Ec6w.png" /></figure><p><strong>When to use Master-Slave Replication :</strong></p><p>Master-slave replication is well suited for applications that:</p><p>· Have a read-heavy workload.</p><p>· Have a need for high availability to prevent data loss.</p><p>· Can tolerate eventual consistency or an occasional delay in the replication of data for reads. In sum, master-slave replication is a commonly used pattern in NoSQL to handle data redundancy, scalability of reads, fault tolerance, and high availability while maintaining writes centralized on a master node.</p><p><strong>Key Components of Master-Slave :</strong></p><ul><li>Master Node: The master node represents the central unit in the architecture which is in charge of coordinating and managing the overall functioning of the system. It answers the requests, dispatches operations to the slave nodes, and also receives the results of the work done in this way.</li><li>Slave Node: Slave nodes are the units that are the subordinates of the master node who execute the tasks assigned by the master node. They perform calculations, handle data, or execute specific operations as they are guided.</li><li>Communication Protocol: It is a set of regulations and customs that govern the exchange of information between slave and master nodes.</li><li>Task Distribution Mechanism: This method, which simplifies the process of task assignment from the master to the slave nodes, is the one that makes sure the resources are used in an efficient way.</li></ul><p><strong>4. Peer-to-Peer Replication</strong></p><p>Peer-to-Peer replication in NoSQL databases is a concept of distributed system design where nodes are coequal members of the network and thus have the same functionalities. A peer can thus be a client as well as a server, which means that a peer can read data from the database, as well as write data to the database. In contrast, Master-Slave replication defines the one node which is always the primary source of data in the replication architecture with the rest of the nodes that replicate from the master</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*jzxOcx2dUKDuq40dwt2rAg.png" /></figure><p><strong>Key Features of Peer-to-Peer Replication:</strong></p><p>· Decentralization: P2P replication allows for no single point of failure because each node can process requests independently. Each node improving the fault tolerance and availability of the overall system.</p><p>· Data Synchronization: Changes to data at any node are propagated to all other nodes, which allows all nodes to have eventually a consistent view of the data, even though synchronization may be delayed.</p><p>· Scalability: P2P systems are easy to horizontally scale because you can simply add more nodes to the network. Since each new node can participate as an equal and share the workload you have effectively increased both throughput and storage.</p><p>· Load Balancing: Work can be balanced across all total nodes which results in better performance as no single node is processing an onslaught of requests.</p><p><strong>Advantages of Peer-to-Peer (P2P) Networks:</strong></p><ul><li>Decentralization: P2P networks distribute control and resources among peers, eliminating the need for a central server. This decentralization increases resilience and reduces the risk of a single point of failure.</li><li>Cost Reduction: P2P networks can significantly reduce costs associated with infrastructure, maintenance, and bandwidth, as they rely on resources contributed by peers rather than centralized servers.</li><li>Content Redundancy and Availability: The replication of content over different peers not only provides redundancies but also guarantees continuous availability, thus allowing the network to function as a whole even when some peers go offline or have technical issues.</li></ul><p><strong>Real-life example of Peer to Peer model:</strong></p><p>· BitTorrent: File-sharing protocol where users download and upload file pieces directly, using clients like Bit Torrent. No central server; scales with more users.</p><p>· Bitcoin: Decentralized cryptocurrency network where nodes validate transactions and maintain the blockchain, enabling direct transfers without banks.</p><p>· Skype (Early Versions): Used P2P for voice/video calls, with user devices routing traffic, reducing server costs.</p><p><strong>References:</strong></p><p>· <strong>Pramod J. Sadalage ,Martin Fowler (2012)-</strong> NoSQL Distilled</p><p>· <strong>GeeksForGeeks(2025).Retrieved from</strong> <a href="https://www.geeksforgeeks.org/system%20design/difference-between-master-slave-replication-and-peer-to-peer%20replication/">https://www.geeksforgeeks.org/system design/difference-between-master-slave-replication-and-peer-to-peer replication/</a></p><p>· <strong>Vagner, A. (2023). Retrieved from </strong><a href="https://www.scitepress.org/Papers/2023/121427/121427.pdf"><strong>https://www.scitepress.org/Papers/2023/121427/121427.pdf</strong></a></p><p>· <strong>Gautam, S. (2024). Retrieved from enjoyalgorithm: </strong><a href="https://www.enjoyalgorithms.com/blog/master-slave-replication-databases">https://www.enjoyalgorithms.com/blog/master-slave-replication-databases</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e9e7ad9dd50" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>