StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Product

  • Stacks
  • Tools
  • Companies
  • Feed

Company

  • About
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2025 StackShare. All rights reserved.

API StatusChangelog
  1. Stackups
  2. Stackups
  3. LokiJS vs Redis

LokiJS vs Redis

OverviewComparisonAlternatives

Overview

Redis
Redis
Stacks60.7K
Followers46.5K
Votes3.9K
GitHub Stars42
Forks6
LokiJS
LokiJS
Stacks38
Followers57
Votes3
GitHub Stars6.8K
Forks483

LokiJS vs Redis: What are the differences?

Introduction: In this article, we will discuss the key differences between LokiJS and Redis, two popular databases used in web development. LokiJS is a lightweight JavaScript in-memory database that provides a document-oriented data model. On the other hand, Redis is an in-memory data structure store that can be used as a database, cache, and message broker. Now, let's explore the specific differences between these two databases.

  1. Data Persistence: LokiJS stores data in memory by default, which means that the data is lost once the application is closed or restarted. However, LokiJS also provides options to persist data to disk, allowing for data to be saved and loaded between application sessions. In contrast, Redis is designed for durable persistence and can save data to disk or replicate it across multiple nodes for data protection and high availability.

  2. Data Scalability: LokiJS is suitable for small to medium-sized applications with a limited amount of data. It is not designed for high-scale applications that require horizontal scaling. Redis, on the other hand, is highly scalable and can handle large amounts of data by distributing it across multiple nodes in a cluster. This makes Redis a preferred choice for applications with high data loads and heavy read and write traffic.

  3. Data Model: LokiJS provides a document-oriented data model similar to NoSQL databases like MongoDB. It allows for flexible and schema-less data structures, making it easy to store and manipulate complex data objects. Redis, on the other hand, provides a key-value data model where data is stored as a simple key-value pair. While Redis supports various data types like strings, hashes, lists, sets, and sorted sets, it does not support complex nested data structures like NoSQL databases.

  4. Data Querying: LokiJS provides a powerful querying engine that allows for complex queries using a MongoDB-inspired syntax. It supports various query operators and can efficiently search and filter data based on different criteria. Redis, on the other hand, does not provide a built-in query language. Instead, it relies on simple key-based operations like GET, SET, and DEL. To perform complex querying in Redis, additional tools or libraries need to be used.

  5. Data Replication: LokiJS does not have built-in support for data replication. If data needs to be replicated across multiple instances or nodes, it needs to be implemented manually. Redis, on the other hand, supports various replication modes like master-slave replication and cluster replication. This allows for automatic data synchronization between multiple instances, ensuring high availability and fault tolerance.

  6. Data Persistence Options: In terms of data persistence options, LokiJS provides the flexibility to choose between different persistence adapters like localStorage, indexedDB, and file system storage. This allows developers to select the most suitable option based on their application requirements and environment. Redis, on the other hand, provides a built-in persistence mechanism that can save data to disk in a compact and efficient manner.

In summary, LokiJS and Redis differ in terms of data persistence, scalability, data model, querying capabilities, data replication support, and data persistence options. While LokiJS is lightweight and suitable for small to medium-sized applications, Redis is highly scalable and designed for high-scale applications with complex data structures.

Detailed Comparison

Redis
Redis
LokiJS
LokiJS

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.

LokiJS is a document oriented database written in javascript, published under MIT License. Its purpose is to store javascript objects as documents in a nosql fashion and retrieve them with a similar mechanism. Runs in node (including cordova/phonegap and node-webkit), nativescript and the browser.

Statistics
GitHub Stars
42
GitHub Stars
6.8K
GitHub Forks
6
GitHub Forks
483
Stacks
60.7K
Stacks
38
Followers
46.5K
Followers
57
Votes
3.9K
Votes
3
Pros & Cons
Pros
  • 887
    Performance
  • 542
    Super fast
  • 514
    Ease of use
  • 444
    In-memory cache
  • 324
    Advanced key-value cache
Cons
  • 15
    Cannot query objects directly
  • 3
    No secondary indexes for non-numeric data types
  • 1
    No WAL
Pros
  • 3
    Can query the objects directly
Integrations
No integrations available
Node.js
Node.js
NativeScript
NativeScript
Apache Cordova
Apache Cordova
PhoneGap
PhoneGap

What are some alternatives to Redis, LokiJS?

Hazelcast

Hazelcast

With its various distributed data structures, distributed caching capabilities, elastic nature, memcache support, integration with Spring and Hibernate and more importantly with so many happy users, Hazelcast is feature-rich, enterprise-ready and developer-friendly in-memory data grid solution.

Aerospike

Aerospike

Aerospike is an open-source, modern database built from the ground up to push the limits of flash storage, processors and networks. It was designed to operate with predictable low latency at high throughput with uncompromising reliability – both high availability and ACID guarantees.

MemSQL

MemSQL

MemSQL converges transactions and analytics for sub-second data processing and reporting. Real-time businesses can build robust applications on a simple and scalable infrastructure that complements and extends existing data pipelines.

Apache Ignite

Apache Ignite

It is a memory-centric distributed database, caching, and processing platform for transactional, analytical, and streaming workloads delivering in-memory speeds at petabyte scale

SAP HANA

SAP HANA

It is an application that uses in-memory database technology that allows the processing of massive amounts of real-time data in a short time. The in-memory computing engine allows it to process data stored in RAM as opposed to reading it from a disk.

VoltDB

VoltDB

VoltDB is a fundamental redesign of the RDBMS that provides unparalleled performance and scalability on bare-metal, virtualized and cloud infrastructures. VoltDB is a modern in-memory architecture that supports both SQL + Java with data durability and fault tolerance.

Tarantool

Tarantool

It is designed to give you the flexibility, scalability, and performance that you want, as well as the reliability and manageability that you need in mission-critical applications

Azure Redis Cache

Azure Redis Cache

It perfectly complements Azure database services such as Cosmos DB. It provides a cost-effective solution to scale read and write throughput of your data tier. Store and share database query results, session states, static contents, and more using a common cache-aside pattern.

KeyDB

KeyDB

KeyDB is a fully open source database that aims to make use of all hardware resources. KeyDB makes it possible to breach boundaries often dictated by price and complexity.

BuntDB

BuntDB

BuntDB is a low-level, in-memory, key/value store in pure Go. It persists to disk, is ACID compliant, and uses locking for multiple readers and a single writer. It supports custom indexes and geospatial data. It's ideal for projects that need a dependable database and favor speed over data size.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase