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

PostGIS

381
377
+ 1
30
Redis

60.7K
46.4K
+ 1
3.9K
Add tool

PostGIS vs Redis: What are the differences?

Introduction

PostGIS and Redis are both open-source data storage technologies that are used in web development. However, there are several key differences between the two.

  1. Data Model: PostGIS is a spatial database extension for PostgreSQL, which means it focuses on storing geospatial data. It provides the ability to store and query spatial information such as points, lines, and polygons. On the other hand, Redis is an in-memory data structure store that can be used as a database, cache, or message broker. It does not have a specific data model but supports various data structures like strings, lists, sets, hashes, and more.

  2. Persistence: One major difference between PostGIS and Redis is their approach to data persistence. In PostGIS, data is persisted to disk, and even if the server goes down, the data remains intact. This makes it suitable for applications that require durability and reliability. However, in Redis, data is primarily stored in memory for high-performance operations but can be optionally saved to disk. If Redis crashes or restarts, the data in memory is lost unless it has been explicitly saved on disk.

  3. Scalability: When it comes to scalability, PostGIS and Redis have different approaches. PostGIS can handle large amounts of data and supports horizontal scaling by sharding the data across multiple servers. It also offers built-in support for replication and failover. In contrast, Redis is designed to be a single-threaded, in-memory store that excels at handling small to medium-sized datasets in a single server. It can be clustered to distribute data across multiple Redis instances, but it does not natively support sharding.

  4. Query Capabilities: PostGIS is specifically designed for spatial data and provides a rich set of functions and operators for querying and analyzing geospatial information. It supports various spatial operations like distance calculations, intersection checks, buffer creation, and more. Redis, on the other hand, does not have built-in spatial capabilities. While Redis supports indexing and querying based on string keys, it lacks the specialized spatial functions that are available in PostGIS.

  5. Concurrency and Locking: PostGIS is built on top of PostgreSQL, which has robust support for concurrency control and supports transactional operations. It provides features like row-level locking and multi-version concurrency control (MVCC) to ensure data consistency and integrity in a multi-user environment. Redis, on the other hand, is single-threaded and does not have built-in support for traditional ACID transactions. It uses optimistic locking for handling concurrent access but lacks some of the advanced concurrency control mechanisms provided by relational databases.

  6. Use Cases: Due to their different characteristics, PostGIS and Redis are often used in different use cases. PostGIS is particularly suited for applications that deal with geospatial data, such as mapping, location-based services, and geographic information systems. It provides advanced spatial capabilities and can handle large datasets with high reliability. On the other hand, Redis is commonly used in scenarios where high-performance data caching, real-time data streaming, and quick data retrieval are crucial. It is often employed in web applications to improve response times and handle high concurrent loads.

In summary, PostGIS is a spatial database extension focused on geospatial data persistence, querying, and analysis, with support for horizontal scaling and durability. Redis, on the other hand, is an in-memory data store that excels at caching, real-time data processing, and high-performance data retrieval but lacks specialized spatial capabilities and durability.

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

Sign up to add or upvote prosMake informed product decisions

Cons of PostGIS
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 PostGIS?

    PostGIS is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL.

    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!

    Jobs that mention PostGIS and Redis as a desired skillset
    LaunchDarkly
    Oakland, California, United States
    What companies use PostGIS?
    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 PostGIS?
    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
    4908
    Jun 6 2019 at 5:11PM

    AppSignal

    RedisRubyKafka+9
    16
    1794
    GitHubDockerReact+17
    42
    38382
    What are some alternatives to PostGIS and Redis?
    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.
    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.
    Elasticsearch
    Elasticsearch is a distributed, RESTful search and analytics engine capable of storing data and searching it in near real time. Elasticsearch, Kibana, Beats and Logstash are the Elastic Stack (sometimes called the ELK Stack).
    PostgreSQL
    PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions.
    ArcGIS
    It is a geographic information system for working with maps and geographic information. It is used for creating and using maps, compiling geographic data, analyzing mapped information, sharing and much more.
    See all alternatives