EDB White Paper Using The NoSQL Features in Postgres PDF
EDB White Paper Using The NoSQL Features in Postgres PDF
Postgres
An EnterpriseDB
White Paper
Table of Contents
Why NoSQL? 3
Document Database-JSON 4
About EnterpriseDB 17
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 2
Using the NoSQL Capabilities in Postgres
Why NoSQL?
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 3
Using the NoSQL Capabilities in Postgres
more feature rich over the past 15 years, that original design hurdle
has turned into a unique advantage. The fact that Postgres is an
object-relational database means new capabilities can be developed
and plugged into the database as needs evolve.
Postgres offers robust support for JSON. Postgres has a JSON data
type, which validates and stores JSON data and provides functions for
extracting elements from JSON values. And, it offers the ability to
easily encode query result sets using JSON. This last piece of
functionality is particularly important, as it means that applications that
prefer to work natively with JSON can easily obtain their data from
Postgres in JSON.
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 4
Using the NoSQL Capabilities in Postgres
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 5
Using the NoSQL Capabilities in Postgres
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 6
Using the NoSQL Capabilities in Postgres
data
--------------------------------------------------
----------
{"name": "Apple Phone", "type": "phone", "brand":
"ACME", "price": 200, "available": true,
"warranty_years": 1}
(1 row)
iphone_price
--------------
200
(1 row)
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 7
Using the NoSQL Capabilities in Postgres
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 8
Using the NoSQL Capabilities in Postgres
data
--------------------------------------------------
"cost"=>"500", "product"=>"iphone",
"provider"=>"Apple"
(1 row)
Convert HSTORE data to JSON
SELECT hstore_to_json(data) FROM hstore_data ;
hstore_to_json
----------------------------------------------------
-------
{"cost": "500", "product": "iphone", "provider":
"Apple"}
(1 row)
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 9
Using the NoSQL Capabilities in Postgres
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 10
Using the NoSQL Capabilities in Postgres
• The tag
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 11
Using the NoSQL Capabilities in Postgres
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 12
Using the NoSQL Capabilities in Postgres
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 13
Using the NoSQL Capabilities in Postgres
Postgres can create a bridge between ANSI SQL and JSON, for
example by making a ANSI SQL table look like a JSON data set. This
capability allows developers and DBAs to start with an unstructured
data set, and as the project progresses, adjust the balance between
structured and unstructured data.
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 14
Using the NoSQL Capabilities in Postgres
The initial set of tests compared MongoDB v2.6 to Postgres v9.4 beta,
on single instances. Both systems were installed on Amazon Web
Services M3.2XLARGE instances with 32GB of memory.
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 15
Using the NoSQL Capabilities in Postgres
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 16
Using the NoSQL Capabilities in Postgres
SQL databases like Postgres have added features to fill the gap that
motivated the rise and development of NoSQL-only technologies, and
will continue to provide capabilities that NoSQL-only technologies
simply cannot. Users of NoSQL-only technologies are finding they still
need relational and transactional capabilities when working with
unstructured data and seeking ways to combine data within a single,
enterprise-grade environment.
Get Started Today. Let EnterpriseDB help you build and execute your
game plan. Contact us at +1-877-377-4352 or +1-781-357-3390, or
send an email to [email protected] to get started today on your
path to database independence.
About EnterpriseDB
EntepriseDB is the only worldwide provider of enterprise-class
products and services based on PostgreSQL, the worlds most
advanced and independent open source database.
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 17
Using the NoSQL Capabilities in Postgres
20140815
© 2015 EnterpriseDB Corporation. All rights reserved. EnterpriseDB and Postgres Plus are trademarks
of EnterpriseDB Corporation. Other names may be trademarks of their respective owners.
http://www.enterprisedb.com
Page: 18