{"id":3242,"date":"2017-04-13T11:15:06","date_gmt":"2017-04-13T18:15:06","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=3242"},"modified":"2025-06-13T19:29:05","modified_gmt":"2025-06-14T02:29:05","slug":"sql-to-json-data-modeling-hackolade","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/","title":{"rendered":"SQL to JSON Data Modeling with Hackolade"},"content":{"rendered":"<div class=\"paragraph\">\n<p>SQL to JSON data modeling is something I touched on in the first part of my <a href=\"https:\/\/www.couchbase.com\/blog\/moving-from-sql-server-to-couchbase-part-1-data-modeling\/\">&#8220;Moving from SQL Server to Couchbase&#8221; series<\/a>. Since that blog post, some new tooling has come to my attention from <a href=\"https:\/\/hackolade.com\/\">Hackolade<\/a>, which has recently added first-class Couchbase support to their tool.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>In this post, I\u2019m going to review the very simple modeling exercise I did by hand, and show how IntegrIT\u2019s Hackolade can help.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>I\u2019m using the same SQL schema that I used in the previous blog post series; you can find it on <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/tree\/master\/Groves\/045MigrateFromSQLServer\/src\/SQLServerToCouchbase\">GitHub (in the SQLServerDataAccess\/Scripts folder)<\/a>.<\/p>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_review_sql_to_json_data_modeling\">Review: SQL to JSON data modeling<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>First, let\u2019s review: the main way to represent relations in a relational database is via a key\/foreign key relationship between tables.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>When looking at modeling in JSON, there are two main ways to represent relationships:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><strong>Referential<\/strong> &#8211; Concepts are given their own documents, but reference other document(s) using document keys.<\/li>\n<li><strong>Denormalization<\/strong> &#8211; Instead of splitting data between documents using keys, group the concepts into a single document.<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>I started with a relational model of shopping carts and social media users.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/06401-relational-model.png\" alt=\"Relational model of SQL before moving to JSON\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>In my example, I said that a Shopping Cart &#8211; to &#8211; Shopping Cart Items relationship in a relational database would probably be better represented in JSON by a single Shopping Cart document (which contains Items). This is the &#8220;denormalization&#8221; path. Then, I suggested that a Social Media User &#8211; to &#8211; Social Media User Update relationship would be best represented in JSON with a referential relationship: updates live in their own documents, separate from the user.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>This was an entirely manual process. For that simple example, it was not difficult. But with larger models, it would be helpful to have some tooling to assist in the SQL to JSON data modeling. It won\u2019t be completely automatic: there\u2019s still some art to it, but the tooling can do a lot of the work for us.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_starting_with_a_sql_server_ddl\">Starting with a SQL Server DDL<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>This next part assumes you\u2019ve already run the SQL scripts to create the 5 tables: ShoppingCartItems, ShoppingCart, FriendBookUsers, FriendBookUpdates, and FriendBookUsersFriends. (Feel free to try this on your own databases, of course.)<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>The first step is to create a DDL script of your schema. You can do this with SQL Server Management Studio.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>First, right click on the database you want. Then, go to &#8220;Tasks&#8221; then &#8220;Generate Scripts&#8221;. Next, you will see a wizard. You can pretty much just click &#8220;Next&#8221; on each step, but if you\u2019ve never done this before you may want to read the instructions of each step so you understand what\u2019s going on.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5686 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/06402-sql-generate-scripts-compressor-1.gif\" alt=\"\" width=\"600\" height=\"600\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Finally, you will have a SQL file generated at the path you specified.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>This will be a text file with a series of <code>CREATE<\/code> and <code>ALTER<\/code> statements in it (at least). Here\u2019s a brief excerpt of what I created (you can find the <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/tree\/master\/Groves\/064DataModelingWithHackolade\/src\">full version on Github<\/a>).<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-SQL\">CREATE TABLE [dbo].[FriendBookUpdates](\r\n\t[Id] [uniqueidentifier] NOT NULL,\r\n\t[PostedDate] [datetime] NOT NULL,\r\n\t[Body] [nvarchar](256) NOT NULL,\r\n\t[UserId] [uniqueidentifier] NOT NULL,\r\n CONSTRAINT [PK_FriendBookUpdates] PRIMARY KEY CLUSTERED\r\n(\r\n\t[Id] ASC\r\n)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]\r\n) ON [PRIMARY]\r\n\r\nGO\r\n\r\n-- etc...<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>By the way, this should also work with SQL Azure databases.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><em>Note: Hackolade works with other types of DDLs too, not just SQL Server, but also Oracle and MySQL.<\/em><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_enter_hackolade\">Enter Hackolade<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>This next part assumes that you have downloaded and installed Hackolade. This feature is only available on the Professional edition of Hackolade, but there is a 30-day free trial available.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Once you have a DDL file created, you can open Hackolade.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>In Hackolade, you will be creating\/editing models that correspond to JSON models: Couchbase (of course) as well as DynamoDB and MongoDB. For this example, I\u2019m going to create a new Couchbase model.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/06403-new-couchbase-model-hackolade.gif\" alt=\"Create a new Couchbase model in Hackolade\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>At this point, you have a brand new model that contains a &#8220;New Bucket&#8221;. You can use Hackolade as a designing tool to visually represent the kinds of documents you are going to put in the bucket, the relationships to other documents, and so on.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>We already have a relational model and a SQL Server DDL file, so let\u2019s see what Hackolade can do with it.<\/p>\n<\/div>\n<div class=\"sect2\">\n<h3 id=\"_reverse_engineer_sql_to_json_data_modeling\">Reverse engineer SQL to JSON data modeling<\/h3>\n<div class=\"paragraph\">\n<p>In Hackolade, go to Tools \u2192 Reverse Engineer \u2192 Data Definition Language file. You will be prompted to select a database type and a DDL file location. I\u2019ll select &#8220;MS SQL Server&#8221; and the &#8220;script.sql&#8221; file from earlier. Finally, I\u2019ll hit &#8220;Ok&#8221; to let Hackolade do its magic.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5688 size-full\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/06404-reverse-engineer-sql-ddl-hackolade-compressor.gif\" alt=\"\" width=\"650\" height=\"414\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Hackolade will process the 5 tables into 5 different kinds of documents. So, what you end up with is very much like a <em>literal<\/em> translation.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/06405-reverse-engineer-diagram.png\" alt=\"SQL to JSON data modeling reverse engineering with Hackolade result\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>This diagram gives you a view of your model. But now you can think of it as a canvas to construct your ultimate JSON model. Hackolade gives you some tools to help.<\/p>\n<\/div>\n<\/div>\n<div class=\"sect2\">\n<h3 id=\"_denormalization\">Denormalization<\/h3>\n<div class=\"paragraph\">\n<p>For instance, Hackolade can make suggestions about denormalization when doing SQL to JSON data modeling. Go to Tools\u2192Suggest denormalization. You\u2019ll see a list of document kinds in &#8220;Table selection&#8221;. Try selecting &#8220;shoppingcart&#8221; and &#8220;shoppingcartitems&#8221;. Then, in the &#8220;Parameters&#8221; section, choose &#8220;Array in parent&#8221;.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/06406-suggest-denormalization-hackolade.png\" alt=\"Suggest denormalization in Hackolade\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>After you do this, you will see that the diagram looks different. Now, the items are embedded into an array in shoppingcart, and there are dashed lines going to shoppingcartitems. At this point, we can remove shoppingcartitems from the model (in some cases you may want to leave it, that\u2019s why Hackolade doesn\u2019t remove it automatically when doing SQL to JSON data modeling).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/06407-remove-table-hackolade.gif\" alt=\"Remove excess table in Hackolade\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Notice that there are other options here too:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><strong>Embedding Array in parent<\/strong> &#8211; This is what was demonstrated above.<\/li>\n<li><strong>Embedding Sub-document in child<\/strong> &#8211; If you want to model the opposite way (e.g. store the shopping cart within the shopping cart item).<\/li>\n<li><strong>Embedding Both<\/strong> &#8211; Both array in parent and sub-document approach.<\/li>\n<li><strong>Two-way referencing<\/strong> &#8211; Represent a many-to-many relationship. In relational tables, this is typically done with a &#8220;junction table&#8221; or &#8220;mapping table&#8221;<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>Also note <strong>cascading<\/strong>. This is to prevent circular referencing where there can be a parent, child, grandchild, and so on. You select how far you want to cascade.<\/p>\n<\/div>\n<\/div>\n<div class=\"sect2\">\n<h3 id=\"_more_cleanup\">More cleanup<\/h3>\n<div class=\"paragraph\">\n<p>There are a couple of other things that I can do to clean up this model.<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><strong>Add a &#8216;type&#8217; field<\/strong>. In Couchbase, we might need to distinguish shoppingcart documents from other documents. One way to do this is to add a &#8220;discriminator&#8221; field, usually called &#8216;type&#8217; (but you can call it whatever you like). I can give it a &#8220;default&#8221; value in Hackolade of &#8220;shoppingcart&#8221;.<\/li>\n<li><strong>Remove the &#8216;id&#8217; field from the embedded array<\/strong>. The SQL table needed this field for a foreign key relationship. Since it\u2019s all embedded into a single document, we no longer need this field.<\/li>\n<li><strong>Change the array name to &#8216;items&#8217;<\/strong>. Again, since a shopping cart is now consolidated into a single document, we don\u2019t need to call it &#8216;shoppingcartitems&#8217;. Just &#8216;items&#8217; will do fine.<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/04\/06408-clean-up-json-data-model.png\" alt=\"Clean up JSON data model in Hackolade\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<div class=\"sect2\">\n<h3 id=\"_output\">Output<\/h3>\n<div class=\"paragraph\">\n<p>A model like this can be a living document that your team works on. Hackolade models are themselves stored as JSON documents. You can share with team members, check them into source control, and so on.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>You can also use Hackolade to generate static documentation about the model. This documentation can then be used to guide the development and architecture of your application.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Go to File \u2192 Generate Documentation \u2192 HTML\/PDF. You can choose what components to include in your documentation.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_summary\">Summary<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Hackolade is a NoSQL modeling tool created by the IntegrIT company. It\u2019s useful not only in building models from scratch, but also in reverse engineering for SQL to JSON data modeling. There are many other features about Hackolade that I didn\u2019t cover in this post. I encourage you to <a href=\"https:\/\/hackolade.com\/\">download a free trial of Hackolade today<\/a>. You can also find <a href=\"https:\/\/twitter.com\/hackolade\">Hackolade on Twitter @hackolade<\/a>.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>If you have questions about Couchbase Server, please ask away in the <a href=\"https:\/\/www.couchbase.com\/forums\/\">Couchbase Forums<\/a>. Also check out the <a href=\"https:\/\/www.couchbase.com\/developers\/\">Couchbase Developer Portal<\/a> for more information on Couchbase for developers. Always feel free to <a href=\"https:\/\/twitter.com\/mgroves\">contact me on Twitter @mgroves<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>SQL to JSON data modeling is something I touched on in the first part of my &#8220;Moving from SQL Server to Couchbase&#8221; series. Since that blog post, some new tooling has come to my attention from Hackolade, which has recently [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":3251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816,1819,1812],"tags":[1261,1556],"ppma_author":[8937],"class_list":["post-3242","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server","category-data-modeling","category-n1ql-query","tag-json","tag-sql-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SQL to JSON Data Modeling with Hackolade - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Walkthrough of a very simple SQL to JSON data modeling exercise and show how IntegrIT&#039;s Hackolade can help.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL to JSON Data Modeling with Hackolade\" \/>\n<meta property=\"og:description\" content=\"Walkthrough of a very simple SQL to JSON data modeling exercise and show how IntegrIT&#039;s Hackolade can help.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-13T18:15:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T02:29:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2048\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Matthew Groves\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mgroves\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matthew Groves\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/\"},\"author\":{\"name\":\"Matthew Groves\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\"},\"headline\":\"SQL to JSON Data Modeling with Hackolade\",\"datePublished\":\"2017-04-13T18:15:06+00:00\",\"dateModified\":\"2025-06-14T02:29:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/\"},\"wordCount\":1307,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png\",\"keywords\":[\"JSON\",\"SQL Server\"],\"articleSection\":[\"Couchbase Server\",\"Data Modeling\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/\",\"name\":\"SQL to JSON Data Modeling with Hackolade - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png\",\"datePublished\":\"2017-04-13T18:15:06+00:00\",\"dateModified\":\"2025-06-14T02:29:05+00:00\",\"description\":\"Walkthrough of a very simple SQL to JSON data modeling exercise and show how IntegrIT's Hackolade can help.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png\",\"width\":2048,\"height\":1024,\"caption\":\"Glass ochem by Purpy Pupple, licensed through Creative Commons https:\/\/commons.wikimedia.org\/wiki\/File:Glass_ochem.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL to JSON Data Modeling with Hackolade\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\",\"name\":\"Matthew Groves\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"caption\":\"Matthew Groves\"},\"description\":\"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.\",\"sameAs\":[\"https:\/\/crosscuttingconcerns.com\",\"https:\/\/x.com\/mgroves\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL to JSON Data Modeling with Hackolade - The Couchbase Blog","description":"Walkthrough of a very simple SQL to JSON data modeling exercise and show how IntegrIT's Hackolade can help.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/","og_locale":"en_US","og_type":"article","og_title":"SQL to JSON Data Modeling with Hackolade","og_description":"Walkthrough of a very simple SQL to JSON data modeling exercise and show how IntegrIT's Hackolade can help.","og_url":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-04-13T18:15:06+00:00","article_modified_time":"2025-06-14T02:29:05+00:00","og_image":[{"width":2048,"height":1024,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png","type":"image\/png"}],"author":"Matthew Groves","twitter_card":"summary_large_image","twitter_creator":"@mgroves","twitter_misc":{"Written by":"Matthew Groves","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/"},"author":{"name":"Matthew Groves","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58"},"headline":"SQL to JSON Data Modeling with Hackolade","datePublished":"2017-04-13T18:15:06+00:00","dateModified":"2025-06-14T02:29:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/"},"wordCount":1307,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png","keywords":["JSON","SQL Server"],"articleSection":["Couchbase Server","Data Modeling","SQL++ \/ N1QL Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/","url":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/","name":"SQL to JSON Data Modeling with Hackolade - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png","datePublished":"2017-04-13T18:15:06+00:00","dateModified":"2025-06-14T02:29:05+00:00","description":"Walkthrough of a very simple SQL to JSON data modeling exercise and show how IntegrIT's Hackolade can help.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/04\/064-hero-model.png","width":2048,"height":1024,"caption":"Glass ochem by Purpy Pupple, licensed through Creative Commons https:\/\/commons.wikimedia.org\/wiki\/File:Glass_ochem.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/sql-to-json-data-modeling-hackolade\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL to JSON Data Modeling with Hackolade"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58","name":"Matthew Groves","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54","url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","caption":"Matthew Groves"},"description":"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.","sameAs":["https:\/\/crosscuttingconcerns.com","https:\/\/x.com\/mgroves"],"url":"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/"}]}},"authors":[{"term_id":8937,"user_id":71,"is_guest":0,"slug":"matthew-groves","display_name":"Matthew Groves","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","author_category":"","last_name":"Groves","first_name":"Matthew","job_title":"","user_url":"https:\/\/crosscuttingconcerns.com","description":"Matthew D. Groves is a guy who loves to code.  It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything.  He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s.  He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community.  He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=3242"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3242\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/3251"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=3242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=3242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=3242"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}