Postgre SQL as a Document Storage for NET

  • Slides: 20
Download presentation
Postgre. SQL as a Document Storage for. NET applications Konstantin Proskurdin Adver-Online k. proskurdin@gmail.

Postgre. SQL as a Document Storage for. NET applications Konstantin Proskurdin Adver-Online k. proskurdin@gmail. com

Sponsors

Sponsors

#sqlsatdnipro

#sqlsatdnipro

Bio § § § Web Developer 10 years of experience in IT 9 years

Bio § § § Web Developer 10 years of experience in IT 9 years of DB experience 8 years of web experience MSPD

Agenda § § Structured/Semi Structured data Document-oriented databases Postgre. SQL Marten

Agenda § § Structured/Semi Structured data Document-oriented databases Postgre. SQL Marten

Structured Data § § § Data model explicitly determines the structure of data Schema

Structured Data § § § Data model explicitly determines the structure of data Schema is fixed Easy to visualize A lot of Math Ready-made query language, SQL

Semi-structured Data § § § Self-describing structure The schema can easily be changed Helps

Semi-structured Data § § § Self-describing structure The schema can easily be changed Helps to not worry about object-relational impedance mismatch Support for nested or hierarchical data Support for lists of objects Can represent the information of some data sources that cannot be constrained by schema § Flexible format for data exchange between different types of databases

Semi-structured Data Usage § § Document storage Data exchange (Json, XML) Shared data storage

Semi-structured Data Usage § § Document storage Data exchange (Json, XML) Shared data storage …

Document Storage § § § Mongo. DB Caché Document. DB Raven. DB Postgre. SQL

Document Storage § § § Mongo. DB Caché Document. DB Raven. DB Postgre. SQL

Postgre. SQL § § Hstore JSON HStore 2 JSONB

Postgre. SQL § § Hstore JSON HStore 2 JSONB

JSON vs JSONB § § § JSON: textual storage “as is” JSONB: no whitespaces

JSON vs JSONB § § § JSON: textual storage “as is” JSONB: no whitespaces JSONB: no duplicate keys, last key wins JSONB: keys are sorted JSONB: indexes could be used

JSON(B) Operators § § § -> Get JSON object field by key ->> Get

JSON(B) Operators § § § -> Get JSON object field by key ->> Get JSON object field as text #> Get JSON object at specified path #>> Get JSON object at specified path as text @> Does the left JSON value contain the right JSON

Sample object

Sample object

JSONB Demo

JSONB Demo

JSONB Indexes § Expression Indexes § GIN Indexes

JSONB Indexes § Expression Indexes § GIN Indexes

JSONB Indexes Demo

JSONB Indexes Demo

Marten https: //jasperfx. github. io/marten/

Marten https: //jasperfx. github. io/marten/

Demo

Demo

Summary § § Structured/Semi Structured data Document-oriented databases Postgre. SQL Marten

Summary § § Structured/Semi Structured data Document-oriented databases Postgre. SQL Marten

That’s all

That’s all