<?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 Ayush Solanki on Medium]]></title>
        <description><![CDATA[Stories by Ayush Solanki on Medium]]></description>
        <link>https://medium.com/@ayush17solanki?source=rss-8b995b7c3b35------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-z2GUkas1uspd3e9zjizEg.jpeg</url>
            <title>Stories by Ayush Solanki on Medium</title>
            <link>https://medium.com/@ayush17solanki?source=rss-8b995b7c3b35------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 19:38:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ayush17solanki/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[Architecting Enterprise GenAI Inference Solutions on AWS: Best Practices]]></title>
            <link>https://medium.com/gen-ai-architectures/architecting-enterprise-genai-inference-solutions-on-aws-best-practices-7027bf08d815?source=rss-8b995b7c3b35------2</link>
            <guid isPermaLink="false">https://medium.com/p/7027bf08d815</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[llm-inference]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Ayush Solanki]]></dc:creator>
            <pubDate>Thu, 06 Nov 2025 09:13:57 GMT</pubDate>
            <atom:updated>2025-11-06T09:13:57.353Z</atom:updated>
            <content:encoded><![CDATA[<p>Designing secure and reliable genai model inference architectures with AWS.</p><p>From research experiments to actual enterprise deployments, generative AI continues to advance rapidly. AI is currently being widely used by businesses for knowledge management, content creation, and customer service. However, scaling, security, latency, cost, and observability highlight distinct challenges when putting these systems into production.</p><p>In this blog, we’ll explore how AWS enables businesses to create GenAI inference systems that are ready for production, sharing practical architecture patterns and design considerations. Presenting<strong> two production-ready architecture patterns</strong>, we describe why they work, what alternatives exist, and how to balance cost and performance in 2025.</p><p>What are you going to discover?</p><ul><li>Understand <strong>real-world GenAI</strong> inference architecture patterns that can be built on AWS.</li><li>Learn the <strong>trade-offs between managed services (Bedrock) and custom SageMaker deployments</strong>.</li><li>Understand <strong>cost optimisation and best practices</strong> for medium-scale GenAI deployment.</li></ul><h3>Pattern 1: Serverless Bedrock Inference: Production-Ready Architecture</h3><p>This pattern demonstrates how to expose AWS Bedrock LLM APIs via <strong>Lambda</strong> and <strong>API Gateway</strong>, enabling secure, scalable inference with caching, request pre- and post-processing, and logging for observability. It’s ideal for prototype workloads or small-to-medium-sized enterprise scenarios with low to medium traffic.</p><h3>1.1 Target use cases</h3><p>This architecture is best suited for scenarios where you need <strong>controlled, scalable GenAI access</strong> without heavy operational overhead:</p><ul><li>Prototype AI-powered chatbots or API endpoints</li><li>Lightweight content generation tasks</li><li>General-purpose inference workloads that don’t require heavy customization</li><li>Internal knowledge assistants (HR, IT, legal teams)</li></ul><blockquote><em>If your workload requires fine-tuned models, a SageMaker endpoint is a more appropriate option.</em></blockquote><h3>1.2 Architecture overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*rdKhKLQS7F3hdwtgilonJA.png" /><figcaption>Fig 1.1 Foundational model inference architecture</figcaption></figure><p><strong>API Gateway</strong> Handles client requests, authentication, throttling, and basic monitoring. <strong>Lambda Function</strong> Orchestrates requests and handles pre/post-processing, caching, Bedrock calls. <strong>Amazon Bedrock</strong> is managed LLM inference service from AWS. <strong>ElastiCache </strong>is used for caching to reduce token usage and latency. <strong>CloudWatch</strong> to track metrics and logs for operational visibility and <strong>S3</strong> for Long-term storage for logs or prompts.</p><blockquote>Here think of Lambda as your “traffic manager and processor,” Bedrock as the AI engine, and ElastiCache as the quick-access memory to avoid repeating costly calls.</blockquote><h3>1.3 Request Process</h3><ol><li>Requests are sent from the client to the API gateway.</li><li>The API Gateway manages <strong>basic logging, throttling, and authentication</strong></li><li>Lambda looks for pre-existing responses in the <strong>cache</strong>.</li><li>f the cache is missed, a prompt is prepared and <strong>Bedrock.</strong> is called.</li><li>Lambda caches the AI-generated response that Bedrock returns.</li><li>The client receives the response back from Lambda.</li><li>Logs are stored in <strong>S3</strong> for analysis and auditing.</li></ol><h3>1.4 Comparing with other approaches</h3><p>In comparison to <strong>Direct call to the Bedrock model</strong> our approach has following advantages:</p><ul><li>Traffic management (avoid going overboard or overloading Bedrock)</li><li>Authorization and authentication logic</li><li>The ability to include monitoring, retries, and caching</li><li>Later transition to multi-tenant or hybrid architectures is simpler.</li></ul><p>In comparison to <strong>SageMaker endpoints</strong> we have below advantages in this approach:</p><ul><li>Greater operational overhead but greater control.</li><li>Hand-held administration.</li></ul><h3>1.5 Production deployment considerations</h3><ul><li>Reduce latency by using small “warm” Lambdas and caching frequently asked questions.</li><li><strong>Scaling:</strong> API Gateway throttling prevents overload; Lambda auto-scales</li><li><strong>Reliability:</strong> Retry unsuccessful requests with exponential backoff to ensure reliability.</li><li><strong>Security:</strong> Cognito and API keys for API Gateway auth, IAM roles</li><li><strong>Observability:</strong> X-Ray for tracing and CloudWatch for metrics and logs</li><li><strong>Caching:</strong> ElastiCache for recurring queries</li></ul><h3>1.6 Estimates of costs</h3><p>The monthly cost is typically low for a <strong>low-to-medium traffic prototype</strong>. The combined monthly cost of <strong>Lambda</strong> and <strong>API Gateway</strong> is typically only a few dollars. Depending on the prompt and output size, <strong>Bedrock token usage</strong> is the main cost driver. Token consumption can be decreased by <strong>approximately 30–40%</strong> by implementing a <strong>small caching layer</strong> with ElastiCache or DynamoDB, which will drastically cut overall expenses. While optional <strong>S3 storage</strong> for long-term logs or outputs usually stays affordable unless storing large volumes, <strong>CloudWatch</strong> for logs and metrics adds some overhead over budget.</p><blockquote><em>Even for small public-facing APIs or multiple internal teams, this architecture can economically deliver production-ready AI inference through token monitoring, clever prompt design, and caching.</em></blockquote><h3>1.7 Why This Pattern Works</h3><ul><li><strong>Scalable:</strong> Handles sudden spikes with Lambda + API Gateway.</li><li><strong>Cost-effective:</strong> Pay-per-use pricing; caching reduces token consumption</li><li><strong>Secure:</strong> Controlled access through IAM and API Gateway</li><li><strong>Extensible:</strong> Can evolve into multi-tenant or hybrid architectures.</li><li><strong>Observability:</strong> CloudWatch or X-Ray + optional S3 ensures monitoring, auditing, and troubleshooting</li></ul><blockquote><em>This production-ready prototype is lightweight enough for early deployments but built with enterprise considerations in mind.</em></blockquote><p>Now we will explore another common pattern for custom finetuned model deployment.</p><h3>Pattern 2: SageMaker Custom Model Deployment: Production-Ready Architecture</h3><p>This pattern offers enterprises more control over models, performance, and scaling while still utilizing AWS-managed infrastructure by deploying <strong>custom or fine-tuned ML models</strong> on <strong>SageMaker endpoints</strong>. You can host <strong>proprietary models</strong>, train them using your own datasets, and adjust the underlying compute to fit your workload, unlike Bedrock.</p><h3>2.1 Use Cases for Targets</h3><p>When you require <strong>more control or heavier workloads</strong> than the serverless Bedrock pattern, this architecture is perfect:</p><ul><li>Content generation pipelines needing consistent latency and performance.</li><li>Scenarios requiring shadow testing or A/B testing for multiple model versions.</li><li>High-volume inference workloads where caching alone is insufficient; production chatbots or assistants with enterprise-specific knowledge.</li><li>Hosting optimized LLMs or proprietary GenAI models.</li></ul><h3>2.2 Architecture Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*DqVNyW8EFj-qw5TccEIR4Q.jpeg" /><figcaption>Fig 2.1: Custom model deployment architecture</figcaption></figure><p><strong>API Gateway</strong> provides secure entry point for client requests also handles throttling and monitoring. <strong>Lambda Function</strong> orchestrates requests along with pre/post-processing, validation, logging. <strong>SageMaker Endpoint</strong> Hosts custom or fine-tuned models and auto-scales based on traffic. <strong>ElastiCache </strong>caching layer to reduce repeated requests. <strong>CloudWatch and X-Ray</strong> for observability: logs, metrics, tracing. <strong>S3</strong> Stores training data, model artifacts, and logs.</p><h3>2.3 Request Flow</h3><ol><li>Request is sent by the client to the API gateway</li><li>API Gateway logs metrics, throttles, and authenticates</li><li>A request is sent to Lambda:<br>a. Prepares the input payload for SageMaker<br>b. Verifies the cache for recurring queries</li><li>Inference is carried out by SageMaker Endpoint.</li><li>Lambda may choose to cache the outcome.</li><li>The client receives a response from Lambda.</li><li>The entire workflow is logged by CloudWatch/X-Ray; logs can be stored in S3 if desired.</li></ol><blockquote><em>Shadow deployments: Prior to a full rollout, you can test a new model version by sending a small percentage of traffic there.</em></blockquote><h3>2.4 Evaluation in Relation to Other Approaches</h3><ul><li>AWS Bedrock is quicker to deploy, but it doesn’t offer complete model control or <strong>customization</strong>. Tuning for enterprise-specific tasks is limited.</li><li>The self-managed EC2/ECS/EKS GPU deployment offers complete control and a reduced hourly rate for round-the-clock inference. Increased operational costs and a greater need for DevOps.</li></ul><h3>2.5 Production Deployment Considerations</h3><p>SageMaker endpoints are <strong>always warm</strong>, which guarantees consistent response times.</p><ul><li><strong>Scaling:</strong> Endpoint auto-scaling modifies the number of instances according to traffic; for high-volume bursts, it is combined with caching.</li><li><strong>Reliability:</strong> Although infrastructure management is handled by SageMaker, use Lambda to implement <strong>retries</strong>.</li><li><strong>Security:</strong> VPC endpoints, IAM roles, and API Gateway for request control.</li><li><strong>Observability:</strong> S3 for logs and artifact storage; CloudWatch and X-Ray for total visibility.</li><li><strong>Versioning:</strong> Safe iteration is made possible by A/B testing, shadow deployments, or multiple endpoints.</li></ul><h3>2.6 Cost Overview</h3><ul><li>A single ml.g5.2xlarge instance can manage medium traffic at <strong>hundreds of dollars per month</strong>. This is the small production endpoint.</li><li>Repetitive inference can be decreased by <strong>reducing token usage by 20–30%</strong> by using ElastiCache for caching.</li><li>In addition to model and EBS volume storage, SageMaker endpoints are <strong>billed by instance-hour</strong>.</li><li>Except for <strong>large scale</strong> logging, CloudWatch and S3 storage are comparatively inexpensive.</li></ul><blockquote><em>Insight: SageMaker frequently offers stable performance and predictable costs for high-volume enterprise workloads, all without the operational strain of running your own GPU cluster.</em></blockquote><h3>2.7 The Reason This Pattern Is Effective</h3><ul><li><strong>Customizable</strong>: Host your own or fine-tuned models.</li><li><strong>Managed:</strong> AWS manages servers, scaling, patching, and networking.</li><li><strong>Predictable performance:</strong> Endpoints are warm, offering low-latency responses.</li><li><strong>Extensible:</strong> Supports multiple versions, shadow testing, or multi-model endpoints.</li><li><strong>Observability &amp; Governance:</strong> It is enterprise-ready thanks to logs, metrics, and S3 storage.</li></ul><p>SageMaker endpoints are perfect for enterprise GenAI workloads because they offer a balance between managed simplicity, scalability, and complete control.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7027bf08d815" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gen-ai-architectures/architecting-enterprise-genai-inference-solutions-on-aws-best-practices-7027bf08d815">Architecting Enterprise GenAI Inference Solutions on AWS: Best Practices</a> was originally published in <a href="https://medium.com/gen-ai-architectures">GEN AI Architectures</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smart India Hackathon 2022: Tech Journey]]></title>
            <link>https://ayush17solanki.medium.com/smart-india-hackathon-2022-tech-journey-21626fad075e?source=rss-8b995b7c3b35------2</link>
            <guid isPermaLink="false">https://medium.com/p/21626fad075e</guid>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[skill-recommendation]]></category>
            <category><![CDATA[smart-india-hackathon]]></category>
            <dc:creator><![CDATA[Ayush Solanki]]></dc:creator>
            <pubDate>Sun, 11 Sep 2022 07:08:39 GMT</pubDate>
            <atom:updated>2022-09-11T07:10:09.564Z</atom:updated>
            <content:encoded><![CDATA[<h3>Smart India Hackathon 2022: Tech Journey for “Future Skills Recommendation”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1X00KdEJPb6IyUbyuG033A.png" /></figure><p>A Few Days ago, Me and my team “The Pioneers” won Smart India Hackathon 2022 organized by Ministry of Education, Indian Government and AICTE. Let me give a brief Introduction about the problem statement first.</p><blockquote>Problem Statement ID:<strong> PK848</strong></blockquote><blockquote>Problem Statement: <strong>Future Skills Recommendation</strong></blockquote><blockquote>Concerned Ministry: Ministry of Electronics and Information Technology</blockquote><blockquote>Domain Bucket: <strong>Smart Automation</strong></blockquote><blockquote>Problem Statement Description: “Due to the changing technology and its requirement for getting employed in India and abroad, there has to improvements suggested by experts for predicting the Prediction of Admission &amp; Jobs in Engineering &amp; Technology /Management/Pharmacy with respect to his/her strength, age, location and similar important factors. This is not a one time process and needs to be done frequently as trends in the industry keep changing. Addressing this problem will introduce the required changes that would bring the current youth and upcoming generations in parallel with the students of other countries in terms of knowledge and skills in that domain.”</blockquote><p>I was leading the Tech Department in which, I worked with a lot of different technologies in order to complete this project. We named our application as <strong><em>“SkillItUp”.</em></strong> Basically, My Role was as a Allrounder 🙃, where I used my <strong>Data Science, Machine Learning, Cloud Computing, Web-Backend Development, Database Administrator, Flutter Development, Documentation and Other Programming Skills. </strong>Working with these much different technologies isn’t easy as it seems to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PfhnW0zKPZ1YJXXgKiQE2g.png" /></figure><p>Enough of Introduction, Now Let&#39;s start with the Tech Journey. Before entering into the hackathon, we developed basic prototype model for our solution. Following are its Tech Specifications</p><blockquote>Backend (Web-Server for API): <strong>Django</strong></blockquote><blockquote>Frontend (Mobile App): <strong>Flutter</strong></blockquote><blockquote>Cloud (Hosting &amp; Administration): <strong>Amazon AWS</strong></blockquote><blockquote>Database: <strong>Postgre SQL (Amazon RDS)</strong></blockquote><blockquote>Machine Learning: <strong>Scikit-Learn and Tensorflow</strong></blockquote><p>The Main algorithm which I developed was Skill Recommendation Algorithm Based on User Preferences. Here we asked questions to user about his <strong>Academic performance</strong>, His <strong>Technical Interests</strong> and other Preferences to predict the best possible Job Role in Information Technology Department for the user. This algorithm remained Heart of My Project. The main game which we played was around this algorithm.</p><p>Classification Algorithms were used to implement this feature. We used <strong>XGBoost</strong> Algorithm in this feature which gave us the best accuracy of about <strong>97.5%</strong>. We also tested the dataset for SVM which gave accuracy of 93%. Below is the final output of the application for this feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*6KF32Xp1MQSjHDmf2MqquQ.png" /></figure><p>Here as you can see my main focus remained on predicting IT Skills. To prove my point I had done analysis on <strong>World Bank Dataset</strong> and Found IT Sector to be the most Skill Demanding Factor as of 2022.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDKD_z0PvbZGfnFO83S_yw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nr8go732VijdFHaN20NpQw.png" /><figcaption>Data Visualization for IT Skills</figcaption></figure><p>So this point helped us in proving our Above Feature right in front of the Jury Panel. Now another thing which we added as a prototype in our project was <strong>Trending Technology Section.</strong></p><p>In this section we scraped data from Live Website of Stack Overflow and Github which provided Data of Analytics of IT Skills. We simply scraped those data and further ranked them according to the popularity ranked and then displayed the whole data on our screen. We scraped data about Trending Technologies and Trending Professions as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*MLvmUU42rS81YKDxGwcLqg.png" /></figure><p>So with this basic prototype we entered the Hackathon contest and started interaction with the Jury members. <strong>First Mentoring Round</strong> was Quite Heavy for us. As I mentioned before being a Machine Learning and Backend Engineer, the main task to tackle the jury questions and solve the given problem was on me. In the First Round Itself, I realized that Judges are more focused on Machine Learning, rather than frontend or UI/UX of the application. The First round feedbacks were to add <strong>College Admission Prediction and Location &amp; Age based Job Suggestion for all departments</strong>. At first It looked quite heavy task as everything must be dynamic and done through automation. Dataset must have certain validities which must be checked for integrity of data which is added.</p><p>So, I began just surfing around and thinking about the best possible way to solve the given problem. We had around <strong>6 hours</strong> to solve these given problems. We decided to give Admission Prediction a Priority as It was less complex. We found a dataset on Kaggle named as “<a href="https://www.kaggle.com/datasets/rumbleftw/iit-nit-data"><strong><em>IIT-NIT category-wise cutoff data</em></strong></a>”. I examined this dataset and found it perfect to solve the given task. I classified the required parameters like All India Rank, Caste Category, All Girls/General, Location and Program Name. We fitted Decision Tree Algorithm Here to get around 75% Accuracy.</p><p>After Admission prediction, other task was to develop Location and Age based Job Role Suggestion System for all departments. here we used the World Bank Data-Set once again to expand our application. We used to predict different department job role suggestions and I developed a mechanism to get Country based best Job Role Suggestion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1EIBn3pYV7aHQKjSYZw5hQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4abqln-L7wiq68E9QHGrTA.png" /></figure><p>As we completed this, The Second Round Started. As I mentioned we got around 75% accuracy in Admission Prediction after First Round. Now the Jury suggested me to improve the accuracy of the model to take it above 85% and then merge it with the main Application. Also jury members suggested to Try Neural networks with Deep learning Techniques.</p><p>So now the Real hackathon started, I mean the Night Time. In the Night Time there were lot of tasks for me as I mentioned I was a Full Stack as well as Devops Engineer for this project. A lot of pressure was there on me :). Following were the tasks to accomplish on my side in the next few hours before final round:</p><blockquote>Improve Accuracy of Admission Prediction</blockquote><blockquote>Feature Selection on Location based Jobs</blockquote><blockquote>Neural Network Integration</blockquote><blockquote>Dumping the models into backend</blockquote><blockquote>Backend API Development</blockquote><blockquote>AWS Deployment and Setup</blockquote><blockquote>Etc.. Many more and Specially the BUGS!!!!</blockquote><p>Huh!!</p><p>After drinking the Mango Juice as an energy drink, I started to work on the problems and Tried my best to solve the given problems. Following are the solutions which I successfully achieved</p><blockquote>Accuracy Improved to 89%</blockquote><blockquote>Successful API Integration</blockquote><blockquote>Proper AWS Configuration</blockquote><blockquote>Feature Selection</blockquote><p>I wasn&#39;t that much successful on deploying Neural network on the cloud to be honest. But I gathered all the reports and proofs of concepts about our project and was ready to face the jury for the last round.</p><p>My main focus on last round was to give the best presentation with all the proofs as a hard copy to made the working desk clean and perfect for jury members to analyze the project fully. After a lot of discussions and arguments and proofs the final round lasted around 20–25 minutes and the Jury quite looked satisfied from my answers!!</p><p>So here are some final screenshots shown to judge as future enhancements:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*hbZ2z3xT2sxx60ekPQGelA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*pcdcr_0AiUDvpwGq8DJLUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qhe-Uech-Gn5Kd5ey8Ie3A.png" /></figure><p>After an Hour in the final ceremony, We were announced as winners and nothing can match that feelings :)</p><p>Enough said now so lets conclude it.</p><p>So overall my experience was very good while working with these all different technologies and interacting with the Judges and Chief Guests during the hackathon.</p><p>Thank You :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21626fad075e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1.1 Introduction to DBMS]]></title>
            <link>https://medium.com/database-management-system/1-1-introduction-to-dbms-15ce418101ea?source=rss-8b995b7c3b35------2</link>
            <guid isPermaLink="false">https://medium.com/p/15ce418101ea</guid>
            <dc:creator><![CDATA[Ayush Solanki]]></dc:creator>
            <pubDate>Mon, 06 Sep 2021 16:03:06 GMT</pubDate>
            <atom:updated>2021-09-06T16:13:26.991Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is DBMS?</h3><p>Database Management System (DBMS) is a collection of interrelated data and a set of programs to access those data. The collection of data, usually referred to as the database, contains information relevant to an enterprise. The primary goal of a DBMS is to provide a way to store and retrieve database information that is both convenient and efficient.</p><h4>Use of DBMS</h4><p>Database systems are designed to manage large bodies of information. Database systems are used to manage collections of data that are highly valuable, are relatively large and are accessed by multiple users and applications at a same time.</p><h4>Data V.S Information V.S Knowledge</h4><p>By Data, we mean raw facts which can be recorded and that have an implicit meaning. Information means interpreted data i.e. data supplied with semantics. Knowledge refers to practical use of information. A database is a collection of data, usually stored in electronic form.</p><h3>Application of Database</h3><ul><li><strong>Banking:</strong> To keep track of all the transactions.</li><li><strong>Human Resource:</strong> Employee’s information, records and salaries, tax deduction etc..</li><li><strong>Airlines:</strong> Reservation and Scheduling.</li><li><strong>Universities:</strong> Registration and Grade records.</li><li><strong>Online Retailers:</strong> Purchase, Customer’s order, Sales, Products.</li><li><strong>Enterprise:</strong> Sales, Profit, Accounting, Human resources.</li><li><strong>Manufacturing:</strong> production, inventory, orders, supply chain.</li><li><strong>Social Media:</strong> For keeping records of user activity.</li><li><strong>Games:</strong> For saving user’s progress.</li><li><strong>Navigation System:</strong> For storing routes.</li></ul><p><strong>And many more…</strong>..</p><h3>Need of Database Management System</h3><ul><li><strong>To manage large amounts of data:</strong> A database stores and manages a large amount of data on a daily basis. This would not be possible using any other tool such as a spreadsheet as they would simply not work.</li><li><strong>Accuracy:</strong> A database is pretty accurate as it has all sorts of build in constraints, checks etc. This means that the information available in a database is guaranteed to be correct in most cases.</li><li><strong>Easy to update data:</strong> In a database, it is easy to update data using various Data Manipulation languages (DML) available.</li><li><strong>Security of data:</strong> Databases have various methods to ensure security of data. There are user logins required before accessing a database and various access specifiers. These allow only authorised users to access the database.</li><li><strong>Data integrity:</strong> This is ensured in databases by using various constraints for data. Data integrity in databases makes sure that the data is accurate and consistent in a database.</li><li><strong>Easy to research data:</strong> It is very easy to access and research data in a database. This is done using Data Query Languages (DQL) which allow searching of any data in the database and performing computations on it.</li></ul><h3>Drawbacks of Traditional File System</h3><ol><li><strong>Data redundancy and inconsistency:</strong> Since different programmers create the files and application programs over a long period, the various files are likely to have different structures, and the programs may have been written in different programming languages. Moreover the same information may be duplicated in several places. This redundancy leads to higher storage and access cost. In adiition it may lead to data inconsistency i.e. various copies of the same data may not be similar.</li><li><strong>Difficulty in accessing data:</strong> Due to multiple files it may become difficult to access data. Application programs written to read files might not be sufficient for future requests. If more different sorted or filtered data is needed then the programmers need to write different programs to access paritcular data. This might be time consuming as well as resource consuming. The point here is that the conventional file processing enviroments do not allow needed data to be retrieved in a convenient and efficient manner. More responsive data to be retrieved in a convenient and efficient manner. More responsive data retrieval systems are required for general use.There is need to write new program to carry out each task.</li><li><strong>Data Isolation:</strong> Because data is scattered in various files and files may be in different formats, writing new application programs to retrieve the appropriate data is diificult.</li><li><strong>Integrity Problems:</strong> The data values stored in the databse must satisfy certain types of consistency constraints. Constrainst means providing condition for the data to be stored (For ex: Age &gt;= 18 etc..). Integrity constraints get burried in program code rather than being state explicitly. Difficult to add new constraints or edit the previous ones.</li><li><strong>Atomicity Promblems:</strong> A computer system like any other device is subject to fialure in many applications, it is crucial that if failure occurs the data should be restored to the consistent state that existed prior to the failure. Failures may leave database in an inconsistent state with partial updates carried out. Transactions should be atomic i.e It should either complete or not happen at all. If the transaction fails then it should be restored to consistent state. Atomicity means it must happen entirely or not at all. It is difficut to ensure atomicity in conventional files.</li><li><strong>Concurrent access anomalies:</strong> For the sake of overall performance of the system and faster response, many systems allow multiple users to update the data simultaneously. Concurrent access is needed for better performance and user experience. Uncontrolled concurrent access can lead to data inconsistencies. So it is necessaryt o have acess control too. In file systems, it is difficult to give users concureent access. Even if we provide users concurrent access, data inconsistency can occur in traditional file systems.</li><li><strong>Security Problems:</strong> Not every user of the database system should be able to acess all the data. Since application programs are added to file processing system in an ad hoc manner then enforcing secuirty constraints is difficult.</li></ol><p>So this was the basic introduction about what dbms is and why we require it. I hope you like it and it would be helpful for you :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15ce418101ea" width="1" height="1" alt=""><hr><p><a href="https://medium.com/database-management-system/1-1-introduction-to-dbms-15ce418101ea">1.1 Introduction to DBMS</a> was originally published in <a href="https://medium.com/database-management-system">Database Management System</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Socket.IO in NodeJS with simple example]]></title>
            <link>https://medium.com/deep-tour-of-node-js/introduction-to-socket-io-in-nodejs-with-simple-example-74214e6c1da7?source=rss-8b995b7c3b35------2</link>
            <guid isPermaLink="false">https://medium.com/p/74214e6c1da7</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[socketio]]></category>
            <category><![CDATA[expressjs]]></category>
            <dc:creator><![CDATA[Ayush Solanki]]></dc:creator>
            <pubDate>Sun, 21 Mar 2021 15:40:06 GMT</pubDate>
            <atom:updated>2021-03-21T15:40:06.831Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*PmrNrm9OCIHzONht9eqOuw.png" /></figure><h3>What is Socket.IO ??</h3><p>In traditional HTTP servers, when client requests for the resource then and then only the server responds. Server can not respond to user if new data is available. Disadvantage of these servers is user have to request again and again continuously in order to get new data. This increases load on server as well as user is also frustrated. Web Socket is a communication protocol which provides a full-duplex and low-latency channel between the server and the browser. It is used to implement connection between server and client such that server can also respond to client if new data is available or the old data is updated. <strong>Socket.IO is a library that enables real-time, bidirectional and event-based communication between the browser and the server.</strong><br>We can connect client and server responding to each other using socket.io.<br> <strong>BUT Socket.IO is NOT a WebSocket implementation. Socket.IO uses WebSocket as a transport when possible, but it adds additional metadata to each packet. Due to this WebSocket client will not be able to successfully connect to a Socket.IO server, and a Socket.IO client will not be able to connect to a plain WebSocket server either.</strong></p><h4>Features that socket.io provides over traditional WebSockets</h4><ul><li>Reliability.</li><li>Automatic Reconnection.</li><li>Acknowledgments.</li><li>Broadcasting to all clients or to a subset of clients (similar to Group chats).</li></ul><h3>Let’s Code</h3><p>So we got enough theory knowledge of what socket.io is so let’s see a short and simple example of socket.io</p><p>Here we will built a small application which will have one screen as sender and one screen is receiver. I tried to keep things simple so a beginner can understand this easily.</p><p>Lets start by creating a Express server on Node JS. Create an empty directory and run the following command to initialize node project.</p><pre>npm init</pre><p>Specify some application specifications there or you can press “Enter” key and keep skipping them and keeping them as default value. Also install express and socket.io using following commands:</p><pre>npm install express<br>npm install socket.io</pre><h3>Initializing Server in Index.js</h3><p>Create a new file namely <strong>index.js</strong> and import some requirements.</p><pre>const express = require(‘express’) // Importing Express<br>const app = express() // Creating Express Server<br>const host = ‘localhost’ // Specifying Host<br>const port = 8000 // Specifying Port number</pre><pre>// Creating Http Server from Express App to work with socket.io<br>const http = require(‘http’).Server(app);</pre><pre>// Initializing socket.io object<br>const io = require(‘socket.io’)(http,{<br> // Specifying CORS <br> cors: {<br> origin: “*”,<br> }<br>})</pre><p>Here in the <strong>first line</strong> we are importing express library in order to create an express server in Node JS. In <strong>second line</strong> we are creating an express app using express(). Then we are specifying our host and port number. In normal express apps you usually wont create http server object. But inorder to work with socket.io we need to create instance of http server from express app. You can use express app’s methods like .get() and .post() to listen to different endpoints.</p><p>After that we are creating instance <strong>io</strong> of socket.io. It will have http object as its first parameter and other parameters are optional. We are specifying cors parameters so that currently any application can access our data. But during production time remember to allow only specific applications to read our data.</p><h3>Creating endpoints using express Apps.</h3><pre>app.use(express.urlencoded({ extended: true })) // Specifying to use urlencoded</pre><pre>// Creating object of Socket<br>const liveData = io.of(“/liveData”) // URL which will accept socket connection</pre><pre>// Socket event<br>liveData.on(“user-connected”,(username)=&gt;{<br> console.log(`Receiver ${username} connected..`) // Logging when user is connected<br>});</pre><pre>// Get request on home page<br>app.get(‘/’, (req, res) =&gt; res.send(‘Hello This is our Home Page’))</pre><pre>// Post request on home page<br>app.post(‘/’,(req, res) =&gt; {<br> liveData.emit(“new-data”,req.body.message) // Emitting event.<br>})</pre><pre>// Listening on Host and Port<br>http.listen(port, host, () =&gt; console.log(`Listening on <a href="http://${host}:${port}/`">http://${host}:${port}/`</a>))</pre><p>Here firstly we are specifying to use urlencoded() which will help us to get form data which is send from html file. Then we are creating socket object and in them in .of() method we are specifying the url which will listen to the socket connection.</p><p>Then we are specifying an event listener which will have a callback which will be fired when the event is emitted. .on() method is used to declare event listener. First parameter is the name of the event and second parameter is the callback method. Then we are specifying get and post request on our homepage. In post request we are emitting an event called “new-data” with the data which we received from the sender. This event will be listened on client side. <strong>Then most importantly remember to call listen() method of http object not express app!!.</strong></p><p>So far we have created a NodeJS-Express server which will listen to connections from socket.io. Now lets create the clients.</p><h3>Creating Sender File</h3><p>Create a new HTML file called “sender.html” and create a normal form with one input field as message as shown below.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=”en”&gt;<br>&lt;head&gt;<br> &lt;title&gt;Sender&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br> &lt;form action=”<a href="http://localhost:8000/">http://localhost:8000/</a>&quot; method=”post”&gt;<br> &lt;input type=”input” name=”message”&gt;<br> &lt;input type=”submit” value=”send”&gt;<br> &lt;/form&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>We are doing nothing special here. We are just creating a HTML form with post request to our home page.</p><h3>Creating Receiver File</h3><p>Now we will create a receiver HTML file. Here we will include a script from CDN which is socket.io client.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=”en”&gt;<br>&lt;head&gt;<br> &lt;script src=”<a href="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.0/socket.io.js">https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.0/socket.io.js</a>&quot; integrity=”sha512–74AKPNm8Tfd5E9c4otg7XNkIVfIe5ynON7wehpX/9Tv5VYcZvXZBAlcgOAjLHg6HeWyLujisAnle6+iKnyWd9Q==” crossorigin=”anonymous”&gt;&lt;/script&gt;<br> &lt;title&gt;Reciever&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br> &lt;h1&gt;Your messages are here&lt;/h1&gt;<br> &lt;h2 id=”msgBox”&gt;&lt;/h2&gt;<br> &lt;script&gt;<br> const msgBox = document.getElementById(“msgBox”)<br> const socket = io.connect(“<a href="http://localhost:8000/liveData">http://localhost:8000/liveData</a>&quot;)<br> socket.on(“new-data”,(data)=&gt;{<br> msgBox.innerHTML += (data + “&lt;br/&gt;”)<br> })<br> const username = prompt()<br> socket.emit(“user-connected”,username)<br> &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Then just before ending body tag include &lt;script&gt; tag and then we are getting the element by Id in msgBox. Then we should use io.connect(url) to connect to our server. Check the url if it is properly configured and matches the same url where server is hosted. Then we are creating an event listener which will listen to an event named “new-data” is event will be emitted from the server. After that we are creating a prompt to get username of the user and then we emit a socket event which will be listened on the server.</p><h3>Conclusion</h3><p>So this is a simple example where we are creating two separate files for sender and receiver in order to keep it simple and beginner friendly we learned how to set event Listeners and how to emit the events. I hope it was helpful to you. Have a good day ahead. Happy Learning!! Don’t forget to follow for more programming stuff :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74214e6c1da7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/deep-tour-of-node-js/introduction-to-socket-io-in-nodejs-with-simple-example-74214e6c1da7">Introduction to Socket.IO in NodeJS with simple example</a> was originally published in <a href="https://medium.com/deep-tour-of-node-js">Deep tour of Node JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Java programs are executed??]]></title>
            <link>https://ayush17solanki.medium.com/how-java-programs-are-executed-ece388be5dd9?source=rss-8b995b7c3b35------2</link>
            <guid isPermaLink="false">https://medium.com/p/ece388be5dd9</guid>
            <category><![CDATA[compilers]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[jvm]]></category>
            <dc:creator><![CDATA[Ayush Solanki]]></dc:creator>
            <pubDate>Fri, 22 Jan 2021 12:18:21 GMT</pubDate>
            <atom:updated>2021-01-22T12:22:50.863Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have programmed in java, you must have wondered how these java programs are executed inside the compiler and machine. If you are new to java it is necessary to know how the java programs are executed in order to use this programming language efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*T6ElBWig_w64o46EqY6MRg.jpeg" /><figcaption>Java Program Execution Block</figcaption></figure><p>Java programs are compiled and then they are runned. Firstly java program’s source code is written by the programmer using any text editor and the source code file is saved with <em>.java</em> extension. Then this <em>.java</em> file is compiled using the <em>javac filename.java</em> command. The compiler compiles this source code into the byte code if there are no errors. Bytecode file has a <em>.class</em> extension. This bytecode can be distributed among different machines and it will run on different operating systems. To run a java program we will need JVM(Java Virtual Machine). There are different JVM editions for different operating systems. To run a java program we will use the <em>java filename.java</em> command. JVM has a class loader which loads the <em>.class</em> file. After loading the bytecode <em>.class</em> file the JVM execution engine executes the bytecode and generates machine code which is run on the machine.</p><h3>So, what is JVM?</h3><p>JVM(Java Virtual Machine) is an abstract machine. It is a specification that provides a runtime environment in which java bytecode can be executed. JVM is platform dependent i.e each operating system will have a different edition of JVM. JVM is the one that actually calls the main method present in a java code. JVM is a part of JRE(Java Runtime Environment). Whenever you write a java command on the command prompt to run the java class, an instance of JVM is created. Loading,Verification and Execution of code is done by JVM. It provides a runtime environment. JVM provides definitions for memory management, garbage collection, class file format and register set. Components of JVM are discussed below:</p><h3>Class Loader</h3><p>Classloader is a subsystem of JVM which is used to load class files. Whenever we run the java program, it is loaded first by the classloader. There are three built-in classloaders in Java: Bootstrap Class Loader, Extension Class Loader and System Application Class Loader. It is mainly responsible for three activities: Loading, Linking and Initialization.</p><h3>JVM Memory</h3><p>Method area: In the method area, all class level information like class name, immediate parent class name, methods and variables information etc. are stored, including static variables. There is only one method area per JVM, and it is a shared resource.</p><p>Heap area: Information of all objects is stored in heap area. There is also one Heap Area per JVM. It is also a shared resource.</p><p>Stack area: For every thread, JVM creates one run-time stack which is stored here. Every block of this stack is called activation record/stack frame which store methods calls. All local variables of that method are stored in their corresponding frame. After a thread terminates, it’s run-time stack will be destroyed by JVM. It is not a shared resource.</p><p>PC Registers: Store address of current execution instruction of a thread. Obviously each thread has separate PC Registers. Native method stacks: For every thread, a separate native stack is created. It stores native method information.</p><h3>Execution Engine</h3><p>Execution engine executes the .class (bytecode). It reads the byte-code line by line, uses data and information present in various memory areas and executes instructions. It can be classified in three parts :-</p><p>Interpreter : It interprets the bytecode line by line and then executes. The disadvantage here is that when one method is called multiple times, every time interpretation is required.</p><p>Just-In-Time Compiler(JIT) : It is used to increase efficiency of interpreter. It compiles the entire bytecode and changes it to native code so whenever interpreter see repeated method calls,JIT provide direct native code for that part so re-interpretation is not required,thus efficiency is improved.</p><p>Java Native Interface (JNI) : It is an interface which interacts with the Native Method Libraries and provides the native libraries(C, C++) required for the execution. It enables JVM to call C/C++ libraries and to be called by C/C++ libraries which may be specific to hardware.</p><p>Native Method Libraries : It is a collection of the Native Libraries(C, C++) which are required by the Execution Engine.</p><p>Execution engine generates the machine specific code and it is transferred to operating system where the program is finally executed on the machine.</p><h3>JVM vs JRE vs JDK</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*NqxKm7PRtdHyAYs31CzsUQ.png" /><figcaption>JDK vs JRE vs JVM</figcaption></figure><p>The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc) and other tools needed in Java development.</p><p>JRE stands for “Java Runtime Environment” and may also be written as “Java RTE.” The Java Runtime Environment provides the minimum requirements for executing a Java application; it consists of the Java Virtual Machine (JVM), core classes, and supporting files. JVM is an implementation of JRE.</p><p>I hope this helps you to understand the inner architecture of Java programs. Happy Reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ece388be5dd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>