{"id":1198,"date":"2012-02-27T12:38:51","date_gmt":"2012-02-27T11:38:51","guid":{"rendered":"http:\/\/blog.eweibel.net\/?p=1198"},"modified":"2012-02-29T10:20:35","modified_gmt":"2012-02-29T09:20:35","slug":"are-stale-data-evil-2","status":"publish","type":"post","link":"https:\/\/blog.eweibel.net\/?p=1198","title":{"rendered":"Are stale data evil?"},"content":{"rendered":"<p><a href=\"http:\/\/blog.eweibel.net\/wp-content\/uploads\/Fotolia_37310173_S.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"Sexy young woman as devil in fire\" border=\"0\" alt=\"Sexy young woman as devil in fire\" align=\"right\" src=\"http:\/\/blog.eweibel.net\/wp-content\/uploads\/Fotolia_37310173_S_thumb.jpg\" width=\"242\" height=\"272\" \/><\/a>When you&#8217;re a software engineer who produces software for enterprises like banks or assurances, then it is normal you have huge databases (several gigabytes). Such systems have an operative application where users do the daily business of the company and there are more informative parts (or strategic parts) of the systems which the management uses. At a first glance, there isn&#8217;t a problem with those two views, but as you probably know, those companies have for the second part for the management a data ware house solution.<\/p>\n<p>But what if your customer doesn&#8217;t want a data ware house solution? Or if he couldn&#8217;t afford one? Then you will probably add reports, search views to your application. In this blog post I describe some of the aspects if you&#8217;ve to choose this variation.<\/p>\n<p><strong>Stale data as a requirement<\/strong><\/p>\n<p>Unfortunately the question &quot;how old can the data on this report\/search be?&quot; is rarely asked. When the answer is &quot;The report\/search has to show the right data&quot;, then you have to ask the customer again. The problem is, the data is maybe already stale after the query, because somebody changed some data.<\/p>\n<p>In my experience there are only a few reports, which need as little as possible stale data. But it is essential that you ask this question.<\/p>\n<p><strong>Isolate only as far as needed<\/strong><\/p>\n<p>Most searches or reports need essential tables in your relational database, so it is important that those searches or reports don&#8217;t have an effect to your daily business. You ask yourself maybe now, how those queries could have any impact?<\/p>\n<p>If you use Microsoft SQL Server, then the default isolation level is &quot;Read committed&quot;. If a query isn&#8217;t that clever made, it could happen, that the query blocks a whole table (Intended Shared Lock which blocks any inserts or updates). If that happen, your users will remark that by waiting while they try to save their data.<\/p>\n<p>When you create a search or an report you have to ask yourself always, which Isolation level you will use. When you use dirty reads (Isolation level &quot;Read uncommitted&quot;), then you&#8217;ll probably never generate any locks, but you have to deal with data which is wrong. This because data could be roll backed and the same query wouldn&#8217;t bring the roll backed data again.<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>Stale data or even wrong data on a search or an informational report hasn&#8217;t to be wrong or a mistake. Sometimes it&#8217;s just good enough to fulfil the requirements and make the customer happy. And that&#8217;s what it&#8217;s all about.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you&#8217;re a software engineer who produces software for enterprises like banks or assurances, then it is normal you have huge databases (several gigabytes). Such systems have an operative application where users do the daily business of the company and there are more informative parts (or strategic parts) of the systems which the management uses. At a first glance, there isn&#8217;t a problem with those two views, but as you probably know, those companies have for the second part for&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/blog.eweibel.net\/?p=1198\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[],"class_list":["post-1198","post","type-post","status-publish","format-standard","hentry","category-software-architecture"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/plOV9-jk","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1033,"url":"https:\/\/blog.eweibel.net\/?p=1033","url_meta":{"origin":1198,"position":0},"title":"Data quality as a business value","author":"Patrick","date":"3. Jun 2011","format":false,"excerpt":"It could happen, that you have to do some data migrations from time to time. If you are familiar with data migrations you know that it isn\u2019t an easy job. There are several concerns: Needed time to do the effective migration Cleaning up data Validate current data (consistency) Transform existing\u2026","rel":"","context":"In &quot;Software engineering&quot;","block_context":{"text":"Software engineering","link":"https:\/\/blog.eweibel.net\/?cat=14"},"img":{"alt_text":"DataQuality","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/DataQuality_thumb.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1167,"url":"https:\/\/blog.eweibel.net\/?p=1167","url_meta":{"origin":1198,"position":1},"title":"Who should make decisions about technologies?","author":"Patrick","date":"13. Feb 2012","format":false,"excerpt":"One of the biggest problems of software engineering companies in Switzerland is currently to get new software developers. To get new employees there are several points as for example salary, environment, career possibilities and technologies. The last point looks easy but in reality it isn't that easy. Why are essential\u2026","rel":"","context":"In &quot;New technology&quot;","block_context":{"text":"New technology","link":"https:\/\/blog.eweibel.net\/?cat=6"},"img":{"alt_text":"Stay on course","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/Fotolia_36561464_S_thumb.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":367,"url":"https:\/\/blog.eweibel.net\/?p=367","url_meta":{"origin":1198,"position":2},"title":"Reason of silence","author":"Patrick","date":"13. Aug 2009","format":false,"excerpt":"Why is there no blog entry for the July and for the half of august? Well, the answer is, that my current project where I'm the project manager and and also the leader of a team of software engineers, comes to an end. Currently we implement the last features like\u2026","rel":"","context":"In &quot;Private&quot;","block_context":{"text":"Private","link":"https:\/\/blog.eweibel.net\/?cat=9"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":489,"url":"https:\/\/blog.eweibel.net\/?p=489","url_meta":{"origin":1198,"position":3},"title":"Kaizen and Software Engineering","author":"Patrick","date":"27. Oct 2009","format":false,"excerpt":"Kaizen is a very interesting approach, also in the software industry. On Wikipedia you\u2019ll find the following description of Kaizen: Kaizen is a Japanese word adopted into English referring to a philosophy or practices focusing on continuous improvement in manufacturing activities, business activities in general, and even life in general,\u2026","rel":"","context":"In &quot;Agile&quot;","block_context":{"text":"Agile","link":"https:\/\/blog.eweibel.net\/?cat=17"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":890,"url":"https:\/\/blog.eweibel.net\/?p=890","url_meta":{"origin":1198,"position":4},"title":"Hunting performance issues","author":"Patrick","date":"17. Jan 2011","format":false,"excerpt":"Recently I received the lead over a performance optimization project for a software product.\u00a0 It isn't something extraordinary for a software architect, because as a software architect you have to know what's critical for a software system in a specific environment. Some of my co-workers may now smile a bit:\u2026","rel":"","context":"In &quot;Software architecture&quot;","block_context":{"text":"Software architecture","link":"https:\/\/blog.eweibel.net\/?cat=4"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/image_thumb9.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":718,"url":"https:\/\/blog.eweibel.net\/?p=718","url_meta":{"origin":1198,"position":5},"title":"Do frameworks kill design skills?","author":"Patrick","date":"8. Feb 2011","format":false,"excerpt":"Software design is one of the most important skills a software engineer should have. But what is software design exactly? If you search for a definition you find something like this: Software design is a process of problem-solving and planning for a software solution. After the purpose and specifications of\u2026","rel":"","context":"In &quot;Design patterns&quot;","block_context":{"text":"Design patterns","link":"https:\/\/blog.eweibel.net\/?cat=3"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/image_thumb11.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts\/1198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1198"}],"version-history":[{"count":4,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts\/1198\/revisions"}],"predecessor-version":[{"id":1205,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts\/1198\/revisions\/1205"}],"wp:attachment":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}