...

или внеочередные заметки


Previous Entry Share Next Entry
Jsonb has committed !
trekking, Himalaya
obartunov
Great news: PostgreSQL introduced jsonb support, which is real data type with binary storage and indexing !

This work is a confluence of two projects - our hstore and json, which were existed in PostgreSQL for years in somewhat incomplete forms - hstore (10 years old!) implements key-value storage with binary storage and indexing, while json - document storage implemented as a text. I and Teodor Sigaev have started working on nested hstore more than year ago with support of Engine Yard and got working prototype with everything document-oriented storage needed (see our presentations in Ottawa, 2013, Dublin, 2013, http://www.sai.msu.su/~megera/postgres/talks/), which eventually happens to be binary storage for jsonb - a new data type, introduced by Andrew Dunstan, which has everything from json, but performs better, thanks to binary representation and indexing ! jsonb doesn't preserve an order of keys and keys are unique ( the last win). Later, we decided to leave hstore unchanged and moved all nesting stuff (binary storage and indexing) to PostgreSQL core in favor to jsonb, which is now is a diamond in the crown of PostgreSQL 9.4. Peter Geoghegan has joined the project and did the last push to the jsonb, which was great, since we were already tired and get bored with long and killimg work. Andrew forgot to say, that Alexander Korotkov introduced an elegant hash opclass for GIN, which competes with MongoDB performance in contains operator (see our presentation in Dublin). Also, I'd mention David Wheeler, who supported us in nested hstore project, Josh Berkus, who actually was a jsonb driver and shaked me and Teodor in the middle of russian long NY holidays. Andres Freund criticized the code, which is very necessary in such a complex project.

Jsonb has several missing useful features (from nested hstore), but that could be added later as an extension.

I hope all database people understand, what that project mean for PostgreSQL - 99.9% percent of projects don't need MongoDB and could be nicely implemented in relational model. Now, PostgreSQL (AFAIK, the first considerable RDBMS) introduced the real support for semi-structured data, which are common in nowaday world.

For historical reason, we saved our nested hstore (hstore v2.0) in separate repository (http://www.sigaev.ru/git/gitweb.cgi?p=hstore.git;a=summary).

PS.

I, Teodor and Alexander are working on better jsonb indexing. Hope, we'll have something to show at PGCon in Ottawa this year, stay tuned !

This is a screenshot of my message to Teodor Sigaev, which starts our nested hstore project.

Screen Shot 2014-03-24 at 16.06.56
Tags: , ,

I believe that this is one of the most significant breakthroughs in Postgres history. Congratulations.

"...jsonb, which is now is a diamond in the crown of PostgreSQL 9.4..." - very good news!

That's great, can't wait to listen about this at the upcoming conference!

Does this mean we can store numeric values in hstore?

No, we decided not to touch hstore and concentrate on json. Eventually, hstore users will move to json.

It really depends on what "considerable" means...

domusonline

2014-03-24 11:34 pm (UTC)

... but Informix implemented JSON/BSON compatible with MongoDB API and sharding last year (12.10.xC2)
Regards.

fantastic works guys..

This is great news, Thanks so much!

You are viewing obartunov