Sunday, April 5, 2026

Databases Explained & Use Cases with (Flash Card) | Overview.


Databases Explained & Use Cases (
Flash Cards) - Overview.

  • A database is a structured collection of digital information designed for:
    • Efficient storage, 
    • Retrieval, 
    • Management. 
  • While a simple spreadsheet might work for small tasks, databases are engineered to handle vast amounts of data and complex interactions through a Database Management System (DBMS), which acts as the interface between the user and the data.
Types of Databases
Databases are generally categorized by how they organize data and the flexibility of their structure.
    • Relational (SQL): Data is stored in fixed tables with rows and columns
    • These databases prioritize consistency and use Structured Query Language (SQL) for complex operations. 
      • Examples include:
        •  MySQL, 
        • PostgreSQL
        • SQL Server.
    • Non-Relational (NoSQL): These offer flexible formats like:
      • documents, 
      • key-value pairs, 
      • graphs. 
    • They are built for high scalability and can handle unstructured data like:
      •  social media posts
      •  sensor readings. 
        • Examples include:
          •  MongoDB 
          • DynamoDB.
  • Specialized Databases:
      • Graph Databases: Optimized for mapping relationships between entities, like social networks.
      • In-Memory Databases: Store data in a computer's RAM for ultra-fast access, often used for real-time analytics.
      • Time Series Databases: Designed to track data that changes over time, such as stock prices or weather data.
Core Use Cases
Databases power nearly every modern digital service across various industries.
E-commerce: Tracking inventory, managing customer profiles, and processing secure payments.
Finance and Banking: Recording transactions with high accuracy and maintaining account balances where data integrity is critical.
Social Media: Storing user profiles, managing complex friend/follower networks, and delivering real-time feeds.
Healthcare: Managing patient records, prescriptions, and appointment schedules while ensuring strict security and compliance.
Content Management: Storing and organizing digital assets like articles, images, and videos for websites.
IoT and Real-Time Analytics: Handling continuous streams of data from smart devices for immediate analysis.
Key Benefits
Using a database instead of manual file storage provides several technical advantages.
    • Data Integrity: Ensures that information remains accurate and consistent through built-in rules and constraints.
    • Scalability: Systems can grow to handle millions of users and petabytes of data.
    • Security: Controls who can view or edit specific pieces of information through advanced user access management.
    • Efficient Search: Allows for rapid retrieval of specific data points even within massive datasets.


Relational Database (RDB) Flash Cards:





In-Memory Flash Cards





Key-Value Databases Flash Cards





Documentation Databases




Graph Databases


Wide-Column DB Flash Cards




Time-Series DB Flash Cards





Text-Search DB Flash Cards




Spatial Databases Flash Cards




Blob Storage Flash Cards




Key takeaway:
  • There is nothing like the best database.
  • Database type need to be carefully selected and created to fit the role it need to perform.


Tuesday, January 27, 2026

Amazon EventBridge | Overview.


Amazon EventBridge - Overview.

Scope:

  • Intro,
  • Core Concepts,
  • Key Benefits,
  • Link to official documentation,
  • What EventBridge Really Is (Deep Dive),

  • Core Architecture Components,
  • Best Practice,
  • Event Flow (End-to-End),

  • Advanced Features (Where EventBridge Shines),
  • Reliability, Limits & Guarantees,
  • EventBridge vs Alternatives,
  • Security & IAM Model,
  • Cost Model (Simple & Predictable)
  • When NOT to Use EventBridge (twtech Avoids it if it needs),
  • Insights.
Intro:

    • Amazon EventBridge is a serverless event bus service that enables twtech to build event-driven applications at scale using events from its applications, third-party software as a service (SaaS) applications, and other AWS services
    • Amazon EventBridge provides a simple, consistent way to ingest, filter, transform, and deliver events to various targets for processing. 
Core Concepts
    • Events: An event signifies a change in an environment or system, such as an object being added to an Amazon S3 bucket or a change in an EC2 instance's state.
    • Event Buses: Event buses act as routers that receive events and deliver them to specified targets.
    • Rules: Rules define what EventBridge does with the events delivered to an event bus. There are two types:
      • Event Patterns: Rules that match specific data patterns within an event's structure.
      • Schedules: Rules that run on a predefined schedule (e.g., using cron expressions) to invoke targets at specific times.
    • Targets: When an event matches a rule, EventBridge sends the event's JSON message to one or more designated targets, such as AWS Lambda functions, Amazon SNS topics, Amazon SQS queues, or API destinations.
Key Benefits
    • Decoupling: EventBridge allows for the decoupling of application components, making the system more resilient and easier to maintain.
    • Integration: It simplifies integration with a wide array of AWS services and SaaS partners without requiring custom code.
    • Scalability and Reliability: The service is designed for low-latency, high-throughput event processing and offers high reliability for event delivery.
    • Content-Based Filtering: It supports precise filtering using comparison operators and ranges of values within the event data, reducing the need for downstream custom filtering logic. 
Link to official documentation:
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html

1. What EventBridge Really Is  

Amazon EventBridge is a serverless event bus that enables event-driven architectures by routing events from producers to consumers using rules.

Think of it as:

A smart event router with schema awareness and SaaS integrations

It evolved from CloudWatch Events, but now supports:

    • Multiple event buses
    • Cross-account routing
    • Schema registry
    • SaaS event sources (e.g., Salesforce, Zendesk)
    • Fine-grained filtering & transformations

2. Core Architecture Components

 Event Sources (Where events originate from).

Types:

    • AWS Services
      • EC2, S3, Lambda, ECS, Step Functions, CodePipeline, etc.
    • Custom Applications
      • Via PutEvents API
    • SaaS Partners
      • Stripe, Auth0, Datadog, PagerDuty, etc.

NB:

Each event is a JSON document.

 Event Bus

A logical container for events.

Three types:

  1. Default Event Bus

    • Automatically receives AWS service events

  2. Custom Event Bus

    • For application-specific or domain-driven architectures

  3. Partner Event Bus

    • Dedicated to SaaS integrations

 Best Practice:

    • Use one event bus per domain (e.g., orders-bus, billing-bus)

 Events (Structure)

  • An EventBridge event has a predictable shape:

{ "source": "aws.ec2", "detail-type": "EC2 Instance State-change Notification", "time": "2026-01-27T10:15:30Z", "region": "us-east-2", "resources": [], "detail": { "instance-id": "i-1234567890", "state": "running" } }

Key fields:

    • source Who emitted the event
    • detail-type What kind of event it is
    • detail The payload you actually care about

 Rules

    • Rules decide which events go where.

Each rule has:

    • Event pattern (filter)
    • Target(s)

Event Pattern Sample

{ "source": ["aws.ec2"], "detail": { "state": ["stopped"] } }

NB:

✔ Only matches EC2 stop events

✘ No code needed

 Targets

    • Where matched events are delivered.

Common targets:

    • AWS Lambda
    • Step Functions
    • SNS / SQS
    • Kinesis Data Streams
    • ECS tasks
    • API Destinations (HTTP endpoints)

NB:

    • 🎯 One rule multiple targets allowed

3. Event Flow (End-to-End)

Event Source
Event Bus
Event Rule (Pattern Matching)
Target(s)

Key characteristics:

    • Push-based (no polling)
    • Fully managed
    • Near real-time (typically milliseconds)

4. Advanced Features (Where EventBridge Shines)

Schema Registry

    • Automatically discovers event schemas
    • Generates code bindings (Java, Python, TS)
    • Helps teams avoid breaking changes

NB:

    • 💡 Great for large orgs with multiple producers/consumers

 Event Transformations (Modify events without Lambda Sample):

{ "instanceId": "$.detail.instance-id", "state": "$.detail.state" }

This approach Reduces:

    • Lambda glue code
    • Cost
    • Latency

 Cross-Account Event Routing

  • EventBridge supports resource-based policies.

Use cases:

    • Centralized monitoring account
    • Security event aggregation
    • Multi-account microservices

 Archive & Replay

    • Store events for debugging or backfills
    • Replay historical events to rules
This is for:

    • Disaster recovery
    • Reprocessing failed logic
    • Auditing

5. Reliability, Limits & Guarantees

Delivery Guarantees

    • At-least-once delivery
    • Possible duplicates consumers must be idempotent

Retry & DLQ

    • Automatic retries
    • Dead-letter queues (SQS or SNS)

Quotas (High level)

    • 10,000 rules per bus (soft limit)
    • Event size 256 KB
    • ~100K events/sec per bus (region-dependent)

6. EventBridge vs Alternatives

Service
Best For
EventBridge
           Event routing, SaaS integration, decoupling
SNS
           Fan-out notifications
SQS
           Durable message queues
Kinesis
           High-throughput streaming
Kafka 
            Complex streaming & ordering

NB:

    •  EventBridge is not a stream processor
    •  It’s an event router & integration layer

7. Common Design Patterns

 Event-Driven Microservices

    • Producers emit domain events
    • Consumers subscribe independently
    • Zero coupling

 Automation & Ops

    • React to AWS service events
    • Trigger remediation workflows

 SaaS Integration

    • Receive third-party events
    • Route internally without custom polling

 Choreography (vs Orchestration)

    • EventBridge for loose coupling
    • Step Functions when control flow matters

8. Security & IAM Model

    • IAM controls PutEvents
    • Resource policies control cross-account access
    • Targets assume execution roles

🔐 Always:

    • Restrict PutEvents
    • Validate event source
    • Use least privilege

9. Cost Model (Simple & Predictable)

    • Charged per event published
    • Free tier included
    • No charge for rules or targets

NB:

    • 💡 Cheaper than Lambda glue for routing logic

10. When NOT to Use EventBridge (twtech Avoids it if it needs):

    • Strict ordering
    • Exactly-once delivery
    • Massive streaming analytics
    • Stateful processing
twtech-Insights:








Databases Explained & Use Cases with (Flash Card) | Overview.

Databases Explained  & Use Cases ( Flash Cards)   - Overview. A database is a structured collection of digital information designed f...