{"id":1342,"date":"2016-12-29T18:57:02","date_gmt":"2016-12-29T18:57:02","guid":{"rendered":"http:\/\/ninecrows.com\/career\/?p=1342"},"modified":"2016-12-30T04:01:25","modified_gmt":"2016-12-30T04:01:25","slug":"time-to-define-tables","status":"publish","type":"post","link":"https:\/\/ninecrows.com\/career\/2016\/12\/29\/time-to-define-tables\/","title":{"rendered":"Time to Define Tables"},"content":{"rendered":"<p>I&#8217;ve worked with databases on and off for a long time but in general I&#8217;ve been accessing previously defined data tables or had very simple needs (DynamoDB kind of forces that).<\/p>\n<p>I&#8217;m at the point in my sandbox work that I&#8217;m about to define a substantially more complex schema than I&#8217;ve used for anything in the past. Finding that my command of SQL DDL and the various bits involved in creating MySQL users and setting permissions is taking some doing.<\/p>\n<p>I still can&#8217;t seem to get a database on a remote system (boojum, my<a href=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_133853.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1343\" data-permalink=\"https:\/\/ninecrows.com\/career\/2016\/12\/29\/time-to-define-tables\/img_20161229_133853\/\" data-orig-file=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_133853.jpg?fit=4048%2C3036&amp;ssl=1\" data-orig-size=\"4048,3036\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;2&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;Pixel XL&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1483018733&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.67&quot;,&quot;iso&quot;:&quot;849&quot;,&quot;shutter_speed&quot;:&quot;0.033333&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"img_20161229_133853\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_133853.jpg?fit=300%2C225&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_133853.jpg?fit=474%2C356&amp;ssl=1\" class=\"size-thumbnail wp-image-1343 alignleft\" src=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_133853.jpg?resize=75%2C75\" alt=\"img_20161229_133853\" width=\"75\" height=\"75\" srcset=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_133853.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_133853.jpg?zoom=3&amp;resize=75%2C75 225w\" sizes=\"(max-width: 75px) 100vw, 75px\" \/><\/a> little test machine). I am not getting a &#8216;no connection&#8217; response but an authorization failure so I expect that the identit(ies) I created on the NUC aren&#8217;t quite right Always details to be dealt with&#8230;<\/p>\n<p>I am finding that tables proliferate. Everything needs a unique ID (and auto increment columns help enormously here). Any sort of one to many relationship (keywords, validation) winds up with a new table containing the source object key and the targets. In the past I&#8217;ve used the DB as an index for more complex storage (DICOM-3 pretty much forces this with its many 1..n fields, DynamoDB encourages this as well with bulk information in S3).<\/p>\n<p>In the current case I really want to keep everything in the DB rather than spilling items overboard. If I get to thumbnails I&#8217;ll see how the BLOB types work. For now I expect that I&#8217;ll be ok with the 64K per row limit on MySQL InnoDB tables. I expect that BLOB and TEXT aren&#8217;t stored in their respective tables so they should permit &#8216;stretch&#8217; operations.<\/p>\n<p>Current working notes are a bit chaotic \ud83d\ude42<\/p>\n<figure id=\"attachment_1344\" aria-describedby=\"caption-attachment-1344\" style=\"width: 474px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1344\" data-permalink=\"https:\/\/ninecrows.com\/career\/2016\/12\/29\/time-to-define-tables\/img_20161229_134543\/\" data-orig-file=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543-e1483037603199.jpg?fit=3784%2C2570&amp;ssl=1\" data-orig-size=\"3784,2570\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;2&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;Pixel XL&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1483019145&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.67&quot;,&quot;iso&quot;:&quot;398&quot;,&quot;shutter_speed&quot;:&quot;0.008328&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"img_20161229_134543\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543-e1483037603199.jpg?fit=300%2C204&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543-e1483037603199.jpg?fit=474%2C322&amp;ssl=1\" class=\"wp-image-1344 size-large\" src=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543-e1483037603199-1024x695.jpg?resize=474%2C322\" alt=\"DB Initial Sketch\" width=\"474\" height=\"322\" srcset=\"https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543-e1483037603199.jpg?resize=1024%2C695&amp;ssl=1 1024w, https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543-e1483037603199.jpg?resize=300%2C204&amp;ssl=1 300w, https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543-e1483037603199.jpg?resize=768%2C522&amp;ssl=1 768w, https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543-e1483037603199.jpg?w=948 948w, https:\/\/i0.wp.com\/ninecrows.com\/career\/wp-content\/uploads\/2016\/12\/IMG_20161229_134543-e1483037603199.jpg?w=1422 1422w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><figcaption id=\"caption-attachment-1344\" class=\"wp-caption-text\">Chaos in the Schema<\/figcaption><\/figure>\n<p>I am sticking with the MariaDB fork of MySQL to avoid Oracle entanglements. Once the basic database definitions are in place I expect to code the front end in C# as I need to polish up that language and environment a bit at the moment. Not sure whether I&#8217;ll go with WPF or some sort of web interface for the UI yet. Got to get the innards a bit better defined first.<\/p>\n<p><span style=\"color: #3366ff;\">Looks like I was just messing up my command line for remote mysql access. Once I got things straightened out, I can talk to the database instance on boojum from chaos. Should make things a bit cleaner as I can keep the data in one spot and access it from any system in the house. Now I just have to finish with the <strong>create table<\/strong> statements and see if they build what I need. Short digression into users and permissions first (and probably a quick look at alter table) to see what I should be doing for remote access.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve worked with databases on and off for a long time but in general I&#8217;ve been accessing previously defined data tables or had very simple needs (DynamoDB kind of forces that). I&#8217;m at the point in my sandbox work that I&#8217;m about to define a substantially more complex schema than I&#8217;ve used for anything in &hellip; <a href=\"https:\/\/ninecrows.com\/career\/2016\/12\/29\/time-to-define-tables\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Time to Define Tables<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Time to Define Tables","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[12,2,22],"tags":[],"class_list":["post-1342","post","type-post","status-publish","format-standard","hentry","category-general-technical","category-projects","category-sandbox"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7F2Qc-lE","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/posts\/1342"}],"collection":[{"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/comments?post=1342"}],"version-history":[{"count":3,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/posts\/1342\/revisions"}],"predecessor-version":[{"id":1348,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/posts\/1342\/revisions\/1348"}],"wp:attachment":[{"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/media?parent=1342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/categories?post=1342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ninecrows.com\/career\/wp-json\/wp\/v2\/tags?post=1342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}