Skip to content

Instantly share code, notes, and snippets.

@pradeexsu
Created May 19, 2024 11:00
Show Gist options
  • Save pradeexsu/ddfa4215382bc340bc9fc3045518610a to your computer and use it in GitHub Desktop.
Save pradeexsu/ddfa4215382bc340bc9fc3045518610a to your computer and use it in GitHub Desktop.
Read Write Heavy

Read/Write Heavy System

Read Heavy

  • Caching Before read load on db or service.
    • Client side, server side.
  • Database Replication Increase ready only instance
  • Load Balancing Distribute read traffic across the resource.
  • Data partitioning Sharding
    • Parallel data retrieval and concurrency.
    • Decrease latency
  • Query Optimisation
    • Indexing (query specific indexing)
    • Frequently used query.
    • Use procedure to execute multiple statement in single query. ( it uses precompiled query, that executes faster)
SQL uses B+tree to manage indexing -->

Write Heavy System

Database Optimisation Column database like. Cassandra


Storage Solution

  1. Caching (Redis, and Memcached)
    • Ram based storage
    • (Redis)Single threaded,
    • High throughput (1-10Gbit/s), sub-milliseconds fast
      • PUB/SUB
      • Caching
  2. Wide Column DB Cassandra
    • No joins DB,
    • Denormalised data,
    • Decentralised
    • Supports write heavy query
    • Same as key value stores
    • Scheme-less

  1. Document DB/NoSql MongoDB, DynamoDB

    • Read heavy System
    • Collection based
  2. Relational DB MySQl, Postgres, CockroachDB

    • Relational Schema
    • ACID compliant

    Not every single NoSQL database is ACID-compliant, but many are. In fact, MongoDB is an ACID-compliant database

    CockroachDB is distributed SQL database, which is highly scalable. that can be scale horizontal with it's builtin support.

  3. Graph DB Neo4J

    • Used for recommendation system, and social connections
    • Connection is edge between nodes
  4. Search DB Elastic Search, Algolia

    • It uses precompiled indexing over tokens generated or data processed from datasource (database: Nosql, SQL. etc).
    • Use case: Search engine, Typeahead feature.
  5. Multi-modal GgraphQL

    • ACID Compliant
    • Flexible over query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment