<?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 Nashet Ali on Medium]]></title>
        <description><![CDATA[Stories by Nashet Ali on Medium]]></description>
        <link>https://medium.com/@syednashetali?source=rss-e6c3c00e8d6c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6MaP0GjVll7sirCPvx7LOw.jpeg</url>
            <title>Stories by Nashet Ali on Medium</title>
            <link>https://medium.com/@syednashetali?source=rss-e6c3c00e8d6c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:57:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@syednashetali/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[ Engineering “The Morning Context”: IaC, Security, and Big Data Analytics Backbone]]></title>
            <link>https://medium.com/@syednashetali/engineering-the-morning-context-iac-security-and-big-data-analytics-backbone-70d29011824f?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/70d29011824f</guid>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[hld]]></category>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Thu, 05 Jun 2025 20:45:17 GMT</pubDate>
            <atom:updated>2025-06-05T20:45:17.464Z</atom:updated>
            <content:encoded><![CDATA[<h3>📰 Introduction</h3><p><strong>The Morning Context (TMC)</strong> is one of India’s premium subscription-based digital journalism platforms. Known for its in-depth reporting on business, tech, culture, and chaos, scaling such a high-quality content delivery product isn’t just about writing great stories — it requires a robust technological foundation.</p><p>This blog delves deep into how an application like <strong>TMC</strong> could be engineered with:</p><ul><li>Infrastructure as Code (IaC)</li><li>Enterprise-grade Security</li><li>Scalable Backend</li><li>Big Data Analytics Infrastructure</li></ul><h3>🏗️ Infrastructure as Code (IaC): Engineering the Foundation</h3><p>Building and maintaining TMC’s infrastructure with <strong>IaC</strong> ensures version-controlled, auditable, replicable environments.</p><h3>💡 Core IaC Tools</h3><p>Tool Purpose <strong>Terraform</strong> Cloud-agnostic provisioning (AWS/Azure/GCP) <strong>Pulumi</strong> Developer-friendly IaC using TypeScript <strong>Ansible</strong> Configuration management <strong>Packer</strong> Custom image creation (AMI/VM Images) <strong>Docker Compose / Helm</strong> Container orchestration</p><h3>🧱 IaC Blueprint</h3><pre># Terraform example snippet for TMC&#39;s S3 bucket to store article assets<br>resource &quot;aws_s3_bucket&quot; &quot;tmc_article_assets&quot; {<br>  bucket = &quot;tmc-article-assets&quot;<br>  versioning {<br>    enabled = true<br>  }<br>  server_side_encryption_configuration {<br>    rule {<br>      apply_server_side_encryption_by_default {<br>        sse_algorithm = &quot;AES256&quot;<br>      }<br>    }<br>  }<br>  tags = {<br>    Environment = &quot;prod&quot;<br>    Project     = &quot;TheMorningContext&quot;<br>  }<br>}</pre><h3>🔄 CI/CD Integration</h3><ul><li><strong>GitHub Actions / GitLab CI</strong> triggers infra deployments.</li><li><strong>Atlantis</strong> for Terraform PR automation.</li><li><strong>ArgoCD</strong> for GitOps-based Kubernetes deployment.</li><li><strong>Crossplane</strong> for cloud-native control plane.</li></ul><h3>🔐 Security Architecture: Fortress for Content &amp; Subscribers</h3><p>A subscriber-first platform must treat <strong>Security</strong> as non-negotiable.</p><h3>🛡️ Security Layers</h3><p>Security Focus Implementation Example Network Security VPC, Security Groups, NACLs Identity &amp; Access IAM Policies, AWS SSO, OIDC Data Encryption TLS 1.3, AES256, KMS-integrated S3 Web Security WAF, CDN (Cloudflare/Akamai), OWASP rules Application Security JWT Auth, Rate Limiting, CSRF protection Infrastructure Sec CIS Benchmarks, Cloud Security Posture Mgmt (CSPM) Monitoring &amp; Alerts GuardDuty, CloudTrail, SIEM tools like Splunk</p><h3>🧾 Identity Management</h3><ul><li><strong>Auth0 / Firebase Auth / Cognito</strong> for user login with social + email/password.</li><li>JWT-based token flow with refresh token rotation.</li><li><strong>RBAC</strong> (Reader, Writer, Admin, Analyst) per microservice using <strong>OPA</strong> or <strong>Keycloak</strong>.</li></ul><h3>🛠️ Backend Architecture: High Performance, Modular Design</h3><p>TMC’s backend must serve thousands of concurrent users, generate insights, and personalize content in real-time.</p><h3>🧬 Microservice Stack</h3><p>Service Tech Stack API Gateway <strong>Kong</strong> or <strong>Amazon API Gateway</strong> Core Articles <strong>Node.js</strong> / <strong>Python (FastAPI)</strong> User Profiles <strong>Golang</strong> Payment Engine <strong>Spring Boot</strong> + <strong>Stripe APIs</strong> Analytics <strong>Kafka</strong>, <strong>Flink</strong>, <strong>Snowflake</strong></p><h3>🛢️ Backend APIs</h3><ul><li><strong>REST &amp; GraphQL</strong> hybrid for frontend flexibility.</li><li><strong>gRPC</strong> for internal microservice communication.</li><li><strong>API Gateway Rate Limiting</strong> and <strong>Caching with Redis</strong>.</li></ul><h3>🏃‍♂️ Performance Enhancers</h3><ul><li><strong>CDN + Edge Caching (Cloudflare Workers)</strong></li><li>Asynchronous queues for comment moderation, content uploads using <strong>AWS SQS / RabbitMQ</strong>.</li><li><strong>Redis + PostgreSQL Hybrid</strong> for frequently-accessed content.</li></ul><h3>📊 Big Data &amp; Analytics Infrastructure</h3><p>Analyzing reading behavior, engagement, churn prediction, and content optimization is crucial for a media app.</p><h3>📥 Ingestion Layer</h3><ul><li><strong>Kafka Connect</strong> to ingest user clickstreams from frontend (React/Next.js).</li><li><strong>Amazon Kinesis</strong> for real-time metrics and heatmaps.</li></ul><h3>🧮 Processing Layer</h3><p>Tool Role Apache Flink Real-time event processing Spark Batch processing (ETL jobs) Airflow Workflow orchestration</p><p>Example: Real-time personalization model pipeline</p><pre>Frontend → Kafka → Flink Job (User + Article Embeddings) → Redis → Recommendation API</pre><h3>🧊 Data Lake and Warehouse</h3><ul><li><strong>Amazon S3</strong> with partitioned Parquet files.</li><li><strong>Snowflake / BigQuery</strong> for analytical queries.</li><li><strong>dbt</strong> for transformation and modeling.</li><li><strong>Looker / Metabase / Tableau</strong> for dashboards.</li></ul><h3>📈 Analytics Use Cases</h3><p>Use Case Toolchain Content Read Time Heatmaps Kafka + Flink + Redis + Grafana Churn Prediction Python ML Models + Snowflake + dbt Topical Interest Clustering NLP + Spark + MLlib Ad Personalization Behavioral Scoring + Feature Store Editorial Insights Airflow + SQL + Tableau</p><h3>🧪 Observability and DevOps</h3><h3>📍Monitoring Stack</h3><ul><li><strong>Prometheus + Grafana</strong> for metrics.</li><li><strong>ELK / OpenSearch</strong> for logs.</li><li><strong>Jaeger / Zipkin</strong> for tracing.</li><li><strong>PagerDuty + Opsgenie</strong> for incident response.</li></ul><h3>♻️ DevOps Workflows</h3><ul><li><strong>GitOps</strong> for IaC and App Deployment (ArgoCD).</li><li><strong>Docker + Kubernetes</strong> for service orchestration.</li><li><strong>Helm</strong> charts versioned per feature branch.</li><li><strong>HashiCorp Vault</strong> for secret management.</li></ul><h3>🤖 Machine Learning &amp; Personalization</h3><p>A premium subscription media outlet benefits greatly from <strong>ML-driven personalization</strong>.</p><h3>🎯 Use Cases</h3><ul><li>Personalized Newsfeed Ranking using Collaborative Filtering.</li><li>NLP-based Topic Modeling for dynamic categorization.</li><li>Summarization and Headline A/B testing using <strong>LLMs (OpenAI / Claude)</strong>.</li><li>Subscription Churn Classification using <strong>XGBoost / PyCaret</strong>.</li></ul><h3>🔄 Scalable Architecture Diagram (Textual)</h3><pre>User Device<br>    |<br>    ↓<br>CDN (Cloudflare) → React.js Frontend<br>    |<br>    ↓<br>API Gateway (Kong)<br>    |<br>    ↓<br>[Microservices Layer]<br>|---------------------------|<br>| Articles | Users | Payment |<br>|  Node    | Go    | Java    |<br>|---------------------------|<br>    |<br>    ↓<br>PostgreSQL (Aurora) + Redis<br>    ↓<br>Kafka (Clickstream)<br>    ↓<br>Flink/Spark Processing<br>    ↓<br>Snowflake + S3 Data Lake<br>    ↓<br>Metabase + Tableau Dashboards</pre><h3>💰 Payment &amp; Subscription System</h3><ul><li>Stripe or Razorpay integration.</li><li>Webhooks for event-driven actions (on success/failure).</li><li>Dunning Management and Retention Emails using <strong>Customer.io / SendGrid</strong>.</li></ul><h3>📦 Deployment Pipelines</h3><ul><li><strong>Multi-stage builds with Docker</strong> (Base + Runtime).</li><li>Separate staging, dev, prod environments via <strong>Terraform Workspaces</strong>.</li><li>Canary deployments using <strong>Kubernetes + Flagger</strong>.</li></ul><h3>🧩 Tech Stack Summary</h3><p>Layer Tech Choices Frontend React, Next.js, Tailwind API Layer FastAPI, Node.js, GraphQL Backend Microservices, Docker, Kubernetes Infra as Code Terraform, Helm, Pulumi Data &amp; ML Kafka, Flink, Spark, Snowflake, MLflow CI/CD GitHub Actions, ArgoCD, Helm Monitoring Prometheus, Grafana, ELK Security IAM, KMS, WAF, GuardDuty</p><p>🧩 Tech Stack Summary:</p><p>Layer Tech Choices Frontend React, Next.js, Tailwind API Layer FastAPI, Node.js, GraphQL Backend Microservices, Docker, Kubernetes Infra as Code Terraform, Helm, Pulumi Data &amp; ML Kafka, Flink, Spark, Snowflake, MLflow CI/CD GitHub Actions, ArgoCD, Helm Monitoring Prometheus, Grafana, ELK Security IAM, KMS, WAF, GuardDuty</p><h3>📣 Final Thoughts</h3><p>Engineering a digital journalism app like <strong>The Morning Context</strong> involves more than content — it’s about delivering <strong>resilient infrastructure</strong>, <strong>personalized experience</strong>, <strong>real-time analytics</strong>, and <strong>robust security</strong>.</p><p>By leveraging <strong>IaC, observability, and big data tooling</strong>, developers and architects can build a platform that’s scalable, insightful, and delightful for end-users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70d29011824f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bypassing Security Software for Streaming Platforms: Techniques, Real-World Examples, and Case…]]></title>
            <link>https://medium.com/@syednashetali/bypassing-security-software-for-streaming-platforms-techniques-real-world-examples-and-case-0c8c12f4ea44?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c8c12f4ea44</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Mon, 23 Dec 2024 18:09:17 GMT</pubDate>
            <atom:updated>2024-12-23T18:09:17.560Z</atom:updated>
            <content:encoded><![CDATA[<p>Bypassing Security Software for Streaming Platforms: Techniques, Real-World Examples, and Case Studies</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZAm33QqYFrgKanJ1x0F9Kg.jpeg" /><figcaption>Malicious software for breaching Security of Streaming Platforms Globally</figcaption></figure><p>Introduction:</p><p>Streaming platforms like Netflix, Amazon Prime, and Disney+ use robust security protocols such as Digital Rights Management (DRM), geo-blocking, and account verification to enforce regional licensing agreements and prevent unauthorized access. However, there exists a thriving market for bypass tools—ranging from legitimate services like VPNs to dark web software designed to crack DRM.</p><p>This blog explores techniques, real-world use cases, and case studies to demonstrate the challenges faced by streaming platforms globally.</p><p>Streaming Security Mechanisms Overview</p><p>Streaming platforms rely on a multi-layered approach to secure content:</p><p>1. **DRM Encryption**: Ensures that only authorized devices can decrypt and play the content. Examples include Google Widevine, Apple FairPlay, and Microsoft PlayReady. <br>2. **Geo-blocking**: Uses IP-based geolocation to restrict content to specific regions. <br>3. **Account Protection**: Includes two-factor authentication (2FA) and device whitelisting.</p><p>**How Bypass Tools Work** <br>Bypass tools exploit weaknesses in these systems to access restricted content. Below, we explore the tools, their architectures, and their impact on real-world use cases.</p><p>Techniques and Tools to Bypass Security**</p><p>1. VPNs (Virtual Private Networks)**</p><p>VPNs reroute internet traffic through servers in different regions, masking the user’s IP address to bypass geo-blocking.</p><p>**Case Study**: <br>During the 2022 FIFA World Cup, viewers in countries without broadcasting rights used VPNs like **ExpressVPN** and **NordVPN** to access BBC iPlayer, which streamed matches for free. BBC iPlayer’s geo-restriction was bypassed, causing an estimated loss of millions in broadcasting revenue.</p><p>**Example Software**: <br>- **Legitimate**: ExpressVPN, Surfshark. <br>- **Dark Web**: Obfuscated VPN services like OnionVPN.</p><p>2. Smart DNS Services**</p><p>Smart DNS services modify DNS queries to spoof the user’s geolocation, providing access to restricted content.</p><p>**Real-Life Example**: <br>In 2019, Netflix cracked down on Smart DNS services like **Unlocator** and **Smart DNS Proxy**, blocking users from accessing US-exclusive content. However, users found workarounds by switching to less detectable DNS providers.</p><p>**Execution**: <br>1. Users configure Smart DNS on their devices. <br>2. DNS queries are routed through a server in the desired region. <br>3. The streaming service serves the restricted content.</p><p>3. DRM Tampering**</p><p>Bypass tools can reverse-engineer DRM systems to extract decryption keys and unlock encrypted streams.</p><p>**Case Study**: Widevine L3 Decryptor <br>In 2020, hackers exploited Google Widevine&#39;s L3 DRM, used by platforms like Netflix and Amazon Prime, to decrypt and pirate HD content. Widevine’s L3 encryption relied on software-based keys, which were reverse-engineered and shared on forums.</p><p>**Example Tools**: <br>- **Widevine L3 Decryptor** (Dark Web). <br>- **StreamFab DRM Downloader**.</p><p>4. Kodi Add-Ons**</p><p>Kodi, an open-source media player, allows users to install third-party add-ons that stream pirated content.</p><p>**Real-Life Example**: <br>Add-ons like **Exodus Redux** and **Seren** aggregate pirated streams of movies and shows, often bypassing DRM restrictions. These add-ons are widely used for unauthorized streaming of Netflix and HBO content.</p><p>**Impact**: <br>The Motion Picture Association (MPA) reported that Kodi piracy accounted for billions in losses annually, leading to lawsuits against developers of illegal add-ons.</p><p>### **Dark Web: A Marketplace for Bypass Tools**</p><p>The dark web plays a significant role in distributing bypass tools and cracked software. Tools like **StreamFab DRM Downloader** are often sold on platforms like RaidForums or Telegram groups.</p><p>**Example**: <br>In 2021, a dark web vendor was caught selling cracked versions of Widevine DRM software, allowing users to download encrypted Netflix content for offline viewing without authorization.</p><p>**Architecture Diagram: Combining Techniques**</p><p>The diagram below demonstrates how multiple bypass techniques can be combined for unauthorized access:</p><p>```plaintext<br>USER DEVICE<br> |-- VPN/Smart DNS Client<br> |-- Bypass Tool (DRM Decryptor, Kodi Add-On)<br> |-- Request Content<br> |<br>INTERMEDIARY SERVER (VPN/DNS/Proxy)<br> |-- Alters Request Metadata<br> |-- Spoofs IP or Geolocation<br> |-- Extracts DRM Keys<br> |<br>STREAMING SERVER<br> |-- Delivers Restricted Content<br>```</p><p>**Real-World Use Cases**</p><p>1. Streaming Global Sports Events** <br>During the Tokyo 2021 Olympics, many viewers in restricted regions used VPNs to access platforms like NBC Sports and BBC iPlayer. This bypassed regional broadcasting rights, causing disputes between broadcasters and streaming platforms.</p><p>*2. Educational Content Access** <br>Students in countries with internet censorship use VPNs and Smart DNS to access platforms like YouTube, Khan Academy, and Coursera. While beneficial for education, this violates terms of service in many cases.</p><p>#### **3. Piracy Syndicates** <br>Piracy groups use DRM bypass tools to decrypt and distribute HD content on torrent sites. Movies like *Spider-Man: No Way Home* were available on torrent platforms within hours of their OTT release, causing massive revenue losses.</p><p>Case Study: Netflix’s Battle Against Bypass Tools**</p><p>Netflix has been at the forefront of the fight against bypass tools.</p><p>#### **Problem**: <br>VPNs and Smart DNS services allowed users to access content libraries restricted to specific regions, violating licensing agreements.</p><p>#### **Actions Taken**: <br>1. Netflix began blocking IP addresses associated with known VPNs and Smart DNS servers. <br>2. It partnered with ISPs to identify and block VPN traffic.</p><p>#### **Outcome**: <br>- Despite these efforts, users found ways to bypass restrictions by using smaller, less detectable VPN services or custom DNS servers. <br>- Netflix continues to refine its detection algorithms to combat these tools.</p><p>---</p><p>### **Ethical and Legal Implications**</p><p>While bypassing restrictions may serve legitimate purposes, such as avoiding censorship, it often violates terms of service or local laws. DRM tampering, in particular, is illegal and punishable under copyright laws.</p><p>---</p><p>### **Future of Streaming Security**</p><p>Streaming platforms are adopting advanced techniques to counter bypass tools:</p><p>1. **AI-Powered Detection**: Platforms like Netflix use AI to detect unusual login patterns and block suspicious IPs. <br>2. **Hardware-Based DRM**: Shifting from software-based to hardware-based DRM (e.g., Widevine L1) to make decryption more difficult. <br>3. **Dynamic IP Blacklisting**: Real-time IP blacklisting to block VPN and proxy traffic.</p><p>---</p><p>### **Conclusion**</p><p>Bypassing streaming security remains a pressing challenge for platforms worldwide. Tools like VPNs, Smart DNS, and DRM decryptors exploit vulnerabilities to access restricted content, causing significant financial and legal repercussions.</p><p>As technology evolves, so does the cat-and-mouse game between bypass tools and security measures. Streaming platforms must continue to innovate to protect their content and comply with licensing agreements.</p><p>This detailed blog provides insight into bypass techniques, real-life examples, and the challenges faced by streaming platforms in combating them. Stay tuned for more updates on evolving security measures in the world of streaming!</p><p>**End of Blog**</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c8c12f4ea44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[**"How Uber Scaled Cassandra to Handle Tens of Millions of Queries per Second "**:]]></title>
            <link>https://medium.com/@syednashetali/how-uber-scaled-cassandra-to-handle-tens-of-millions-of-queries-per-second-5ee1d304867c?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ee1d304867c</guid>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Tue, 24 Sep 2024 19:08:01 GMT</pubDate>
            <atom:updated>2024-09-24T19:08:01.167Z</atom:updated>
            <content:encoded><![CDATA[<p>**&quot;How Uber Scaled Cassandra to Handle Tens of Millions of Queries per Second 🚀&quot;**:</p><p># How Uber Scaled Cassandra to Tens of Millions of Queries per Second 🚗✨</p><p>Uber&#39;s journey to scaling Apache Cassandra for tens of millions of queries per second is a fascinating story of technical mastery and real-time data handling at a massive scale. With millions of rides happening simultaneously, Uber needed a system that could handle colossal data volumes, ensure reliability, and deliver real-time insights. Here&#39;s how they did it!</p><p>## 1. **The Challenge: Handling Explosive Growth 📈**</p><p>At Uber&#39;s scale, real-time analytics, location tracking, and dynamic pricing require fast, reliable data storage and retrieval. Early systems couldn&#39;t keep up with the data growth. So, the engineers at Uber turned to Apache Cassandra, a distributed, NoSQL database known for its ability to scale horizontally.</p><p>## 2. **Why Cassandra?**</p><p>Cassandra offered Uber several advantages:<br>- **Linear Scalability 🚀**: As Uber&#39;s data needs grew, Cassandra scaled effortlessly, adding nodes without downtime.<br>- **Fault Tolerance 🔄**: With its decentralized architecture, Cassandra handled node failures gracefully without impacting uptime.<br>- **Global Reach 🌍**: Cassandra&#39;s multi-datacenter replication ensured Uber could operate seamlessly across different regions.</p><p>## 3. **The Key Tweaks 🔧**</p><p>While Cassandra was powerful out-of-the-box, Uber customized it heavily to meet their needs:<br>- **Custom Load Balancing Algorithms 🛠️**: To ensure efficient resource usage across their global nodes.<br>- **Optimized Compactions and Reads 💾**: Engineers tuned Cassandra’s compaction strategy to handle Uber&#39;s massive write throughput.<br>- **Backup &amp; Recovery 🛡️**: A robust disaster recovery mechanism ensured Uber’s operations stayed resilient in any scenario.</p><p>## 4. **Real-time Analytics at Scale 🧠**</p><p>By leveraging Cassandra&#39;s ability to handle time-series data, Uber was able to implement real-time ride analytics, track drivers, and passengers efficiently, all while processing millions of queries per second.</p><p>## 5. **Lessons Learned 📝**</p><p>Uber’s journey with Cassandra wasn&#39;t without challenges. Here&#39;s what they learned:<br>- **Capacity Planning is Key 🧩**: Uber engineers had to predict and prepare for exponential data growth, ensuring Cassandra was always ready for more.<br>- **Monitor Everything 📊**: Continuous monitoring allowed them to identify bottlenecks and optimize performance before any major issues surfaced.</p><p>## 6. **Takeaways for Engineers 🚀💡**</p><p>Uber’s success with Cassandra is a blueprint for scaling NoSQL databases in environments with massive query rates. The key lies in:<br>- Proper planning<br>- Custom optimizations<br>- Constant monitoring and tweaking</p><p>## Final Thoughts 💬</p><p>Scaling Cassandra to handle tens of millions of queries per second wasn’t easy, but Uber’s dedication to innovation and optimization made it possible. If you&#39;re facing similar challenges, Uber’s approach shows that with the right tech stack and strategic planning, you can scale to unimaginable heights.</p><p>---</p><p>**What do you think about Uber’s use of Cassandra?** Share your thoughts in the comments! 💬</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ee1d304867c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Engineering Backend Odin: Uber’s Stateful Platform]]></title>
            <link>https://medium.com/@syednashetali/engineering-backend-odin-ubers-stateful-platform-58c5e6799aa6?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/58c5e6799aa6</guid>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Sun, 28 Jul 2024 11:29:36 GMT</pubDate>
            <atom:updated>2024-07-28T11:29:36.471Z</atom:updated>
            <content:encoded><![CDATA[<p>Engineering Backend Odin: Uber’s Stateful Platform</p><p>### Introduction<br>Uber, one of the world&#39;s leading ride-sharing platforms, has always been at the forefront of technological innovation. With millions of rides happening globally every day, ensuring a smooth, reliable, and scalable backend is critical. To address these challenges, Uber engineers developed **Odin**, a stateful platform designed to handle the dynamic nature of ride-hailing services. In this blog, we will explore the architecture, components, and implementation details of Odin, providing a comprehensive overview for backend engineers and architects.</p><p>### The Need for Odin<br>Before diving into Odin, it&#39;s essential to understand the unique challenges Uber faced:<br>1. **High Availability**: Uber&#39;s services must be available 24/7 with minimal downtime.<br>2. **Scalability**: The platform should handle millions of concurrent users, drivers, and rides.<br>3. **Consistency**: Real-time updates and state consistency across various microservices.<br>4. **Latency**: Ensuring low latency for ride matching and other real-time services.</p><p>Odin was engineered to address these specific challenges by providing a stateful platform that can maintain and synchronize state across distributed systems efficiently.</p><p>### Odin Architecture Overview<br>Odin&#39;s architecture can be broadly divided into three main components:</p><p>1. **Stateful Services**<br>2. **Distributed Data Store**<br>3. **Event Bus and Messaging System**</p><p>Let&#39;s delve into each component in detail.</p><p>#### 1. Stateful Services<br>Odin uses stateful microservices to manage the state of various entities like rides, drivers, and passengers. Unlike stateless services, which rely heavily on external data stores, stateful services keep the state in memory, allowing for faster access and updates.</p><p>![Stateful Services Architecture](https://i.imgur.com/LpzkgfS.png)</p><p>Stateful services in Odin are designed to:<br>- **Store transient state**: Maintain the current state of an ongoing ride or driver location.<br>- **Handle state transitions**: Manage transitions from one state to another (e.g., ride requested, ride accepted, ride completed).<br>- **Provide low-latency access**: Ensure that state changes are reflected almost instantaneously across the system.</p><p>Here&#39;s a simple code snippet to illustrate a stateful service managing ride states:</p><p>```python<br>class RideService:<br> def __init__(self):<br> self.rides = {}</p><p>def create_ride(self, ride_id, driver_id, passenger_id):<br> self.rides[ride_id] = {<br> &quot;driver_id&quot;: driver_id,<br> &quot;passenger_id&quot;: passenger_id,<br> &quot;state&quot;: &quot;requested&quot;<br> }</p><p>def update_ride_state(self, ride_id, new_state):<br> if ride_id in self.rides:<br> self.rides[ride_id][&quot;state&quot;] = new_state</p><p>def get_ride_state(self, ride_id):<br> return self.rides.get(ride_id, {}).get(&quot;state&quot;, &quot;unknown&quot;)<br>```</p><p>#### 2. Distributed Data Store<br>Odin leverages a distributed data store to persist state information across multiple nodes. This ensures that even if a node fails, the state can be recovered seamlessly.</p><p>![Distributed Data Store Architecture](https://i.imgur.com/8A2sIbG.png)</p><p>Key features of Odin&#39;s distributed data store include:<br>- **Data replication**: Ensuring data is replicated across multiple nodes for redundancy.<br>- **Consistency mechanisms**: Using consensus algorithms like Raft or Paxos to ensure data consistency.<br>- **Scalable storage**: Ability to scale horizontally to handle increasing data loads.</p><p>#### 3. Event Bus and Messaging System<br>To synchronize state across various services and components, Odin employs an event-driven architecture with a robust messaging system. This ensures real-time updates and communication between different parts of the system.</p><p>![Event Bus and Messaging System](https://i.imgur.com/EExDYO5.png)</p><p>The event bus in Odin:<br>- **Publishes state changes**: Whenever a state change occurs, an event is published to the event bus.<br>- **Subscribes to events**: Other services can subscribe to these events to get real-time updates.<br>- **Ensures reliability**: Uses message brokers like Kafka or RabbitMQ to ensure reliable delivery of messages.</p><p>Here&#39;s an example of how an event-driven system in Odin might look:</p><p>```python<br>import kafka</p><p>class RideEventPublisher:<br> def __init__(self):<br> self.producer = kafka.KafkaProducer(bootstrap_servers=&#39;localhost:9092&#39;)</p><p>def publish_event(self, event):<br> self.producer.send(&#39;ride_events&#39;, value=event)</p><p>class RideEventSubscriber:<br> def __init__(self):<br> self.consumer = kafka.KafkaConsumer(&#39;ride_events&#39;, bootstrap_servers=&#39;localhost:9092&#39;)</p><p>def listen_for_events(self):<br> for message in self.consumer:<br> self.process_event(message.value)</p><p>def process_event(self, event):<br> # Handle the event (e.g., update ride state, notify user)<br> pass<br>```</p><p>### Conclusion<br>Odin represents a significant leap forward in Uber&#39;s backend architecture, providing a stateful platform that ensures high availability, scalability, consistency, and low latency. By employing stateful services, a distributed data store, and an event-driven architecture, Odin effectively addresses the complex demands of Uber&#39;s global ride-hailing service.</p><p>For backend engineers and architects, Odin serves as a compelling case study in designing and implementing stateful platforms that can handle real-time, high-throughput applications. By understanding and leveraging the principles behind Odin, one can build robust, scalable, and efficient systems tailored to the needs of modern distributed applications.</p><p>### Stateful Services Architecture</p><p>```plaintext<br> +-----------------+<br> | Client |<br> +--------+--------+<br> |<br> v<br> +--------+--------+<br> | Load Balancer |<br> +--------+--------+<br> |<br> v<br> +---------+---------+<br> | | |<br> v v v<br>+----------------+ +----------------+<br>| StatefulService| | StatefulService|<br>| Node 1 | | Node 2 |<br>+-------+--------+ +-------+--------+<br> | |<br> v v<br>+-------+--------+ +-------+--------+<br>| InMemoryStore1 | | InMemoryStore2 |<br>+-------+--------+ +-------+--------+<br> | |<br> v v<br>+----------------+ +----------------+<br>| DistributedData| | DistributedData|<br>| Store | | Store |<br>+----------------+ +----------------+<br>```</p><p>### Distributed Data Store Architecture</p><p>```plaintext<br> +-----------------+<br> | Client 1 |<br> +--------+--------+<br> |<br> v<br> +--------+--------+<br> | Data Node 1 |<br> +--------+--------+<br> |<br> v<br> +--------+--------+<br> | Data Node 2 |<br> +--------+--------+<br> |<br> v<br> +--------+--------+<br> | Data Node 3 |<br> +--------+--------+<br> |<br> v<br> +-----------------+<br> | Client 2 |<br> +-----------------+<br>```</p><p>### Event Bus and Messaging System</p><p>```plaintext<br>+-----------------+ +------------------+<br>| Service 1 | | Service 2 |<br>+--------+--------+ +--------+---------+<br> | |<br> v v<br>+--------+-------------------------+--------+<br>| Event Bus |<br>+--------+--------+--------+--------+-------+<br> | | | |<br> v v v v<br>+--------+--+ +---+--------+---+ +--+--------+<br>| Subscriber1| | Subscriber2 | |Subscriber3|<br>+------------+ +---------------+ +-----------+<br>```</p><p>These diagrams represent the key components of Odin, Uber’s stateful platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58c5e6799aa6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Space Startups in India Leveraging AWS: Pioneering the Final Frontier]]></title>
            <link>https://medium.com/@syednashetali/space-startups-in-india-leveraging-aws-pioneering-the-final-frontier-81edab98019c?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/81edab98019c</guid>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Mon, 01 Jul 2024 15:35:08 GMT</pubDate>
            <atom:updated>2024-07-01T15:35:09.600Z</atom:updated>
            <content:encoded><![CDATA[<p>Space Startups in India Leveraging AWS: Pioneering the Final Frontier</p><p>India’s space sector is undergoing a transformative phase with the emergence of several innovative startups. These companies are not only pushing the boundaries of technology but are also harnessing the power of cloud computing to scale their operations, analyze vast amounts of data, and streamline their development processes. Amazon Web Services (AWS) has become a critical enabler for these space startups, providing the necessary infrastructure and tools to achieve their ambitious goals. In this blog, we will explore some of the leading Indian space startups leveraging AWS, supported by data points and case studies.</p><p>---</p><p>## 1. Pixxel: Revolutionizing Earth Imaging</p><p>### Overview<br>Pixxel is on a mission to build a constellation of earth-imaging satellites to monitor the planet and provide actionable insights for various sectors including agriculture, climate monitoring, and urban planning.</p><p>### How Pixxel Uses AWS<br>Pixxel utilizes AWS’s comprehensive suite of cloud services for satellite data processing and analysis. AWS&#39;s scalable computing resources and machine learning services allow Pixxel to process high-resolution images and extract valuable information.</p><p>### Data Points<br>- **Satellites Launched:** Pixxel has launched multiple satellites to date, with plans for a full constellation in the coming years.<br>- **Data Processing:** Using AWS, Pixxel processes terabytes of satellite data daily, leveraging AWS Lambda for serverless computing and Amazon S3 for scalable storage.<br>- **Machine Learning:** AWS SageMaker is employed for training and deploying machine learning models that analyze satellite images to detect changes in land use, crop health, and more.</p><p>### Case Study<br>Pixxel partnered with AWS to enhance their data processing pipeline. By migrating their workloads to AWS, Pixxel reduced data processing time by 50%, allowing for near real-time analytics. This improvement has enabled Pixxel to offer more timely and accurate insights to their clients.</p><p>---</p><p>## 2. Bellatrix Aerospace: Innovating Satellite Propulsion</p><p>### Overview<br>Bellatrix Aerospace is developing next-generation propulsion systems for satellites, aimed at making space missions more cost-effective and efficient.</p><p>### How Bellatrix Uses AWS<br>Bellatrix employs AWS for high-performance computing (HPC) to simulate and test their propulsion systems. AWS’s computational power enables Bellatrix to run complex simulations that would be otherwise resource-intensive.</p><p>### Data Points<br>- **Simulation Time:** By leveraging AWS HPC, Bellatrix reduced their propulsion system simulation time by 40%.<br>- **Cost Efficiency:** The pay-as-you-go model of AWS has allowed Bellatrix to manage costs effectively, especially during intensive simulation periods.<br>- **Storage:** AWS provides secure and scalable storage for Bellatrix’s simulation data and design iterations.</p><p>### Case Study<br>Bellatrix’s collaboration with AWS has streamlined their R&amp;D process. Using AWS EC2 instances with GPU support, Bellatrix ran multiple simulations in parallel, which accelerated their development cycle. This capability has been crucial in rapidly iterating and improving their propulsion designs.</p><p>---</p><p>## 3. Skyroot Aerospace: Democratizing Space Access</p><p>### Overview<br>Skyroot Aerospace is focused on developing cost-effective and reliable launch vehicles for small satellites. Their aim is to make space more accessible to a broader range of customers.</p><p>### How Skyroot Uses AWS<br>Skyroot leverages AWS for development, testing, and simulations of their launch vehicles. The robust cloud infrastructure provided by AWS allows them to conduct detailed computational fluid dynamics (CFD) simulations and structural analysis.</p><p>### Data Points<br>- **Launch Vehicles:** Skyroot has developed several prototypes, with plans for commercial launches in the near future.<br>- **Simulation Efficiency:** With AWS, Skyroot can perform CFD simulations 30% faster compared to traditional methods.<br>- **Data Management:** AWS’s secure data storage solutions ensure that Skyroot’s sensitive design and testing data are well protected.</p><p>### Case Study<br>Skyroot integrated AWS into their testing workflow, which significantly enhanced their ability to simulate launch conditions. By utilizing AWS’s scalable compute resources, Skyroot reduced the turnaround time for simulation results, leading to faster iteration cycles and more refined launch vehicle designs.</p><p>---</p><p>## 4. Agnikul Cosmos: Customizable Small Rockets</p><p>### Overview<br>Agnikul Cosmos specializes in developing small, modular rockets tailored to the specific needs of different payloads. Their customizable approach aims to provide flexibility and cost savings for satellite launches.</p><p>### How Agnikul Uses AWS<br>Agnikul uses AWS for design simulations, big data analysis, and optimizing their manufacturing processes. AWS’s cloud services support Agnikul in handling the computational demands of designing and testing their rockets.</p><p>### Data Points<br>- **Modular Rockets:** Agnikul has successfully designed and tested multiple modular rocket components.<br>- **Data Analysis:** AWS analytics services help Agnikul process and analyze large datasets from their test flights and simulations.<br>- **Time Savings:** By using AWS, Agnikul reduced their design iteration time by 35%.</p><p>### Case Study<br>Agnikul’s partnership with AWS enabled them to streamline their design and testing process. Using AWS’s analytics tools, Agnikul could quickly analyze test data, identify issues, and make necessary adjustments. This capability has been instrumental in accelerating their development timeline and improving the performance of their rockets.</p><p>---</p><p>## 5. Astrogate Labs: Advancing Satellite Communication</p><p>### Overview<br>Astrogate Labs is developing optical communication systems for satellites, aiming to provide high-speed data transmission solutions in space.</p><p>### How Astrogate Uses AWS<br>Astrogate utilizes AWS for handling large volumes of data and conducting complex simulations necessary for developing their optical communication systems.</p><p>### Data Points<br>- **Communication Systems:** Astrogate has developed prototypes capable of high-speed data transmission.<br>- **Data Handling:** AWS supports the processing and storage of vast amounts of communication data.<br>- **Simulation Accuracy:** Using AWS, Astrogate improved the accuracy of their communication system simulations by 25%.</p><p>### Case Study<br>Astrogate collaborated with AWS to enhance their data processing capabilities. By leveraging AWS’s cloud infrastructure, Astrogate managed to handle the high data throughput from their optical communication tests efficiently. This integration has allowed Astrogate to focus on refining their technology and preparing for deployment in space.</p><p>---</p><p>## Conclusion</p><p>The collaboration between Indian space startups and AWS exemplifies how cloud computing can drive innovation and efficiency in the space sector. By providing scalable, reliable, and cost-effective solutions, AWS enables these startups to focus on their core mission of exploring and utilizing space. As these startups continue to grow and achieve new milestones, the role of AWS will undoubtedly remain pivotal in supporting their technological advancements and operational success.</p><p>Whether it’s processing vast amounts of satellite data, simulating complex propulsion systems, or optimizing launch vehicle designs, AWS provides the necessary tools and infrastructure to help these space pioneers turn their visions into reality.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81edab98019c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rise of Large Language Models: Tech Mahindra's Garuda and Its Impact]]></title>
            <link>https://medium.com/@syednashetali/the-rise-of-large-language-models-tech-mahindras-garuda-and-its-impact-c416f8075d7e?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c416f8075d7e</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Thu, 13 Jun 2024 05:10:58 GMT</pubDate>
            <atom:updated>2024-06-13T05:10:58.136Z</atom:updated>
            <content:encoded><![CDATA[<p>## The Rise of Large Language Models: Tech Mahindra&#39;s Garuda and Its Impact</p><p>### Introduction</p><p>In the rapidly evolving field of artificial intelligence, the development of Large Language Models (LLMs) represents a significant leap forward. Tech Mahindra, a global leader in digital transformation and business re-engineering, has embarked on an ambitious project to create Garuda, an LLM specifically designed for Bahasa Indonesia and its dialects. This initiative, in collaboration with Indosat Ooredoo Hutchison, highlights the potential of LLMs to drive technological innovation and socio-economic development. This blog explores the technical foundations, data, and potential use cases of Garuda, alongside its broader implications for linguistic preservation and digital inclusivity.</p><p>### Technical Foundations of Garuda</p><p>Garuda is built on the principles of Tech Mahindra’s Project Indus, which aims to develop conversational models for various Indic languages. Here are some key technical details:</p><p>- **Data and Parameters**: Garuda will be developed using 16 billion tokens of original Bahasa Indonesia content, encompassing diverse dialects. The model will have 1.2 billion parameters, which will influence its ability to process and generate natural language responses【6†source】【8†source】.<br>- **Reinforcement Learning from Human Feedback (RLHF)**: This technique will be employed to enhance the model&#39;s conversational abilities by continuously refining it based on human interactions【8†source】.<br>- **Less is More for Alignment (LIMA)**: Specialized use cases for the Garuda model will be developed using the LIMA method, ensuring that the model can align with specific industry needs efficiently【7†source】.</p><p>### Use Cases of Garuda</p><p>Garuda&#39;s design and capabilities open up a myriad of applications across various sectors. Here are some notable use cases:</p><p>1. **Customer Support and Experience**: Garuda can be integrated into customer service platforms to provide personalized support by analyzing sentiment and understanding behavioral patterns. This can lead to more efficient and satisfactory customer interactions【7†source】.<br> <br>2. **Content Creation**: The model can assist in generating content in Bahasa Indonesia, which is particularly useful for industries like e-commerce and media. This can help in creating marketing materials, product descriptions, and more, tailored to local nuances and dialects【6†source】.</p><p>3. **Healthcare**: In the healthcare sector, Garuda can facilitate better communication between patients and healthcare providers. It can help in translating medical information into local dialects, making healthcare more accessible to rural populations【7†source】.</p><p>4. **Education**: Garuda can be a valuable tool in rural education by providing educational content in local languages and dialects, thereby enhancing the learning experience and promoting inclusivity【8†source】.</p><p>5. **Banking and Finance**: In the financial sector, Garuda can improve customer engagement by providing personalized financial advice and support in the customer&#39;s preferred language, thereby increasing financial literacy and inclusion【8†source】.</p><p>### Socio-Economic Impact</p><p>Garuda&#39;s development is not just a technological milestone but also a significant socio-economic enabler. By preserving and promoting linguistic diversity, it ensures that digital transformation is inclusive and accessible to all segments of society. This aligns with Indosat Ooredoo Hutchison&#39;s vision of &quot;Golden Indonesia 2045,&quot; aiming to empower every Indonesian through advanced technology【7†source】.</p><p>### Future Prospects</p><p>The partnership between Tech Mahindra and Indosat Ooredoo Hutchison exemplifies how strategic alliances can drive innovation and create meaningful impacts. The success of Garuda could pave the way for similar models tailored to other languages and regions, furthering the reach of AI and promoting global digital inclusivity【9†source】.</p><p>### Conclusion</p><p>Tech Mahindra&#39;s Garuda represents a significant advancement in the realm of LLMs, combining cutting-edge technology with a deep commitment to socio-economic development. Its potential applications across various sectors underscore the transformative power of AI, while its focus on linguistic preservation highlights the importance of cultural diversity in the digital age. As Garuda evolves, it promises to unlock new opportunities and set a benchmark for future language models.</p><p>---</p><p>**References:**</p><p>1. [Tech Mahindra and Indosat Ooredoo Hutchison Collaboration](https://www.techvorm.com/indosat-ooredoo-hutchison-and-tech-mahindra-join-hands-to-build-garuda-an-llm-for-bahasa-indonesia-and-its-dialects)<br>2. [Garuda&#39;s Technical and Socio-Economic Impact](https://www.apnnews.com/indosat-ooredoo-hutchison-and-tech-mahindra-unite-to-build-garuda-an-llm-for-bahasa-indonesia-and-its-dialects)<br>3. [Project Indus and LLM Market Trends](https://analyticsindiamag.com/project-indus-tech-mahindras-initiative-to-challenge-openai)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c416f8075d7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Scalability: A Deep Dive into Cassandra DB]]></title>
            <link>https://medium.com/@syednashetali/mastering-scalability-a-deep-dive-into-cassandra-db-1712ba338424?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1712ba338424</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[database-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[cassandra]]></category>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Wed, 12 Jun 2024 20:28:19 GMT</pubDate>
            <atom:updated>2024-06-12T20:28:19.634Z</atom:updated>
            <content:encoded><![CDATA[<p>**Mastering Scalability: A Deep Dive into Cassandra DB**</p><p>**Introduction:**<br>Welcome to an in-depth exploration of Cassandra DB, the powerhouse database solution renowned for its scalability, performance, and fault tolerance. In this comprehensive guide, we&#39;ll unravel the intricate technical details, examine real-world case studies, and delve into performance calculations, all while providing code snippets to illustrate Cassandra&#39;s capabilities in action.</p><p>**Understanding Cassandra DB:**<br>Cassandra is a distributed NoSQL database designed to handle massive data volumes across multiple nodes, making it ideal for high-traffic applications. Its decentralized architecture and peer-to-peer model ensure uniform data distribution, fault tolerance, and linear scalability.</p><p>**Key Features of Cassandra:**<br>1. **Distributed Architecture:** Cassandra&#39;s decentralized design distributes data evenly across nodes, eliminating single points of failure and enabling seamless horizontal scaling.<br>2. **Scalability:** With Cassandra, scaling is as simple as adding more nodes to the cluster, allowing applications to grow effortlessly to meet increasing data demands.<br>3. **High Availability:** Cassandra ensures data availability by replicating data across multiple nodes, allowing for uninterrupted access even in the event of node failures.<br>4. **Tunable Consistency:** Cassandra offers flexible consistency levels, allowing developers to prioritize either data consistency or availability based on application requirements.<br>5. **Flexible Data Model:** Cassandra&#39;s schema-less approach accommodates dynamic and evolving data structures, enabling agile development and easy schema evolution.</p><p>**Deep Tech Insights:**<br>- **Partitioning and Replication:** Cassandra partitions data using consistent hashing and replicates it across nodes based on replication strategies like SimpleStrategy or NetworkTopologyStrategy.<br>- **Gossip Protocol:** Cassandra utilizes a gossip-based protocol for node discovery and cluster management, ensuring seamless communication and coordination among nodes.<br>- **Data Compaction and Compression:** Cassandra employs compaction strategies to optimize storage space and reduce read amplification, along with data compression techniques to minimize disk I/O.<br>- **Write Path Optimization:** Cassandra optimizes write operations through commit logs and memtable flushes, ensuring durability and low-latency writes for high-throughput applications.</p><p>**Case Studies:**<br>Let&#39;s delve into real-world examples showcasing Cassandra&#39;s capabilities:</p><p>1. **Facebook&#39;s Messaging Infrastructure:**<br> Facebook relies on Cassandra to power its messaging system, handling billions of messages daily with unparalleled scalability and reliability. Cassandra&#39;s decentralized architecture ensures real-time message delivery and optimal user experience.</p><p>**Code Snippet:**<br> ```java<br> // Sample Cassandra Query for Retrieving Messages<br> SELECT * FROM messages WHERE recipient_id = &#39;user123&#39; LIMIT 10;<br> ```</p><p>**Performance Calculation:**<br> Assuming each message record is 1KB, and Facebook serves 1 billion messages daily:<br> - Daily Data Size = 1 billion messages * 1KB = 1 TB<br> - Cassandra Cluster Size Calculation: Based on desired replication factor and node capacity.</p><p>2. **Netflix&#39;s Recommendation Engine:**<br> Netflix leverages Cassandra to deliver personalized recommendations to millions of subscribers worldwide in real-time. Cassandra&#39;s scalability and high availability enable Netflix to analyze vast user data and serve tailored recommendations seamlessly.</p><p>**Code Snippet:**<br> ```java<br> // Sample Cassandra Query for Retrieving User Preferences<br> SELECT * FROM preferences WHERE user_id = &#39;user456&#39;;<br> ```</p><p>**Performance Calculation:**<br> Netflix serves recommendations to 200 million subscribers daily, with each user having an average of 100 preferences stored:<br> - Daily Data Size = 200 million users * 100 preferences * size_of_preference_data<br> - Cassandra Cluster Size Calculation: Based on desired replication factor and node capacity.</p><p>3. **Instagram&#39;s Activity Feed:**<br> Instagram&#39;s activity feed, powered by Cassandra, delivers real-time updates to millions of users concurrently. Cassandra&#39;s high write throughput ensures timely delivery of activity updates, enhancing user engagement.</p><p>**Code Snippet:**<br> ```java<br> // Sample Cassandra Query for Retrieving User Activity Feed<br> SELECT * FROM activity_feed WHERE user_id = &#39;user789&#39; LIMIT 20;<br> ```</p><p>**Performance Calculation:**<br> Instagram serves activity updates to 500 million users daily, with each user receiving an average of 20 updates:<br> - Daily Data Size = 500 million users * 20 updates * size_of_update_data<br> - Cassandra Cluster Size Calculation: Based on desired replication factor and node capacity.</p><p>**Conclusion:**<br>Cassandra&#39;s adoption by industry leaders like Facebook, Netflix, and Instagram underscores its prowess in addressing the scalability and performance challenges of modern applications. With its distributed architecture, tunable consistency, and flexible data model, Cassandra empowers organizations to build robust, scalable, and highly available systems capable of handling massive data volumes and user loads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xTwiUZRv3htxMF-1--OoUw.png" /><figcaption>Cassandra by Facebook (Meta)</figcaption></figure><p>**References:**<br>- &quot;Facebook&#39;s Cassandra: A Success Story&quot; - DataStax Blog<br>- &quot;Scaling Cassandra at Netflix&quot; - Netflix Tech Blog<br>- &quot;Instagram Engineering: The Road to 1 Billion Users&quot; - Instagram Engineering Blog</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1712ba338424" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In-Depth Technical Details of Ather Scooter Software and OS:]]></title>
            <link>https://medium.com/@syednashetali/in-depth-technical-details-of-ether-scooter-software-and-os-20e49d950658?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/20e49d950658</guid>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Tue, 11 Jun 2024 11:26:17 GMT</pubDate>
            <atom:updated>2024-06-11T11:37:53.529Z</atom:updated>
            <content:encoded><![CDATA[<p>### In-Depth Technical Details of Ather Scooter Software and OS:</p><p>Electric scooters like the Ather Scooter are revolutionizing urban transportation by integrating advanced software and operating systems. This detailed exploration will dive into the technical specifics that make the Ather Scooter a standout in the field, complete with Python code snippets to illustrate key concepts. We’ll also cover features like cruise control, calling, and infotainment.</p><p>#### Architecture and Core Components</p><p>##### 1. **Embedded System Design**</p><p>The embedded system of the Ather Scooter is built around a robust microcontroller unit (MCU). This MCU is the central processing hub, interfacing with various peripherals such as sensors, actuators, and communication modules. The MCU is typically based on ARM Cortex-M series processors, known for their power efficiency and performance.</p><p>- **MCU (Microcontroller Unit):** ARM Cortex-M4/M7, offering features like DSP (Digital Signal Processing) capabilities and FPU (Floating Point Unit) for precise motor control and sensor data processing.<br>- **RTOS (Real-Time Operating System):** FreeRTOS or an equivalent, providing deterministic task scheduling, interrupt handling, and low-latency response times.</p><p>##### 2. **Motor Control Unit (MCU)**</p><p>The motor control unit employs sophisticated algorithms to manage the electric motor.</p><p>- **Field-Oriented Control (FOC):** This algorithm transforms the motor&#39;s control problem into a simpler, linear one, improving efficiency and performance. FOC involves three main stages: <br> - **Clark Transformation:** Converts three-phase currents into a two-axis coordinate system.<br> - **Park Transformation:** Converts the two-axis system into a rotating reference frame.<br> - **PID Control:** Proportional-Integral-Derivative controllers fine-tune the motor&#39;s torque and speed.</p><p>Here&#39;s a Python snippet for a basic PID controller:</p><p>```python<br>class PIDController:<br> def __init__(self, kp, ki, kd):<br> self.kp = kp<br> self.ki = ki<br> self.kd = kd<br> self.prev_error = 0<br> self.integral = 0</p><p>def compute(self, setpoint, measured_value):<br> error = setpoint - measured_value<br> self.integral += error<br> derivative = error - self.prev_error<br> output = self.kp * error + self.ki * self.integral + self.kd * derivative<br> self.prev_error = error<br> return output</p><p># Example usage<br>pid = PIDController(kp=1.0, ki=0.1, kd=0.01)<br>setpoint = 100 # Desired speed<br>measured_value = 90 # Current speed<br>control_signal = pid.compute(setpoint, measured_value)<br>print(f&quot;Control Signal: {control_signal}&quot;)<br>```</p><p>##### 3. **Battery Management System (BMS)**</p><p>The BMS is critical for ensuring the longevity and safety of the scooter&#39;s battery.</p><p>- **Lithium-Ion Battery Cells:** Commonly used due to their high energy density.<br>- **Cell Balancing:** Passive or active cell balancing ensures all cells are charged evenly.<br>- **Protection Circuits:** Overcharge, over-discharge, short-circuit, and thermal protection.<br>- **State-of-Charge (SoC) Estimation:** Algorithms such as Kalman filtering provide accurate SoC estimates, crucial for range prediction.</p><p>Python snippet for a simple Kalman filter:</p><p>```python<br>import numpy as np</p><p>class KalmanFilter:<br> def __init__(self, process_variance, measurement_variance, estimated_measurement_variance):<br> self.process_variance = process_variance<br> self.measurement_variance = measurement_variance<br> self.estimated_measurement_variance = estimated_measurement_variance<br> self.posteri_estimate = 0.0<br> self.posteri_error_estimate = 1.0</p><p>def update(self, measurement):<br> priori_estimate = self.posteri_estimate<br> priori_error_estimate = self.posteri_error_estimate + self.process_variance<br> <br> blending_factor = priori_error_estimate / (priori_error_estimate + self.measurement_variance)<br> self.posteri_estimate = priori_estimate + blending_factor * (measurement - priori_estimate)<br> self.posteri_error_estimate = (1 - blending_factor) * priori_error_estimate<br> <br> return self.posteri_estimate</p><p># Example usage<br>kf = KalmanFilter(process_variance=1e-5, measurement_variance=1e-1, estimated_measurement_variance=1e-2)<br>measured_soc = 90 # Example measured state of charge<br>estimated_soc = kf.update(measured_soc)<br>print(f&quot;Estimated SoC: {estimated_soc}&quot;)<br>```</p><p>##### 4. **Communication Modules**</p><p>Ether Scooter integrates several communication technologies for connectivity:</p><p>- **Bluetooth Low Energy (BLE):** For short-range communication with mobile devices.<br>- **GPS Module:** For location tracking and geofencing capabilities.<br>- **Cellular Connectivity:** For real-time data transmission to the cloud, enabling remote diagnostics and OTA updates.</p><p>#### Operating System Features</p><p>##### 1. **Real-Time Operating System (RTOS)**</p><p>The RTOS provides the foundation for the scooter&#39;s real-time capabilities.</p><p>- **Task Management:** Prioritizes tasks based on urgency, ensuring critical operations like motor control are always responsive.<br>- **Inter-Process Communication (IPC):** Mechanisms like message queues and semaphores facilitate communication between tasks.<br>- **Memory Management:** Ensures efficient use of limited RAM resources, crucial for embedded systems.</p><p>##### 2. **Over-the-Air (OTA) Updates**</p><p>OTA updates allow firmware and software upgrades without physical access to the scooter.</p><p>- **Secure Boot and Firmware Verification:** Ensures that only authenticated firmware is installed, protecting against malicious updates.<br>- **Differential Updates:** Minimizes data transfer by only sending changes, not the entire firmware.</p><p>##### 3. **Data Logging and Analytics**</p><p>The OS logs extensive operational data.</p><p>- **Edge Computing:** Initial data processing is performed on the scooter to reduce latency and bandwidth usage.<br>- **Cloud Integration:** Processed data is sent to cloud servers for deeper analytics using Big Data technologies and machine learning models.</p><p>Here&#39;s a Python snippet for sending data to a cloud server using HTTP:</p><p>```python<br>import requests<br>import json</p><p>def send_data_to_cloud(data):<br> url = &quot;https://cloudserver.com/api/data&quot;<br> headers = {&quot;Content-Type&quot;: &quot;application/json&quot;}<br> response = requests.post(url, data=json.dumps(data), headers=headers)<br> return response.status_code</p><p># Example usage<br>data = {<br> &quot;speed&quot;: 25,<br> &quot;battery_level&quot;: 85,<br> &quot;location&quot;: {&quot;lat&quot;: 12.9716, &quot;lon&quot;: 77.5946}<br>}<br>status_code = send_data_to_cloud(data)<br>print(f&quot;Response Status Code: {status_code}&quot;)<br>```</p><p>##### 4. **Safety and Security**</p><p>Safety features are integrated at both hardware and software levels.</p><p>- **Geofencing:** Utilizes GPS to restrict scooter operation in predefined areas, enforced by the RTOS.<br>- **Anti-Theft Mechanisms:** GPS tracking and remote immobilization features can lock the scooter if unauthorized movement is detected.<br>- **Crash Detection:** Uses accelerometers and gyroscopes to detect sudden impacts, triggering emergency protocols.</p><p>##### 5. **User Interface and Experience**</p><p>The user interface is designed for seamless interaction through a companion app.</p><p>- **Mobile App Integration:** Developed using cross-platform frameworks like Flutter or React Native, ensuring compatibility with iOS and Android.<br>- **Bluetooth Pairing:** Secure pairing protocols prevent unauthorized access.<br>- **Real-Time Data Display:** Shows speed, battery level, and range estimates, updated in real-time via Bluetooth.</p><p>#### Advanced Features</p><p>##### 1. **Cruise Control**</p><p>Cruise control allows the rider to maintain a constant speed without continuously pressing the throttle.</p><p>Python snippet for a basic cruise control implementation:</p><p>```python<br>class CruiseControl:<br> def __init__(self, pid_controller):<br> self.pid_controller = pid_controller<br> self.enabled = False<br> self.set_speed = 0</p><p>def enable(self, set_speed):<br> self.enabled = True<br> self.set_speed = set_speed</p><p>def disable(self):<br> self.enabled = False</p><p>def update(self, current_speed):<br> if self.enabled:<br> return self.pid_controller.compute(self.set_speed, current_speed)<br> else:<br> return 0</p><p># Example usage<br>pid = PIDController(kp=1.0, ki=0.1, kd=0.01)<br>cruise_control = CruiseControl(pid_controller=pid)<br>cruise_control.enable(set_speed=25)</p><p>current_speed = 20 # Example current speed<br>throttle_adjustment = cruise_control.update(current_speed)<br>print(f&quot;Throttle Adjustment: {throttle_adjustment}&quot;)<br>```</p><p>##### 2. **Calling and Infotainment**</p><p>The Ether Scooter integrates calling and infotainment features for enhanced rider experience.</p><p>- **Bluetooth Hands-Free Calling:** Allows riders to make and receive calls via a Bluetooth-connected helmet or headset.<br>- **Infotainment System:** Provides access to music, navigation, and other multimedia through a mobile app interface.</p><p>Python snippet for a basic Bluetooth call handler:</p><p>```python<br>import bluetooth</p><p>def start_bluetooth_call_handler():<br> server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)<br> port = 1<br> server_sock.bind((&quot;&quot;, port))<br> server_sock.listen(1)</p><p>client_sock, address = server_sock.accept()<br> print(f&quot;Accepted connection from {address}&quot;)</p><p>while True:<br> data = client_sock.recv(1024)<br> if not data:<br> break<br> print(f&quot;Received: {data}&quot;)</p><p>client_sock.close()<br> server_sock.close()</p><p># Example usage<br>start_bluetooth_call_handler()<br>```</p><p>Python snippet for a simple music control:</p><p>```python<br>import vlc</p><p>class MusicPlayer:<br> def __init__(self):<br> self.player = vl</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20e49d950658" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving Shopify App’s Performance:]]></title>
            <link>https://medium.com/@syednashetali/improving-shopify-apps-performance-709d35111184?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/709d35111184</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Sun, 26 May 2024 14:57:24 GMT</pubDate>
            <atom:updated>2024-05-26T14:59:21.412Z</atom:updated>
            <content:encoded><![CDATA[<p>Improving Shopify App’s Performance:</p><p>As an integral part of Shopify&#39;s ecosystem, our mobile app serves millions of merchants around the world every single day. It allows them to run their business from anywhere and offers vital insights about store performance, analytics, orders, and more. Given its high-engagement nature, users frequently return to it, underscoring the importance of speed and efficiency.</p><p>At the beginning of 2023, we noticed that our app&#39;s performance had decreased since we started migrating to React Native. Recognizing this, we embarked on a dedicated journey to improve the app&#39;s performance by the end of the year. We’re happy to report that we have met our goals and learned a ton along the way.</p><p>In this blog post, we’re sharing how we did it and hope others use it as inspiration to make their apps faster. After all, not all fast software is great, but all great software is fast.</p><p>Defining and tracking our performance goals</p><p>Setting the right goals is vital when aiming to improve performance. A fast app is fast, regardless of the technology, and these targets should not take the technology into account. We wanted Shopify App to feel as instantaneous as possible to merchants, so we aimed for our critical screens to load under 500ms (P75) and for our app to launch within 2s (P75). This goal seemed very ambitious in the beginning because the P75 for screen loads at the time was 1400ms and app launch was ~4s.</p><p>Once we defined our targets we built internal performance dashboards that were real time and supported data filtering based on device model, OS version, etc to help us slice and dice the data and also debug performance issues in the future. This also enabled us to validate our changes and track our progress as we worked on improving performance.</p><p>Performance bottlenecks</p><p>If we had to group our performance issues into common themes they would be the following:</p><p>Doing necessary work at the wrong time</p><p>Doing unnecessary work</p><p>Not leveraging cache to its fullest</p><p>Doing necessary work at the wrong time</p><p>Excessive rendering during initial render</p><p>This is perhaps the most common issue that we saw across the app. On most devices, the UI is painted 60 times per second. It’s important to make sure we paint whatever is in the visible section of the screen as soon as possible and compute the rest later. This ensures that merchants see relevant content as soon as possible. A good example of this is a carousel, where you may need to render at least 3 items for smooth scrolling, but you can get away with rendering one item in the first render, and the next 2 are buffered for later. The first one will be visible much sooner.</p><p>The following is an image of Shopify App’s Products Overview tab. The red rectangle represents the viewport, anything outside wasn’t required on the first paint. It was necessary work, but done at the wrong time and so was increasing the screen load time unnecessarily.</p><p>We found several areas where this strategy helped and we built tools to help with this like LazyScrollView.</p><p>LazyScrollView</p><p>One of the first things we noticed was that some of the important screens were long, and rendered a lot of content outside the viewport. Even if only 50% of the content drawn was hidden, it was still a lot of extra work. To address this, we built a component called LazyScrollView, which is internally powered by <a href="https://shopify.github.io/flash-list/">FlashList</a>. FlashList only renders what is visible during initial render.. This conversion resulted in significant benefits, reducing load times by as much as 50%.</p><p>export const LazyScrollView = forwardRef(function LazyScrollView( props: LazyScrollViewProps, ref: ForwardedRef&lt;FlashList&lt;unknown[]&gt;&gt;,): JSX.Element { const {children, estimatedScrollViewSize, estimatedItemSize} = props; const data = isArray(children) ? children : Children.toArray(children); // No specific reason for 2000, just a big number. Roughly 2x the screen size const drawDistance = 2000; if (estimatedItemSize === undefined) { console.warn( &quot;LazyScrollView: &#39;estimatedItemSize&#39; is missing, check FlashList warning for a recommended value.&quot;, ); } return ( &lt;FlashList ref={ref} {...props} data={data} renderItem={({item}) =&gt; item} getItemType={(_, index) =&gt; { // Disables recycling of items by assigning a unique type to each item return index; }} estimatedListSize={estimatedScrollViewSize} drawDistance={drawDistance} /&gt; );});</p><p><a href="https://gist.github.com/naqvitalha/8676fe58b306e87f5d46a34e7ad52403/raw/07c8a9d8dbcc183fcce63a47cbfaeb735db42bb3/LazyScrollView.tsx">view raw</a><a href="https://gist.github.com/naqvitalha/8676fe58b306e87f5d46a34e7ad52403#file-lazyscrollview-tsx">LazyScrollView.tsx </a>hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>Improving Shopify App’s Performance</p><p>by <a href="https://shopify.engineering/search?link_search=true&amp;q=Talha+Naqvi">Talha Naqvi</a></p><p><a href="https://shopify.engineering/topics/mobile">Mobile</a></p><p>Mar 5, 2024</p><p>7 minute read</p><p><a href="/service/mailto:?body=https%3A%2F%2Fshopify.engineering%2Fimproving-shopify-app-s-performance&amp;subject=Improving%20Shopify%20App%E2%80%99s%20Performance">Email</a></p><p><a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fshopify.engineering%2Fimproving-shopify-app-s-performance">Facebook</a></p><p><a href="https://twitter.com/intent/tweet?text=Just+finished+reading+Improving+Shopify+App%E2%80%99s+Performance+https%3A%2F%2Fshopify.engineering%2Fimproving-shopify-app-s-performance&amp;via=Shopify">Twitter</a></p><p><a href="https://www.linkedin.com/shareArticle?mini=true&amp;source=Shopify&amp;title=Improving+Shopify+App%E2%80%99s+Performance&amp;url=https%3A%2F%2Fshopify.engineering%2Fimproving-shopify-app-s-performance">LinkedIn</a></p><p>As an integral part of Shopify&#39;s ecosystem, our mobile app serves millions of merchants around the world every single day. It allows them to run their business from anywhere and offers vital insights about store performance, analytics, orders, and more. Given its high-engagement nature, users frequently return to it, underscoring the importance of speed and efficiency.</p><p>At the beginning of 2023, we noticed that our app&#39;s performance had decreased since we started migrating to React Native. Recognizing this, we embarked on a dedicated journey to improve the app&#39;s performance by the end of the year. We’re happy to report that we have met our goals and learned a ton along the way.</p><p>In this blog post, we’re sharing how we did it and hope others use it as inspiration to make their apps faster. After all, not all fast software is great, but all great software is fast.</p><p>Defining and tracking our performance goals</p><p>Setting the right goals is vital when aiming to improve performance. A fast app is fast, regardless of the technology, and these targets should not take the technology into account. We wanted Shopify App to feel as instantaneous as possible to merchants, so we aimed for our critical screens to load under 500ms (P75) and for our app to launch within 2s (P75). This goal seemed very ambitious in the beginning because the P75 for screen loads at the time was 1400ms and app launch was ~4s.</p><p>Once we defined our targets we built internal performance dashboards that were real time and supported data filtering based on device model, OS version, etc to help us slice and dice the data and also debug performance issues in the future. This also enabled us to validate our changes and track our progress as we worked on improving performance.</p><p>Performance bottlenecks</p><p>If we had to group our performance issues into common themes they would be the following:</p><p>Doing necessary work at the wrong time</p><p>Doing unnecessary work</p><p>Not leveraging cache to its fullest</p><p>Doing necessary work at the wrong time</p><p>Excessive rendering during initial render</p><p>This is perhaps the most common issue that we saw across the app. On most devices, the UI is painted 60 times per second. It’s important to make sure we paint whatever is in the visible section of the screen as soon as possible and compute the rest later. This ensures that merchants see relevant content as soon as possible. A good example of this is a carousel, where you may need to render at least 3 items for smooth scrolling, but you can get away with rendering one item in the first render, and the next 2 are buffered for later. The first one will be visible much sooner.</p><p>The following is an image of Shopify App’s Products Overview tab. The red rectangle represents the viewport, anything outside wasn’t required on the first paint. It was necessary work, but done at the wrong time and so was increasing the screen load time unnecessarily.</p><p>We found several areas where this strategy helped and we built tools to help with this like LazyScrollView.</p><p>LazyScrollView</p><p>One of the first things we noticed was that some of the important screens were long, and rendered a lot of content outside the viewport. Even if only 50% of the content drawn was hidden, it was still a lot of extra work. To address this, we built a component called LazyScrollView, which is internally powered by <a href="https://shopify.github.io/flash-list/">FlashList</a>. FlashList only renders what is visible during initial render.. This conversion resulted in significant benefits, reducing load times by as much as 50%.</p><p>export const LazyScrollView = forwardRef(function LazyScrollView( props: LazyScrollViewProps, ref: ForwardedRef&lt;FlashList&lt;unknown[]&gt;&gt;,): JSX.Element { const {children, estimatedScrollViewSize, estimatedItemSize} = props; const data = isArray(children) ? children : Children.toArray(children); // No specific reason for 2000, just a big number. Roughly 2x the screen size const drawDistance = 2000; if (estimatedItemSize === undefined) { console.warn( &quot;LazyScrollView: &#39;estimatedItemSize&#39; is missing, check FlashList warning for a recommended value.&quot;, ); } return ( &lt;FlashList ref={ref} {...props} data={data} renderItem={({item}) =&gt; item} getItemType={(_, index) =&gt; { // Disables recycling of items by assigning a unique type to each item return index; }} estimatedListSize={estimatedScrollViewSize} drawDistance={drawDistance} /&gt; );});</p><p><a href="https://gist.github.com/naqvitalha/8676fe58b306e87f5d46a34e7ad52403/raw/07c8a9d8dbcc183fcce63a47cbfaeb735db42bb3/LazyScrollView.tsx">view raw</a><a href="https://gist.github.com/naqvitalha/8676fe58b306e87f5d46a34e7ad52403#file-lazyscrollview-tsx">LazyScrollView.tsx </a>hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>Optimizing Home screen Load Time</p><p>We also found that our home screen was waiting longer than necessary to show content. There are multiple queries that contribute to the Home screen, and we realized that we could render the home screen much sooner if we didn’t wait for all of the queries to finish. In particular, any queries that displayed data that&#39;s not visible in the first paint.</p><p>Excessive rendering before relevant interaction</p><p>Certain UI elements are not required at all until there is an interaction that makes them visible, like scrolling. Drawing them earlier is an unnecessary use of device resources. Let’s talk about a few issues that we found in Shopify App and the solutions we deployed.</p><p>Horizontal list optimization</p><p>Some of our screens had horizontal lists which had 10-20 items and were rendered using ScrollView or FlatList. Like we’ve mentioned before, ScrollView ends up drawing all the items while FlatList without the right config draws 10 items. In most mobile devices only 3 were visible at a time so all that extra drawing was just wasting resources. We switched to FlashList which resolved these problems completely. FlashList’s ability to take item size estimates and figure out the rest is a powerful feature.</p><p>Building every screen as a list</p><p>Another major initiative was to rewrite all screens as lists, no matter how big or small they were. We wanted to have only drawing what was required become the default, so we built a set of tools on top of FlashList called ListSource, which only renders what&#39;s visible and updates only the necessary components, using an API that is easier and more intuitive than our previous “cell-by-cell” components. This approach not only made the initial render super fast, but also optimized the updates by automatically memoizing what’s necessary.</p><p>Setting inlineRequires to true</p><p>Setting inlineRequires to true in our metro.config.js file improved our launch time by 17%. This simple change was surprising since inlineRequires are often overlooked since the advent of Hermes. However, we found that a lot of upfront code execution can be avoided by enabling inline requires, leading to significant performance improvements. We’re not really sure why this was turned off in our config so we felt it was worth mentioning. Check your config today.</p><p>const path = require(&quot;path&quot;); const exclusionList = require(&quot;metro-config/src/defaults/exclusionList&quot;);const escape = require(&quot;escape-string-regexp&quot;); const package = require(&quot;../package.json&quot;); const modules = Object.keys({ ...package.peerDependencies,}); const root = path.resolve(__dirname, &quot;..&quot;); let watchFolders = [root];watchFolders = watchFolders.concat([path.join(__dirname, &quot;./node_modules&quot;)]);watchFolders = watchFolders.concat([path.join(__dirname, &quot;../node_modules&quot;)]); module.exports = (() =&gt; { const config = { projectRoot: __dirname, transformer: { getTransformOptions: () =&gt; ({ transform: { // Set to true inlineRequires: true, }, }), }, resolver: { blockList: exclusionList( modules.map( (m) =&gt; new RegExp(`^${escape(path.join(root, &quot;node_modules&quot;, m))}\\/.*$`) ) ), extraNodeModules: modules.reduce((acc, name) =&gt; { acc[name] = path.join(__dirname, &quot;node_modules&quot;, name); return acc; }, {}), }, watchFolders, }; if (process.env.CI === &quot;true&quot;) { config.maxWorkers = 1; } return config;})();</p><p>Not leveraging cache to its fullest<br>Shopify App loads data first from cache and fetches from the network in parallel. Initial draw from cache improves perceived loading greatly and the data is still relevant to merchants who come back to the app frequently. Cached data isn’t always outdated and we need to leverage it as much as possible. We took this very seriously and started looking into how we can increase our cache hits as much as possible.</p><p>There’s this notion that loading from cache means showing irrelevant data and that isn’t true for users who open the app frequently. You can always tweak how long data remains cached. If you don’t cache data, you might want to reconsider.</p><p>Tracking Cache Misses and Hits<br>We started tracking cache misses versus cache hits and found that only 50% of the users were loading from cache first. This was less than expected for some of the screens like home which should load from cache more often. After further investigation, we found an issue with our graph QL cache and resolving it increased cache hits by 20%.</p><p>Pre-warming the cache<br>Based on these numbers it was clear that users loading from cache have a much better app experience, so we wanted more of them to get data from cache first and we also wanted cached data to be more relevant and not outdated. For our critical screens we found common trigger points where we could implement a way to pre-warm the cache. With this strategy in place we observed that for key screens as much as 90% of merchants now see data from cache first. This significantly lowered our P75 times because we completely eliminated the lag introduced by the network.</p><p>Conclusion<br>Our year-long journey to improve the performance of our mobile application has been challenging, enlightening, and ultimately rewarding. The app launch (P75) is 44% faster and screen load times (P75) have reduced by 59%. This is a massive win for our merchants.</p><p>Blog by Nashet Ali.</p><p>For more such content like, share and follow Cloudify with Nashet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=709d35111184" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Title: Demystifying Autotune Software: Architecture and Real-Life Implementation Scenarios]]></title>
            <link>https://medium.com/@syednashetali/title-demystifying-autotune-software-architecture-and-real-life-implementation-scenarios-9db8b4a23610?source=rss-e6c3c00e8d6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9db8b4a23610</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Nashet Ali]]></dc:creator>
            <pubDate>Sat, 11 May 2024 22:08:04 GMT</pubDate>
            <atom:updated>2024-05-11T22:08:04.843Z</atom:updated>
            <content:encoded><![CDATA[<p>Title: Demystifying Autotune Software: Architecture and Real-Life Implementation Scenarios</p><p>Introduction:<br>In the ever-evolving landscape of software development, the demand for efficient and scalable solutions has led to the emergence of sophisticated tools like Autotune software. Autotune, initially popularized in the realm of music production, has found its place in various industries, including software engineering. This blog delves into the architecture of Autotune software and explores real-life implementation scenarios, shedding light on its practical applications and benefits.</p><p>Understanding Autotune Software:<br>Autotune software operates on the principle of automated optimization, aimed at enhancing the performance and efficiency of systems. At its core, Autotune employs algorithms and machine learning techniques to analyze system behavior, identify inefficiencies, and dynamically adjust parameters to achieve optimal outcomes. While traditionally associated with tuning vocal pitches in music, the concept has been extrapolated to software systems to fine-tune performance metrics such as response time, resource utilization, and throughput.</p><p>Architecture of Autotune Software:<br>The architecture of Autotune software typically comprises several key components, each serving a specific function in the optimization process:</p><p>1. Data Collection Module: This component is responsible for gathering relevant data metrics from the target system. These metrics may include CPU usage, memory consumption, network latency, and application-specific performance indicators.</p><p>2. Analysis Engine: The analysis engine processes the collected data using advanced algorithms to identify performance bottlenecks and areas for improvement. Machine learning models may be employed to recognize patterns and correlations within the data.</p><p>3. Optimization Controller: Based on the insights provided by the analysis engine, the optimization controller generates recommendations for parameter adjustments or system configurations. These recommendations are then applied to the target system to improve performance.</p><p>4. Feedback Loop: A crucial aspect of Autotune software is its ability to adapt and learn from past optimization attempts. The feedback loop facilitates continuous monitoring of system performance post-optimization, allowing the software to iteratively refine its tuning strategies over time.</p><p>Real-Life Implementation Scenarios:<br>1. Cloud Infrastructure Optimization: In a cloud computing environment, Autotune software can be deployed to dynamically adjust resource allocation based on fluctuating workloads. By optimizing virtual machine configurations and auto-scaling parameters, organizations can minimize costs while ensuring optimal performance and reliability.</p><p>2. Database Performance Tuning: Database systems often encounter performance issues stemming from suboptimal query execution plans, indexing strategies, or resource utilization. Autotune software can analyze database metrics in real-time and recommend optimizations such as index creation, query rewriting, or cache tuning to improve overall throughput and response time.</p><p>3. IoT Device Optimization: In the realm of Internet of Things (IoT), Autotune software can play a vital role in optimizing the performance of connected devices and sensors. By dynamically adjusting communication protocols, data sampling rates, and power management settings, Autotune ensures efficient utilization of IoT resources while maximizing battery life and network bandwidth.</p><p>Conclusion:<br>Autotune software represents a powerful tool in the arsenal of modern software architects and engineers, enabling automated optimization of complex systems across diverse domains. By leveraging advanced algorithms and machine learning techniques, Autotune streamlines the process of performance tuning and empowers organizations to achieve optimal efficiency, scalability, and reliability in their software deployments. As technology continues to advance, the role of Autotune software is poised to expand, driving innovation and efficiency in the digital era.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9db8b4a23610" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>