Need advice about which tool to choose?Ask the StackShare community!

IndexedDB

33
97
+ 1
0
Redis

59.5K
45.7K
+ 1
3.9K
Add tool

IndexedDB vs Redis: What are the differences?

Key Differences between IndexedDB and Redis

IndexedDB and Redis are both popular database systems used in web development. While they share some similarities, they also have significant differences that set them apart. This article will highlight the key differences between IndexedDB and Redis.

  1. Data Model: IndexedDB is an object-oriented database that stores data in structured objects, which can be accessed using JavaScript's IndexedDB API. On the other hand, Redis is a key-value store where data is stored as a collection of key-value pairs, and values can be of different types like strings, lists, sets, etc.

  2. Persistence: IndexedDB provides persistent storage, meaning the data remains saved even after the browser is closed or the system restarts. Redis also offers persistence, but it provides different levels of persistence options such as snapshots, append-only files, or both.

  3. Scalability: Redis is known for its excellent scalability and performance. It can handle millions of operations per second and is often used in high-traffic applications. IndexedDB, while suitable for storing smaller amounts of data, may not perform as well when dealing with a large number of records or heavy workloads.

  4. Data Manipulation: IndexedDB provides a powerful querying mechanism that allows for complex data manipulation operations, including indexing, filtering, and sorting. Redis, on the other hand, offers limited data manipulation capabilities. It primarily focuses on data retrieval and storage operations.

  5. Replication and Clustering: Redis comes with built-in support for replication and clustering, allowing for high availability and fault tolerance. It can replicate data across multiple nodes and distribute the workload efficiently. IndexedDB, in contrast, does not offer native replication or clustering features.

  6. Data Expiry: Redis provides options for setting an expiration time on keys, allowing data to expire automatically after a certain period. This feature is useful for implementing caching and managing temporary data. IndexedDB does not have built-in support for automatic data expiry.

In summary, IndexedDB and Redis differ in their data models, persistence, scalability, data manipulation capabilities, support for replication and clustering, and data expiry options. These differences make them suitable for different use cases and scenarios in web development.

Advice on IndexedDB and Redis
Needs advice
on
IndexedDBIndexedDBMongoDBMongoDB
and
PostgreSQLPostgreSQL

I'm currently developing an app that ranks trending stuff ( such as games, memes or movies, etc. ) or events in a particular country or region. Here are the specs: My app does not require registration and requires cookies and localStorage to track users. Users can add new entries to each trending category provided that their country of origin is recorded in cookies. If each category contains more than 100 items then the oldest items get deleted. The question is: what kind of database should I use for managing this app? Thanks in advance

See more
Replies (1)
Recommends
on
MongoDBMongoDB

I think your best and cheapest choice is going to be MongoDB, Although Postgres is probably going to be the more scaleable approach, you likely have a good idea of how you want to present your data, and the app seems small enough that you shouldn't need to worry about scaling issues. It also sounds like your app can grow in a linear capacity based on the number of users, and the amount of data, which is the perfect use-case for noSQL databases (linear, predictable scaling).

Correct me if I have any of these assumptions wrong. 1. You're looking to have a relatively high-read with a lower write volume 2. Your app is essentially a list of objects that can belong to a category 3. users can create objects in this list.

I think Mongo is going to be what you're looking for on the following basis: 1. you absolutely need a database that is shared by all users of your app, therefor IndexedDB is out of the question. 2. You have semi-structured data 3. you probably want the cheapest solution.

I think Postgres is wrong for the following reasons: 1. your app is pretty simple in concept, SQL databases will add unnecessary complexity to your system, either through ORMs or SQL queries. (use an ORM if you go with SQL) 2. Hosting SQL databases for production is not cheap! the cheapest solution I know of for Postgres is ElephantSQL. It provides 20MB for free with 5 concurrent connections, you should be okay to manage these limitations if you decide to go Postgres in the end. Whereas mongoDB Atlas has some great free-tier options.

Although your data might be easier to model in Postgres, you can certainly model your data as a single list of items that have a category attached.

I don't want to officially recommend another tool, but you should really checkout prisma, firebase, amplify, or Azure App Services for this app! Just go completely backend-less [Firebase] https://firebase.google.com/ [Amplify] https://aws.amazon.com/amplify/ [Prisma] https://www.prisma.io/ [Azure App Services] https://azure.microsoft.com/en-us/services/app-service/?v=18.51

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of IndexedDB
Pros of Redis
    Be the first to leave a pro
    • 886
      Performance
    • 542
      Super fast
    • 513
      Ease of use
    • 444
      In-memory cache
    • 324
      Advanced key-value cache
    • 194
      Open source
    • 182
      Easy to deploy
    • 164
      Stable
    • 155
      Free
    • 121
      Fast
    • 42
      High-Performance
    • 40
      High Availability
    • 35
      Data Structures
    • 32
      Very Scalable
    • 24
      Replication
    • 22
      Great community
    • 22
      Pub/Sub
    • 19
      "NoSQL" key-value data store
    • 16
      Hashes
    • 13
      Sets
    • 11
      Sorted Sets
    • 10
      NoSQL
    • 10
      Lists
    • 9
      Async replication
    • 9
      BSD licensed
    • 8
      Bitmaps
    • 8
      Integrates super easy with Sidekiq for Rails background
    • 7
      Keys with a limited time-to-live
    • 7
      Open Source
    • 6
      Lua scripting
    • 6
      Strings
    • 5
      Awesomeness for Free
    • 5
      Hyperloglogs
    • 4
      Transactions
    • 4
      Outstanding performance
    • 4
      Runs server side LUA
    • 4
      LRU eviction of keys
    • 4
      Feature Rich
    • 4
      Written in ANSI C
    • 4
      Networked
    • 3
      Data structure server
    • 3
      Performance & ease of use
    • 2
      Dont save data if no subscribers are found
    • 2
      Automatic failover
    • 2
      Easy to use
    • 2
      Temporarily kept on disk
    • 2
      Scalable
    • 2
      Existing Laravel Integration
    • 2
      Channels concept
    • 2
      Object [key/value] size each 500 MB
    • 2
      Simple

    Sign up to add or upvote prosMake informed product decisions

    Cons of IndexedDB
    Cons of Redis
      Be the first to leave a con
      • 15
        Cannot query objects directly
      • 3
        No secondary indexes for non-numeric data types
      • 1
        No WAL

      Sign up to add or upvote consMake informed product decisions

      What is IndexedDB?

      This API uses indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data.

      What is Redis?

      Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.

      Need advice about which tool to choose?Ask the StackShare community!

      What companies use IndexedDB?
      What companies use Redis?
      Manage your open source components, licenses, and vulnerabilities
      Learn More

      Sign up to get full access to all the companiesMake informed product decisions

      What tools integrate with IndexedDB?
      What tools integrate with Redis?

      Sign up to get full access to all the tool integrationsMake informed product decisions

      Blog Posts

      Nov 20 2019 at 3:38AM

      OneSignal

      PostgreSQLRedisRuby+8
      9
      4732
      Jun 6 2019 at 5:11PM

      AppSignal

      RedisRubyKafka+9
      15
      1704
      GitHubDockerReact+17
      41
      37367
      What are some alternatives to IndexedDB and Redis?
      SQLite
      SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.
      Pouchdb
      PouchDB enables applications to store data locally while offline, then synchronize it with CouchDB and compatible servers when the application is back online, keeping the user's data in sync no matter where they next login.
      MongoDB
      MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding.
      CouchDB
      Apache CouchDB is a database that uses JSON for documents, JavaScript for MapReduce indexes, and regular HTTP for its API. CouchDB is a database that completely embraces the web. Store your data with JSON documents. Access your documents and query your indexes with your web browser, via HTTP. Index, combine, and transform your documents with JavaScript.
      MySQL
      The MySQL software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
      See all alternatives