DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Big Data
  4. Geospatial Data: Apache Spark vs. PostGIS

Geospatial Data: Apache Spark vs. PostGIS

We take a look at how the big data tool Apache Spark stacks up against the geospatial tool PostGIS when it comes to handling big data sets.

Abdelghani Tassi user avatar by
Abdelghani Tassi
·
Jan. 04, 19 · Analysis
Like (3)
Save
Tweet
Share
12.74K Views

Join the DZone community and get the full member experience.

Join For Free

In my company, we've had a heated debate about geospatial data processing between old school conservative SQL fans and progressive big data and NoSQL fans.

Data Querying (MongoDB vs. PostGIS)

This section provides an overview of PostGIS and Mongodb, and their geospatial capabilities.


Mongodb Postgis
Spark drivers spark:mongo spark:jdbc
Scalability
  • Incoming data stream can potentially grow without limit.
  • Can scale easily.
  • Difficult to scale.
  • PG10 ?
Response time
  • Slightly faster at returning entire data sets.
  • Integrated caching system.
  • Faster when it comes to geospatial queries (by bounding box for example).
Geospatial index and Geoqueries
  • Bounding box geospatial queries seem to work well but UTM CRS is not supported (should convert data to mercator).
  • Supports only geojson formats.
  • Supported queries ($geoNear, $geoWithin, $geoIntersects).
  • Provides much more sophisticated spatial analytic capabilities.
  • Supports all geometry formats.
  • Supports all CRSs.

Spark vs. PostGIS (Performance)

The purpose of this section is to compare the performance Spark and PostGIS with respect to different data analyses (max, avg, geospatial:within, etc.).

For PostGIS tests, the data is already preprocessed and indexed geospatially, while Spark will use directly raw data (parquet, csv, shape, etc.).

As the data size grows, Spark's response time remains stable while PostGIS's response time grows exponentially.

Max KPI:

Image title

Mean KPI:

Image title

KPIs Within a Bounding Box:

Image title

Big data PostGIS Apache Spark

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • API Design Patterns Review
  • How To Check Docker Images for Vulnerabilities
  • How Observability Is Redefining Developer Roles
  • What Is a Kubernetes CI/CD Pipeline?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: