<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ebenezer Tosan</title>
    <description>The latest articles on DEV Community by Ebenezer Tosan (@ebenezer_tosan).</description>
    <link>https://dev.to/ebenezer_tosan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2875284%2F9a9b8ba3-e903-479a-9760-0c23b59bd8a1.png</url>
      <title>DEV Community: Ebenezer Tosan</title>
      <link>https://dev.to/ebenezer_tosan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ebenezer_tosan"/>
    <language>en</language>
    <item>
      <title>IoT to Cloud: Why Store IoT data in the cloud?</title>
      <dc:creator>Ebenezer Tosan</dc:creator>
      <pubDate>Tue, 19 Aug 2025 08:30:53 +0000</pubDate>
      <link>https://dev.to/ebenezer_tosan/iot-to-cloud-why-store-iot-data-in-the-cloud-2fa9</link>
      <guid>https://dev.to/ebenezer_tosan/iot-to-cloud-why-store-iot-data-in-the-cloud-2fa9</guid>
      <description>&lt;p&gt;In my last post on the IoT to Cloud series, we discussed the basics of IoT and Cloud from a fundamental perspective. As you know, the Internet of Things (IoT) is everywhere today—from smart home devices to sensors in vehicles and healthcare wearables. Each of these devices generates a large amount of data that needs to be collected, processed, and stored for insights. The big question here is: where should all this data go? This is where Cloud storage comes in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Store IoT Data in the Cloud?
&lt;/h2&gt;

&lt;p&gt;By sending IoT-generated data to the cloud, we benefit in several ways:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt; The cloud can scale to handle growing volumes of IoT data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessibility:&lt;/strong&gt; Data stored in the cloud can be accessed from anywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integration:&lt;/strong&gt; Cloud platforms connect easily with other tools such as AI, analytics, and visualization platforms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security:&lt;/strong&gt; Cloud platforms are built with strong security measures, ensuring stored data remains safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are the Available Cloud Platforms for Housing IoT Data?
&lt;/h2&gt;

&lt;p&gt;Several cloud platforms with IoT support are available today, and the choice of which to use depends on the user’s needs. Below are some of the most widely adopted options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Amazon Web Services (AWS IoT Core)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Microsoft Azure IoT Hub&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Google Cloud IoT Core (now being phased out but still worth mentioning for context)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;IBM Watson IoT Platform&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These platforms share similarities while also offering unique features for connecting IoT data to the cloud. As mentioned earlier, selecting the right platform depends on the user’s requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, IoT is not a new technology—it is already a part of our daily lives. While IoT provides great benefits, it also generates massive amounts of data daily. Properly storing this data is essential, and this is where Cloud storage plays a critical role.&lt;/p&gt;

&lt;p&gt;In the next discussion, we will compare current cloud options and highlight the benefits of each as they relate to storing IoT data.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>IoT &amp; Cloud - Intro</title>
      <dc:creator>Ebenezer Tosan</dc:creator>
      <pubDate>Wed, 13 Aug 2025 16:17:39 +0000</pubDate>
      <link>https://dev.to/ebenezer_tosan/iot-cloud-intro-3n2o</link>
      <guid>https://dev.to/ebenezer_tosan/iot-cloud-intro-3n2o</guid>
      <description>&lt;p&gt;&lt;strong&gt;The Internet of Things (IoT)&lt;/strong&gt; has become one of the most talked-about technologies in recent years. From smart homes to industrial automation, IoT is being applied across various domains to deliver real-time automation, enhanced security, and improved operational efficiency.&lt;/p&gt;

&lt;p&gt;As the adoption of IoT continues to grow, so does the need for scalable solutions. This is where IoT-to-Cloud integration comes in, enabling connected devices to send data to the cloud for processing, storage, and analysis.&lt;/p&gt;

&lt;p&gt;In this post, I’ll introduce the basic concepts of IoT and cloud computing, explain why combining them is so powerful, and give a high-level overview of how IoT-to-Cloud communication works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Definition of Terms
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Internet of Things (IoT)&lt;/strong&gt; refers to a network of physical devices — such as sensors, actuators, and microcontrollers — that collect and exchange data through the internet. These devices are designed to monitor, automate, and respond to real-world conditions with minimal human intervention.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As IoT ecosystems grow in size and complexity, local processing and storage quickly become insufficient. This is where cloud computing plays a critical role.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloud platforms&lt;/strong&gt; offer scalable infrastructure, real-time analytics, long-term storage, and centralized control — all essential for managing large volumes of data generated by IoT devices. Integrating IoT with the cloud enables smarter decision-making, remote monitoring, predictive maintenance, and more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The combination of IoT and cloud computing has already transformed industries such as:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Smart homes – enabling voice-controlled lights, thermostats, and appliances&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Healthcare - powering remote patient monitoring and health tracking&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Manufacturing – supporting predictive maintenance and asset tracking&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Agriculture – improving crop monitoring and irrigation systems&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To make this integration possible, lightweight and efficient communication protocols are needed. One such protocol is MQTT (Message Queuing Telemetry Transport) — a publish/subscribe messaging model ideal for IoT-to-cloud communication.&lt;/p&gt;

&lt;p&gt;As earlier stated, this is an introduction to &lt;strong&gt;IoT and Cloud&lt;/strong&gt;. In the next post we would discuss more on cloud platforms that support IoT.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>programming</category>
      <category>iot</category>
    </item>
    <item>
      <title>Basics of ON DELETE CASCADE and ON UPDATE CASCADE in SQL - PART 1</title>
      <dc:creator>Ebenezer Tosan</dc:creator>
      <pubDate>Tue, 08 Apr 2025 03:28:41 +0000</pubDate>
      <link>https://dev.to/ebenezer_tosan/basics-of-on-delete-cascade-and-on-update-cascade-in-sql-part-1-3jf7</link>
      <guid>https://dev.to/ebenezer_tosan/basics-of-on-delete-cascade-and-on-update-cascade-in-sql-part-1-3jf7</guid>
      <description>&lt;p&gt;When working with relational databases, keeping data consistent across tables is critical. This is where foreign keys and referential actions like ON DELETE CASCADE and ON UPDATE CASCADE come into play.&lt;/p&gt;

&lt;p&gt;What Are CASCADE Actions in SQL?&lt;br&gt;
In SQL, when you define a foreign key relationship between two tables, you can specify what should happen when the data in the parent table is deleted or updated.&lt;/p&gt;

&lt;p&gt;There are a few options (CASCADE, SET NULL, RESTRICT, etc.), but two of the most powerful and commonly used are:&lt;/p&gt;

&lt;p&gt;ON DELETE CASCADE&lt;/p&gt;

&lt;p&gt;ON UPDATE CASCADE&lt;/p&gt;

&lt;p&gt;See breakdown below.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ON DELETE CASCADE
This tells the database:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;“If a record in the parent table is deleted, automatically delete the related records in the child table.”&lt;/p&gt;

&lt;p&gt;Example Use Case:&lt;br&gt;
Imagine you have two tables: Users and Posts. Each post belongs to a user.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ON UPDATE CASCADE
This tells the database:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;“If the primary key of the parent table is updated, automatically update all corresponding foreign keys in the child table.”&lt;/p&gt;

&lt;p&gt;Why Update Primary Keys Though?&lt;br&gt;
Usually, primary keys don’t change. But in some systems where natural keys (like usernames or codes) are used as primary keys, updates can happen.&lt;/p&gt;

&lt;p&gt;In summary, ON DELETE and ON UPDATE CASCADE helps provide clean and consistent database. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Guide to SOLID Principles in Software Development</title>
      <dc:creator>Ebenezer Tosan</dc:creator>
      <pubDate>Tue, 25 Mar 2025 10:43:54 +0000</pubDate>
      <link>https://dev.to/ebenezer_tosan/a-guide-to-solid-principles-in-software-development-35ok</link>
      <guid>https://dev.to/ebenezer_tosan/a-guide-to-solid-principles-in-software-development-35ok</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is SOLID Principles?&lt;/strong&gt; &lt;br&gt;
SOLID is a set of five design principles that improve software maintainability, scalability, and flexibility. These principles help developers write clean, robust, and scalable code.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Single Responsibility Principle (SRP)
&lt;/h2&gt;

&lt;p&gt;A class should have only one reason to change.&lt;br&gt;
Each class should focus on a single responsibility. If a class is handling multiple concerns, it's harder to maintain and modify.&lt;/p&gt;

&lt;p&gt;✅ Example: A User class should handle only user-related logic, while a UserRepository class should manage database operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Open/Closed Principle (OCP)
&lt;/h2&gt;

&lt;p&gt;Software entities should be open for extension but closed for modification.&lt;br&gt;
Instead of modifying existing code, extend it through inheritance or interfaces.&lt;/p&gt;

&lt;p&gt;✅ Example: Use polymorphism to add new functionality without altering existing code.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Liskov Substitution Principle (LSP)
&lt;/h2&gt;

&lt;p&gt;Objects of a superclass should be replaceable with objects of a subclass without breaking the system.&lt;br&gt;
A subclass should enhance, not alter, the expected behavior of the parent class.&lt;/p&gt;

&lt;p&gt;✅ Example: If Rectangle is a parent class and Square is a subclass, overriding width or height independently should not break calculations.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Interface Segregation Principle (ISP)
&lt;/h2&gt;

&lt;p&gt;A class should not be forced to implement interfaces it doesn’t use.&lt;br&gt;
Instead of one large interface, create smaller, more specific ones.&lt;/p&gt;

&lt;p&gt;✅ Example: Instead of a MultifunctionPrinter interface with Print(), Scan(), and Fax(), split it into separate IPrinter, IScanner, and IFax interfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Dependency Inversion Principle (DIP)
&lt;/h2&gt;

&lt;p&gt;High-level modules should not depend on low-level modules. Both should depend on abstractions.&lt;br&gt;
Use dependency injection to decouple components.&lt;/p&gt;

&lt;p&gt;✅ Example: Instead of a Service class directly instantiating a Database, inject an IDatabase interface that different database implementations can follow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why SOLID Matters?
&lt;/h2&gt;

&lt;p&gt;Makes code easier to maintain and extend&lt;/p&gt;

&lt;p&gt;Reduces bugs and improves testability&lt;/p&gt;

&lt;p&gt;Enhances collaboration in large teams&lt;/p&gt;

&lt;p&gt;By applying SOLID, you’ll write cleaner, more efficient, and scalable software. Which of these principles do you struggle with the most? Let’s discuss in the comments!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding SQL Triggers: A Developer’s Guide</title>
      <dc:creator>Ebenezer Tosan</dc:creator>
      <pubDate>Mon, 24 Feb 2025 14:27:29 +0000</pubDate>
      <link>https://dev.to/ebenezer_tosan/understanding-sql-triggers-a-developers-guide-47b4</link>
      <guid>https://dev.to/ebenezer_tosan/understanding-sql-triggers-a-developers-guide-47b4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;SQL Triggers are a powerful feature in relational databases that allow you to automatically execute a set of SQL statements in response to specific database events. Triggers help maintain data integrity, enforce business rules, and automate tasks without requiring manual intervention.&lt;/p&gt;

&lt;p&gt;In this article, we’ll explore what SQL Triggers are, their types, and how to implement them with practical examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are SQL Triggers?
&lt;/h2&gt;

&lt;p&gt;A trigger is a special type of stored procedure that is automatically executed before or after specific database operations such as INSERT, UPDATE, or DELETE. Triggers are useful for enforcing constraints, auditing changes, and performing automatic updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Characteristics of SQL Triggers&lt;/strong&gt;&lt;br&gt;
Automatically invoked when a defined event occurs.&lt;br&gt;
Can be applied to INSERT, UPDATE, and DELETE operations.&lt;br&gt;
Help in enforcing business rules and maintaining data consistency.&lt;br&gt;
Cannot be explicitly called like stored procedures.&lt;/p&gt;
&lt;h2&gt;
  
  
  Types of SQL Triggers
&lt;/h2&gt;

&lt;p&gt;SQL triggers can be categorized based on when they are executed and what event they respond to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Based on Execution Timing&lt;/strong&gt;&lt;br&gt;
BEFORE Trigger: Executes before the event occurs. Useful for validation.&lt;br&gt;
AFTER Trigger: Executes after the event occurs. Commonly used for logging and auditing.&lt;br&gt;
INSTEAD OF Trigger: Replaces the execution of the triggering event. Often used for complex views.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Based on Triggering Event&lt;/strong&gt;&lt;br&gt;
INSERT Trigger: Fires when a new row is inserted into the table.&lt;br&gt;
UPDATE Trigger: Fires when an existing row is updated.&lt;br&gt;
DELETE Trigger: Fires when a row is deleted from the table.&lt;/p&gt;
&lt;h2&gt;
  
  
  Implementing SQL Triggers
&lt;/h2&gt;

&lt;p&gt;Let's walk through some examples using PostgreSQL and SQL Server to understand how triggers work in real-world applications.&lt;/p&gt;

&lt;p&gt;Example 1: Creating an Audit Log Using an AFTER INSERT Trigger&lt;br&gt;
Let's say we have a users table, and we want to log all new user registrations into an audit_log table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PostgreSQL Example&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    username VARCHAR(100),
    email VARCHAR(150),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE audit_log (
    log_id SERIAL PRIMARY KEY,
    action TEXT,
    username VARCHAR(100),
    log_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE OR REPLACE FUNCTION log_user_insert() 
RETURNS TRIGGER AS $$
BEGIN
    INSERT INTO audit_log (action, username, log_time)
    VALUES ('User Inserted', NEW.username, NOW());
    RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER user_insert_trigger
AFTER INSERT ON users
FOR EACH ROW
EXECUTE FUNCTION log_user_insert();`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;📌 How It Works:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The function log_user_insert() inserts an entry into audit_log when a new user is added.&lt;br&gt;
The trigger user_insert_trigger calls this function after an INSERT operation on users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to Use SQL Triggers?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ Use SQL triggers when:&lt;/p&gt;

&lt;p&gt;You need automatic auditing of database changes.&lt;br&gt;
You want to enforce business rules at the database level.&lt;br&gt;
You need to maintain data integrity across multiple tables.&lt;br&gt;
❌ Avoid SQL triggers when:&lt;/p&gt;

&lt;p&gt;The logic can be implemented at the application level for better performance.&lt;br&gt;
They introduce hidden complexity, making debugging harder.&lt;br&gt;
They cause performance issues due to excessive execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;SQL triggers are a powerful tool that can help automate database tasks, enforce data integrity, and maintain logs of changes. However, they should be used wisely to avoid performance bottlenecks.&lt;/p&gt;

&lt;p&gt;Are you using SQL triggers in your projects? Share your thoughts in the comments! 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Materialized Views in SQL for Beginners</title>
      <dc:creator>Ebenezer Tosan</dc:creator>
      <pubDate>Mon, 17 Feb 2025 14:17:28 +0000</pubDate>
      <link>https://dev.to/ebenezer_tosan/introduction-to-materialized-views-in-sql-for-beginners-3ip3</link>
      <guid>https://dev.to/ebenezer_tosan/introduction-to-materialized-views-in-sql-for-beginners-3ip3</guid>
      <description>&lt;h2&gt;
  
  
  What is Materialized View?
&lt;/h2&gt;

&lt;p&gt;A Materialized View in SQL is a database object that contains the results of a query stored physically. Unlike a standard view, which is a virtual table, a materialized view stores the query results on disk, making data retrieval much faster, especially for complex queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use Materialized Views?
&lt;/h2&gt;

&lt;p&gt;Materialized views are useful in scenarios where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Query performance needs improvement by avoiding repeated complex calculations.&lt;/li&gt;
&lt;li&gt;Pre-computed aggregated data is required for reporting.&lt;/li&gt;
&lt;li&gt;Data needs to be refreshed periodically rather than recalculated on every request.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating a Materialized View
&lt;/h2&gt;

&lt;p&gt;The syntax for creating a materialized view varies by database system, but the general structure is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE MATERIALIZED VIEW view_name AS&lt;br&gt;
SELECT column1, column2, aggregate_function(column3)&lt;br&gt;
FROM table_name&lt;br&gt;
WHERE conditions;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Refreshing a Materialized View&lt;/strong&gt;&lt;br&gt;
Since the data is stored physically, it may become outdated. Most databases allow you to refresh a materialized view manually or automatically:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;REFRESH MATERIALIZED VIEW sales_summary;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note: Some databases also support incremental refresh for efficiency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages of Materialized Views&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performance Boost: Queries execute faster as precomputed data is stored.&lt;/li&gt;
&lt;li&gt;Reduced Load on Database: Less computation power is required for repeated queries.&lt;/li&gt;
&lt;li&gt;Supports Aggregated Data: Ideal for dashboards and analytical reporting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Storage Overhead: Requires additional space to store results.&lt;/li&gt;
&lt;li&gt;Needs to be Refreshed: Data can become stale and requires periodic updates.&lt;/li&gt;
&lt;li&gt;Not Always Real-Time: Unlike normal views, data is not dynamically updated.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When to Use Materialized Views
&lt;/h2&gt;

&lt;p&gt;Materialized views are best suited for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reporting and BI applications.&lt;/li&gt;
&lt;li&gt;Frequently accessed, computationally expensive queries.&lt;/li&gt;
&lt;li&gt;Pre aggregated data sets for faster analytics.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By understanding and implementing materialized views effectively, you can optimize database performance and enhance the efficiency of your SQL queries!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
