Blog

  • Optimizing Apache Airflow Performance: Configuring Worker Count for Maximum Efficiency

    Airflow workers are responsible for executing the tasks defined in Directed Acyclic Graphs (DAGs). Each worker can handle one task at a time. The number of workers directly impacts the system’s ability to parallelize task execution, thus influencing overall workflow performance.

    Factors Influencing Worker Count
    1. Workload Characteristics: Analyze the nature of your workflows. If your DAGs consist of numerous parallelizable tasks, increasing worker count can lead to better parallelism and faster execution.
    2. Resource Availability: Consider the resources available on your Airflow deployment environment. Each worker consumes CPU and memory resources. Ensure that the worker count aligns with the available system resources.
    3. Task Execution Time: Evaluate the average execution time of tasks in your workflows. If tasks are short-lived, a higher worker count may be beneficial. For longer-running tasks, a lower worker count might be sufficient.
    Configuring Airflow Worker Count
    1. Airflow Configuration File: Open the Airflow configuration file (commonly airflow.cfg). Locate the parallelism parameter, which determines the maximum number of task instances allowed to run concurrently. Adjust this value based on your workload characteristics.
    2. Scaling Celery Workers: If you’re using Celery as your executor, adjust the number of Celery worker processes. This can be done in the Celery configuration file or through a command-line argument.
    3. Dynamic Scaling: Consider dynamic scaling solutions if your workload varies over time. Tools like Celery AutoScaler can automatically adjust the worker count based on the queue size.
    Monitoring and Tuning
    1. Airflow Web UI: Utilize the Airflow web UI to monitor task execution and worker performance. Adjust the worker count based on observed patterns and bottlenecks.
    2. System Monitoring Tools: everage system monitoring tools to assess CPU, memory, and network usage. Ensure that the chosen worker count aligns with available resources.
    3. Logging and Alerts: Set up logging and alerts to receive notifications about any performance issues. This enables proactive adjustments to the worker count when needed.
    Conclusion

    Configuring the Airflow worker count is a critical aspect of optimizing performance. By carefully considering workload characteristics, resource availability, and task execution times, and by adjusting relevant configuration parameters, you can ensure that your Airflow deployment operates at peak efficiency. Regular monitoring and tuning will help maintain optimal performance as workload dynamics evolve.

  • Choosing Kafka Partitions: A Technical Exploration

    Apache Kafka’s partitioning mechanism is a critical aspect of its design, influencing the performance, scalability, and reliability of your data streaming infrastructure. Properly configuring and choosing the number of partitions is fundamental to achieving optimal throughput and fault-tolerance in Kafka. In this technical article, we will delve into the considerations and best practices for selecting the appropriate number of partitions for your Kafka topics.

    Understanding Kafka Partitions

    In Kafka, a topic is divided into partitions, each acting as an ordered, immutable sequence of records. Partitions serve as the unit of parallelism and scalability within Kafka. Producers write records to specific partitions, and consumers read records from those partitions.

    Key Characteristics of Partitions:

    1. Parallelism: Partitions enable parallel processing of records. Different partitions can be read and written to concurrently, enhancing throughput.
    2. Ordering: Records within a partition are strictly ordered based on their arrival time. However, the order is guaranteed only within a partition, not across partitions.
    3. Scaling: Kafka’s scalability is achieved through horizontal scaling. Adding more partitions allows for increased parallelism and distribution of data across multiple brokers.

    Factors Influencing Partition Selection:

    1. Throughput Requirements:

    • If your application demands high throughput, increasing the number of partitions can enhance parallelism. Each partition can be processed independently, allowing for concurrent reads and writes.

    2. Consumer Parallelism:

    • Consider the number of consumer instances and their capacity to handle partitions. A rule of thumb is to have at least as many partitions as there are consumer instances to achieve effective parallelism.

    3. Scalability:

    • Partitions contribute to Kafka’s scalability. As your data volume grows, adding partitions provides a means to distribute the load across multiple brokers.

    4. Ordering Requirements:

    • If maintaining strict order within a partition is crucial for your use case, having fewer partitions might be appropriate. However, be aware that this could limit parallelism.

    5. Retention Policy:

    • The retention policy, specifying how long data should be retained, can impact partition size. Shorter retention periods might necessitate more partitions to manage data effectively.

    Best Practices for Choosing Kafka Partitions:

    1. Start with a Reasonable Number:

    • Begin with a modest number of partitions and monitor system performance. You can adjust the partition count based on observed throughput and scaling needs.

    2. Consider Future Growth:

    • Anticipate the growth of your data and user base. Design the partitioning strategy with scalability in mind to accommodate future requirements.

    3. Balance Partitions Across Brokers:

    • Distribute partitions evenly across Kafka brokers to prevent resource imbalances. This ensures optimal utilization of the available resources.

    4. Monitor Consumer Lag:

    • Regularly monitor consumer lag, which is the delay between record production and consumption. If lag becomes a concern, revisiting the partitioning strategy might be necessary.

    5. Repartitioning Strategies:

    • Repartitioning topics can be challenging, so plan for it carefully. Tools like Kafka Streams or MirrorMaker can assist in repartitioning when needed.

    Conclusion

    Choosing the right number of partitions in Kafka is a nuanced decision that requires careful consideration of various factors. Striking the balance between parallelism, ordering requirements, and scalability is crucial for the effective utilization of Kafka’s capabilities. Regular monitoring, thoughtful planning, and a keen understanding of your application’s requirements will guide you in making informed decisions about partitioning, ensuring a robust and performant Kafka data streaming infrastructure.

  • Choosing Self-Hosted Kafka versus Confluent Kafka

    Deploying Your Own Kafka:

    Customization and Control:

    • Pros: Self-deployment affords granular control over Kafka configuration, enabling tailoring to exact application requirements.
    • Cons: Managing a bespoke deployment demands technical prowess in Kafka administration, encompassing monitoring, scaling, and configuration management.

    Customization and Control:

    • Pros: Self-hosted Kafka may present cost advantages contingent upon optimized resource utilization and efficient infrastructure management.
    • Cons: Initial setup expenses, coupled with ongoing operational costs (monitoring, maintenance, and upgrades), should be meticulously factored into the Total Cost of Ownership (TCO) analysis.

    Flexibility:

    • Pros: Unbridled flexibility to select Kafka versions, plugins, and complementary tools to align with specific operational needs.
    • Cons: The onus of keeping the system abreast of the latest Kafka releases and ensuring compatibility lies squarely on the operational team.

    Deploying Your Own Kafka:

    Managed Service

    • Pros: Confluent’s managed Kafka service alleviates operational overhead by handling infrastructure maintenance, monitoring, and updates.
    • Cons: Sacrificing a degree of control over the underlying infrastructure and constraining customization options compared to a self-managed setup.

    Scalability

    • Pros: Confluent Cloud, as a managed service, seamlessly facilitates scalability, allowing effortless adaptation to variable workloads.
    • Cons: Scaling considerations must account for potential cost increments, and customization constraints vis-a-vis a self-hosted solution.

    Integration with Ecosystem

    • Pros: Confluent provides a comprehensive ecosystem, featuring tools like Confluent Schema Registry, Kafka Connect, and KSQL, fostering seamless integration into diverse data pipelines.
    • Cons: The reliance on Confluent’s ecosystem may introduce limitations, potentially curtailing the utilization of tools outside the Confluent suite.

    Considerations

    • Expertise: Evaluate the technical acumen of the team in Kafka infrastructure management. A managed service may be prudent in the absence of specialized Kafka administrators.
    • Resource Constraints: Conduct a meticulous evaluation of organizational resources and budgetary constraints, encompassing both initial setup and ongoing operational costs.
    • Future Requirements: Anticipate future scalability demands and scrutinize whether a managed service can adeptly scale in tandem with evolving operational needs.

    In summation, the selection between self-deployed Kafka and Confluent Kafka hinges on an organization’s unique technical requisites, resource availability, and proficiency in Kafka administration.

  • Mastering Load Testing with Apache JMeter: A Guide

    Introduction:

    Load testing is a critical phase in the software development life cycle that ensures applications can handle the expected user load without performance degradation. Apache JMeter stands as a powerful tool in the arsenal of software testers, enabling them to simulate thousands of users and analyze how the application behaves under heavy load. This article will delve into the world of load testing using JMeter, covering key concepts, best practices, and tips for effective load testing.

    Understanding Load Testing:

    Load testing involves subjecting a system to a specific load to observe its behavior under different conditions. It helps identify bottlenecks, assess system performance, and ensure that an application can handle the expected user load. JMeter excels in this domain by providing a user-friendly interface and robust features.

    Key Features of JMeter:

    1. User-Friendly Interface: JMeter boasts an intuitive GUI that simplifies the process of creating test plans. Testers can easily design scenarios, set parameters, and execute tests without extensive programming knowledge.
    2. Protocol Support: JMeter supports a wide array of protocols, including HTTP, HTTPS, FTP, JDBC, LDAP, SOAP, and more. This flexibility allows testers to simulate real-world scenarios for various types of applications.
    3. Scalability: JMeter enables the creation of distributed testing environments, distributing load across multiple machines. This scalability ensures realistic simulations of user behavior and high-volume traffic.

    Getting Started:

    1. Installation: Start by downloading and installing JMeter from the official Apache JMeter website. The tool is platform-independent, making it accessible for Windows, Linux, and macOS users.
    2. Creating a Test Plan:
    • Define the test scenario: Identify the user actions and interactions you want to simulate.
    • Add Thread Group: Specify the number of users and the ramp-up period.
    • Configure Samplers: Use HTTP Request or other relevant samplers to simulate user actions.
    • Add Listeners: Include listeners such as View Results Tree, Summary Report, or Graph Results to visualize and analyze test results.

    Best Practices for Effective Load Testing with JMeter:

    1. Script Optimization: Efficient scripts are crucial for accurate results. Parameterize your scripts, reuse variables, and leverage JMeter’s built-in functions for dynamic data.
    2. Think Time and Pacing: Real-world users don’t interact with applications continuously. Introduce think time and pacing to simulate a more realistic user scenario.
    3. Results Analysis: Use JMeter’s listeners to analyze test results effectively. Aggregate Report, Response Times Over Time, and Active Threads Over Time are valuable tools for performance analysis.
    4. Correlation and Extractors: For dynamic web applications, use JMeter’s Regular Expression Extractors to correlate dynamic values and maintain session consistency.

    Automation and Continuous Integration:

    Integrate JMeter into your continuous integration (CI) pipeline using tools like Jenkins or Bamboo. This ensures that load testing becomes an integral part of the development process, providing early feedback on application performance.

    Conclusion:

    Mastering load testing with Apache JMeter requires a solid understanding of its features and best practices. By leveraging its scalability, protocol support, and user-friendly interface, testers can simulate real-world scenarios, identify performance bottlenecks, and ensure that applications can handle the anticipated user load. Incorporating JMeter into your testing toolkit empowers your team to deliver high-performance applications that meet user expectations.

  • OAuth 2.0 : A Ready Reckoner


    Introduction:

    In the dynamic world of web applications and services, security is paramount. OAuth 2.0, an open standard for access delegation and authorization, is a vital element in securing interactions between different applications. This article aims to provide a comprehensive guide to OAuth 2.0, delving into its principles, components, and its role in modern web development.


    What is OAuth 2.0?

    OAuth 2.0 is an evolution of its predecessor, OAuth 1.0. It serves as an authorization framework, allowing third-party applications to access a user’s data without exposing their credentials. This standard is widely embraced across various industries, forming the foundation for secure and delegated access in many popular platforms.


    Key Concepts:

    Roles:

    • Resource Owner: The user granting access to their data.
    • Client: The application requesting access.
    • Authorization Server: Manages the authorization process and issues access tokens.
    • Resource Server: Hosts and responds to requests for protected user data.

    Access Token:

    • A credential representing authorization granted to the client.
    • Used to access protected resources.

    Authorization Grant:

    • The method by which the client obtains the access token.

    Scope:

    • Specifies the level of access requested by the client.

    Authorization Flow:

    OAuth 2.0 offers various flows tailored for different scenarios:

    • Authorization Code Flow: Used by server-side applications.
    • Implicit Flow: Ideal for mobile or browser-based applications.
    • Client Credentials Flow: For machine-to-machine communication.
    • Resource Owner Password Credentials Flow: Not recommended due to security considerations.

    Components of OAuth 2.0:

    • Authorization Endpoint:
    • Manages initial user authentication and authorization.
    • Token Endpoint:
    • Exchanges authorization grants for access tokens.
    • Redirection Endpoint:
    • Directs users after successful authorization.
    • Client Registration:
    • The process of registering an application with the authorization server.

    Security Considerations:

    • Token Security:
    • Secure communication using HTTPS.
    • Implement token expiration and refresh mechanisms.
    • Client Security:
    • Keep client secrets confidential.
    • Validate and secure redirect URIs.
    • User Consent:
    • Clearly communicate the data the application will access.

    OAuth 2.0 in Action:

    • API Integration:
    • Major APIs like Google, Facebook, and GitHub use OAuth 2.0 for authorization.
    • Single Sign-On (SSO):
    • Foundation for many single sign-on solutions, enabling users to log in once for multiple services.

    Challenges and Best Practices:

    • Token Management:
    • Regularly rotate and invalidate tokens.
    • Consent Management:
    • Ensure users have control over shared data.
    • Logging and Monitoring:
    • Monitor and log authentication and authorization events for security auditing.

    Conclusion:

    OAuth 2.0 has become integral to securing modern web applications and APIs. Understanding its principles, components, and security considerations is essential for developers and system architects, facilitating the creation of robust and secure applications in today’s interconnected digital landscape.

  • Setting Up Hindi OCR Using Pytesseract

    Pytesseract, a Python wrapper for Google’s Tesseract-OCR Engine, is a popular tool for implementing OCR in Python applications. In this guide, we will walk through the process of setting up Hindi OCR using Pytesseract.

    Prerequisites:

    Before you begin, ensure you have the following prerequisites installed on your system:

    1. Python and Pip:
      Make sure you have Python installed on your system. You can download it from python.org. Pip, the package installer for Python, should also be installed.
    2. Tesseract OCR Engine:
      Install Tesseract on your system. You can download it from the official GitHub repository. Follow the installation instructions provided for your operating system.
    3. Pytesseract:
      Install the Pytesseract library using pip:
       pip install pytesseract
    1. Pillow (PIL Fork):
      Pillow is a powerful image processing library in Python. Install it using:
       pip install pillow

    Set Up Hindi Language Support:

    By default, Tesseract supports multiple languages, but we need to specify Hindi for our OCR setup. Follow these steps:

    1. Download Hindi Language Data:
      Visit the Tesseract GitHub page for language data and download the Hindi language data file (hin.traineddata). Place the downloaded file in the Tesseract installation directory.
    2. Specify Language in Pytesseract:
      In your Python script or application, set the language parameter to ‘hin’ when using Pytesseract. For example:
       import pytesseract
       from PIL import Image
    
       pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'  # Set your Tesseract installation path
       image_path = 'path/to/your/image.png'
       text = pytesseract.image_to_string(Image.open(image_path), lang='hin')
       print(text)

    Make sure to replace the Tesseract path (tesseract_cmd) with the path where Tesseract is installed on your system.

    1. Run Your Script:
      Execute your Python script, and Pytesseract will use Tesseract with Hindi language support to perform OCR on the specified image.

    Tips and Troubleshooting:

    • Image Quality:
      Ensure that the input image is of high quality. OCR accuracy is greatly affected by image resolution and clarity.
    • Tesseract Path:
      Double-check the path to the Tesseract executable. It should be set correctly in your Python script.
    • Language Code:
      Confirm that you are using the correct language code (‘hin’ for Hindi) when specifying the language in Pytesseract.
    • OCR Confidence:
      Pytesseract provides confidence scores for OCR results. You can access them by using the confidence parameter. This can be helpful for evaluating the reliability of the OCR output.

    By following these steps, you can set up Hindi OCR using Pytesseract and extract text from images written in the Hindi language. Experiment with different images and tune the OCR parameters as needed for optimal results. Happy coding!

  • Setting Up Seamless CI/CD with GitLab CI and AWS

    Continuous Integration (CI) and Continuous Deployment (CD) are integral practices in modern software development, ensuring that code is consistently tested, built, and deployed. GitLab CI, coupled with the powerful cloud infrastructure of AWS (Amazon Web Services), provides a robust platform for automating these processes. In this guide, we will walk through the steps to set up a seamless CI/CD pipeline using GitLab CI and AWS.

    Prerequisites:

    1. GitLab Account: Ensure you have a GitLab account and a repository for your project.
    2. AWS Account: Set up an AWS account and obtain necessary credentials.

    Setting Up GitLab CI:

    1. Create a .gitlab-ci.yml File:
      In the root of your GitLab repository, create a .gitlab-ci.yml file. This file defines the CI/CD pipeline stages, jobs, and scripts.
       stages:
         - build
         - test
         - deploy
    
       before_script:
         - apt-get update -qy
         - apt-get install -y python3-pip
         - pip3 install awscli
    
       build:
         script:
           - echo "Building your application"
    
       test:
         script:
           - echo "Running tests"
    
       deploy:
         script:
           - aws s3 sync ./your-deployment-directory s3://your-s3-bucket
    1. Configure GitLab Runner:
      GitLab Runners execute the jobs defined in your .gitlab-ci.yml file. You can use shared or specific runners depending on your needs. Install and register a runner following the instructions in the GitLab documentation.

    Setting Up AWS for Deployment:

    1. Create an S3 Bucket:
      In the AWS Management Console, create an S3 bucket to store your deployment artifacts. Ensure the bucket name is unique and set appropriate permissions.
    2. Configure AWS Credentials:
      Set up AWS credentials on your GitLab CI/CD environment. This can be achieved by adding AWS Access Key ID and Secret Access Key as environment variables in your GitLab CI/CD settings.

    Setting Up Deployment Script:

    1. Install AWS CLI in CI/CD Environment:
      In the .gitlab-ci.yml file, install the AWS CLI as part of the before_script section.
    2. Define Deployment Script:
      Modify the deployment stage in .gitlab-ci.yml to include the necessary AWS CLI commands for deploying your application to AWS.
       deploy:
         script:
           - aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
           - aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
           - aws s3 sync ./your-deployment-directory s3://your-s3-bucket
    1. Secure AWS Credentials:
      Utilize GitLab CI/CD environment variables to securely store AWS credentials. Avoid hardcoding sensitive information in your scripts.

    Conclusion:

    By integrating GitLab CI with AWS, you’ve established a robust CI/CD pipeline for your project. Commits to your GitLab repository will trigger automated builds, tests, and deployments, ensuring a smooth and efficient development process. This setup lays the foundation for scalable and reliable software delivery, fostering collaboration and accelerating your release cycles.

  • The Crucial Role of Process Flows in Software Development Efficiency

    In the realm of software development, where precision and efficiency are paramount, the creation of comprehensive process flows is a strategic necessity. Process flows, visual representations of the steps and interactions within a software development lifecycle, serve as the backbone for efficient project management, collaboration, and the delivery of high-quality software. This article delves into the significance of crafting detailed process flows in the software development context and explores the tangible benefits they bring to development teams.

    1. Blueprint for Development:

    Process flows in software development act as a blueprint, delineating the sequence of tasks involved in bringing a concept to fruition. They provide a visual guide for developers, project managers, and stakeholders, ensuring a shared understanding of the software development lifecycle and the critical steps involved.

    2. Efficiency and Agile Development:

    Agile methodologies, with their iterative and collaborative approach, are at the core of modern software development. Process flows enhance agility by clearly defining workflows, enabling teams to adapt to changes seamlessly. Developers can identify and eliminate bottlenecks, reducing development cycles and accelerating time-to-market.

    3. Error Detection and Prevention:

    Visualizing the entire development process allows teams to identify potential points of failure or error. By spotting these issues early in the process flow, developers can implement preventive measures, reducing the likelihood of bugs and ensuring a higher quality of code.

    4. Collaborative Development:

    In a collaborative software development environment, effective communication is key. Process flows act as a communication tool, facilitating understanding among team members about their roles, dependencies, and the overall project structure. This clarity enhances collaboration and teamwork.

    5. Traceability and Compliance:

    Process flows provide traceability by documenting the flow of code changes from development through testing to deployment. This traceability is essential for compliance with industry regulations and standards, ensuring transparency in the development process.

    6. Automated Workflows:

    Automation is a cornerstone of modern software development. Well-defined process flows are essential for implementing automated workflows, enabling the seamless integration of tools and technologies that automate repetitive tasks and enhance overall efficiency.

    Conclusion:

    From conceptualization to deployment, the creation of process flows is indispensable in the software development landscape. It serves as a navigational guide for development teams, fostering efficiency, reducing errors, and promoting collaboration. As software development continues to evolve, organizations that invest in creating and maintaining robust process flows position themselves to deliver high-quality software in a timely and adaptive manner, ultimately ensuring success in today’s dynamic tech-driven environment.

  • Deploying Your AI Model

    Once you have a trained machine learning model, exposing it as an API allows other applications to interact with and use the model’s predictions. Here’s a step-by-step guide on how to create an API for a trained model:

    1. Choose a Framework:

    • Decide on a web framework or technology to serve your model as an API. Flask (Python), Django, FastAPI, or TensorFlow Serving are common choices.

    2. Create a Web Server:

    • Use the chosen framework to set up a web server. For example, if you’re using Flask, you’d create a Flask application.
    from flask import Flask, request, jsonify
    app = Flask(__name__)

    3. Load the Trained Model:

    • Load your pre-trained machine learning model into your application. This could be a TensorFlow or PyTorch model, for instance.
    # Example for loading a TensorFlow model in Flask
    from tensorflow import keras
    model = keras.models.load_model('path/to/your/model')

    4. Define an API Endpoint:

    • Create an endpoint that will receive input data and return model predictions. This is the function that will be called when someone queries your API.
    @app.route('/predict', methods=['POST'])
    def predict():
        data = request.json  # Assuming JSON data is sent in the request
        # Perform any necessary preprocessing on the input data
        predictions = model.predict(data)
        # Format the predictions as needed
        return jsonify({'predictions': predictions.tolist()})

    5. Handle Input and Output:

    • Define how your API will handle input data and format the output. This includes any necessary data validation and post-processing steps.

    6. Run the Web Server:

    • Start the web server to make your API accessible. Depending on your chosen framework, this might involve running a command like flask run.

    7. Test Locally:

    • Test your API locally to ensure that it’s working as expected. You can use tools like curl or Postman to send requests and receive predictions.

    8. Deploy the API:

    • Choose a platform to deploy your API. This could be a cloud platform like AWS, Google Cloud, or Azure. Alternatively, you can deploy it on your own server.

    9. Expose the API:

    • Once deployed, expose your API to the internet. This might involve setting up a domain name and configuring security settings.

    10. Documentation:

    • Create documentation that explains how to use your API, including the expected input format, available endpoints, and how to interpret the output.
  • AWS Greengrass

    AWS IoT Greengrass is a service that extends AWS Cloud capabilities to local devices, making it possible to run AWS Lambda functions on edge devices. This allows you to process data locally, reducing the need for constant communication with the cloud.

    Scenario

    You have a temperature sensor deployed in a remote location, and you want to monitor the temperature readings locally using AWS IoT Greengrass. When the temperature exceeds a certain threshold, you want to trigger a local action, such as turning on a fan or sending an alert.

    Steps

    Set Up AWS IoT Core:

    • Create an AWS IoT Core Thing for your temperature sensor.
    • Attach the required policies to your Thing to allow it to communicate with AWS IoT Core.

    Set Up AWS IoT Greengrass:

      • Create a Greengrass group and core.
      • Add your temperature sensor Thing to the Greengrass group.
      • Deploy the Greengrass group configuration to your devices.

      Create Lambda Function:

      • Write a Lambda function in the AWS Lambda console that reads the temperature from the sensor.
      • Add logic to compare the temperature against a threshold and take action if the threshold is exceeded. For example:
      import json
      import greengrasssdk
      
      client = greengrasssdk.client('iot-data')
      
      def lambda_handler(event, context):
          temperature = event['temperature']
          threshold = 30  # Set your desired threshold
      
          if temperature > threshold:
              # Temperature exceeds threshold, take action
              message = "High temperature alert! Temperature is {} degrees.".format(temperature)
              client.publish(topic='temperature_alert', payload=json.dumps({'message': message}))
      
          return {'statusCode': 200, 'body': json.dumps('Temperature checked successfully.')}
      

      Configure Subscription:

      • Configure a subscription in the Greengrass group to send temperature data to the Lambda function.
      • Define a topic for communication between the temperature sensor and the Lambda function.

      Deploy and Test:

      • Deploy the updated Greengrass group configuration to your devices.
      • Simulate temperature changes or use your actual temperature sensor to trigger the Lambda function when the temperature exceeds the threshold.

      Monitor:

      • Monitor the AWS IoT Greengrass logs to see the temperature readings and any alerts triggered by the Lambda function.

      This example demonstrates how AWS IoT Greengrass can be used to monitor a temperature sensor locally and take actions based on the sensor data without relying on constant communication with the cloud. Adjust the Lambda function and configuration based on your specific requirements and use case.