%3CLINGO-SUB%20id%3D%22lingo-sub-386115%22%20slang%3D%22en-US%22%3EImplementing%20Product%20Catalogs%20in%20SQL%20Server%20and%20Azure%20SQL%20database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-386115%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20Sep%2007%2C%202016%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20Product%20catalog%20is%20one%20of%20the%20key%20scenarios%20in%20NoSQL%20systems.%20In%20product%20catalog%20scenario%2C%20you%20need%20to%20store%20different%20types%20of%20products%20with%20different%20properties%26nbsp%3B(e.g.%20phones%20have%20memory%20and%20CPU%20power%3B%20cars%20have%20number%20of%20doors%20and%20max%20speed%2C%20etc.)%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20If%20you%20try%20to%20model%20this%20in%20relational%20database%20you%20will%20end-up%20either%20with%20single%20product%20table%20with%20a%20lot%20of%20sparse%20columns%20where%205-10%20columns%20will%20be%20used%20for%20particular%20product%20types%2C%20or%20you%20will%20have%20a%20lot%20of%20tables%20(one%20for%20each%20product%20type)%20and%20joins%20with%20many%20tables%20that%20contain%20parts%20of%20data.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20In%20NoSQL%20systems%26nbsp%3Byou%20can%20model%20product%20as%20JSON%20documents%20and%20put%20only%20required%20key%3Avalue%20pairs%20in%20product%20objects.%20However%2C%20accessing%20key%3Avalue%20fields%20is%20slower%20than%20accessing%20columns%20directly.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20SQL%20Server%202016%20and%20Azure%20SQL%20Database%20where%20new%20JSON%20support%20is%20available%2C%20enable%20you%20to%20combine%20best%20practices%20from%20relational%20and%20NoSQL%20models.%20You%20can%20store%20some%20common%20properties%20as%20standard%20table%20columns%2C%20put%20properties%20that%20are%20specific%20to%20some%26nbsp%3Bproducts%20in%20JSON%20documents%2C%20choose%20should%20you%20store%20some%26nbsp%3Bfields%20as%20JSON%20collections%20or%20separate%20tables%20(e.g.%20tags%2C%20comments%2C%20etc.)%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20If%20you%20want%20to%20see%20how%20to%20use%20this%20hybrid%20approach%20to%20design%20and%20index%20products%20in%20SQL%20server%202016%20and%20Azure%20SQL%20Database%2C%20you%20can%20see%20following%20blog%20posts%3A%20%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fsqlserverstorageengine%2F2015%2F12%2F21%2Fdesigning-product-catalogs-in-sql-server-2016-using-json%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Designing%20Product%20Catalogs%20using%20JSON%20%3C%2FA%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fsqlserverstorageengine%2F2015%2F12%2F21%2Findexing-data-in-json-product-catalogs%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Indexing%20data%20in%20JSON%20product%20catalogs%20%3C%2FA%3E%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20There%20are%20also%20sample%20apps%20that%20show%20you%20how%20to%20implement%20product%20catalog%20in%20SQL%20Server%20or%20Azure%20SQL%20Database%20on%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2Fsql-server-samples%2Ftree%2Fmaster%2Fsamples%2Ffeatures%2Fjson%2Fproduct-catalog%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20SQL%20Server%20GitHub%20JSON%20samples%20%3C%2FA%3E%20.%20One%20of%20the%20app%20is%20ASP.NET%20Core%20REST%20Service%20that%20exposes%20products%2C%20and%20another%20is%20ASP.NET%20Core%20Web%20application%20that%20displays%20products%20in%20catalog%20and%20uses%20JSON%20functionalities%20in%20SQL%20Server%202016%20and%20Azure%20SQL%20Database.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Finally%20there%20is%20a%20new%20video%20on%20Channel9%20where%20it%20is%20explained%20how%20you%20can%20model%20products%20by%26nbsp%3Bcombining%20relational%20and%20JSON%20data%2C%20and%20also%20query%20or%20update%20JSON%20fields%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fchannel9.msdn.com%2FShows%2FData-Exposed%2FUsing-JSON-in-SQL-Server-2016-and-Azure-SQL-Database%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20Using%20JSON%20in%20SQL%20Server%202016%20and%20Azure%20SQL%20Database%20%7C%20Data%20Exposed%3C%2FA%3E%20%3CBR%20%2F%3E%3CDIV%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F98955iEC8EE54BF4E128CD%22%20%2F%3E%3C%2FDIV%3E%3CBR%20%2F%3E%20If%20you%20need%20to%20design%20product%20catalogs%20and%20if%20you%20want%20to%20use%20hybrid%20approach%20with%20SQL%2BJSON%20these%20might%20be%20helpful%20resources%20and%20code%20samples.%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-386115%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Sep%2007%2C%202016%20Product%20catalog%20is%20one%20of%20the%20key%20scenarios%20in%20NoSQL%20systems.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-386115%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQLServerStorageEngine%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft
First published on MSDN on Sep 07, 2016
Product catalog is one of the key scenarios in NoSQL systems. In product catalog scenario, you need to store different types of products with different properties (e.g. phones have memory and CPU power; cars have number of doors and max speed, etc.)

If you try to model this in relational database you will end-up either with single product table with a lot of sparse columns where 5-10 columns will be used for particular product types, or you will have a lot of tables (one for each product type) and joins with many tables that contain parts of data.

In NoSQL systems you can model product as JSON documents and put only required key:value pairs in product objects. However, accessing key:value fields is slower than accessing columns directly.

SQL Server 2016 and Azure SQL Database where new JSON support is available, enable you to combine best practices from relational and NoSQL models. You can store some common properties as standard table columns, put properties that are specific to some products in JSON documents, choose should you store some fields as JSON collections or separate tables (e.g. tags, comments, etc.)

If you want to see how to use this hybrid approach to design and index products in SQL server 2016 and Azure SQL Database, you can see following blog posts:

There are also sample apps that show you how to implement product catalog in SQL Server or Azure SQL Database on SQL Server GitHub JSON samples . One of the app is ASP.NET Core REST Service that exposes products, and another is ASP.NET Core Web application that displays products in catalog and uses JSON functionalities in SQL Server 2016 and Azure SQL Database.

Finally there is a new video on Channel9 where it is explained how you can model products by combining relational and JSON data, and also query or update JSON fields:

Using JSON in SQL Server 2016 and Azure SQL Database | Data Exposed

If you need to design product catalogs and if you want to use hybrid approach with SQL+JSON these might be helpful resources and code samples.