<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Lessons on Architecture and Data Blog</title>
    <link>https://sadalage.com/tags/lessons/</link>
    <description>Recent content in Lessons on Architecture and Data Blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 18 Apr 2010 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://sadalage.com/tags/lessons/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>My experience with MongoDB</title>
      <link>https://sadalage.com/post/my_experience_with_mongodb/</link>
      <pubDate>Sun, 18 Apr 2010 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/my_experience_with_mongodb/</guid>
      <description>&lt;p&gt;The current project I&amp;rsquo;m on is using MongoDB. MongoDB is a document based database, it stores JSON objects as BSON (Binary JSON objects). MongoDB provides a middle ground between the traditional RDBMS and the NOSql databases out there, it provides for indexes, dynamic queries, replication, map reduce and auto sharding, its open source and can be downloaded &lt;a href=&#34;www.mongodb.org&#34;&gt;Mongodb&lt;/a&gt;, starting up mongodb is pretty easy.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;./mongod --dbpath=/user/data/db&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;is all you need, where /user/data/db is the path where you want mongo to create its data files. There are many other options that you can use to customize the mongo instance.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Storing just the time in Oracle</title>
      <link>https://sadalage.com/post/storing_time_in_oracle/</link>
      <pubDate>Thu, 12 Feb 2009 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/storing_time_in_oracle/</guid>
      <description>&lt;p&gt;We came across a need to save just the Time in the database, the requirement is to store time of the day, like say the user likes to have Breakfast at 8.15AM and Lunch at 12.32PM etc. Off course oracle does not have a time only data type.  So we ended up using DATE as the data type and just setting the time. for example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CREATE TABLE FOO (PREFERRED_TIME DATE NULL);&#xA;INSERT INTO FOO (TO_DATE(&amp;#39;11:34&amp;#39;,&amp;#39;HH24:MI&amp;#39;));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;oracle automatically sets the date to the first day of the current month. so when you do a select from the FOO table the data would be&lt;/p&gt;</description>
    </item>
    <item>
      <title>Moved to a Mac</title>
      <link>https://sadalage.com/post/moved_to_a_mac/</link>
      <pubDate>Mon, 01 Sep 2008 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/moved_to_a_mac/</guid>
      <description>&lt;p&gt;Couple of weeks back I was given a choice to upgrade my work Laptop to a Mac Book Pro or a Windows Laptop. I choose Mac ( I know everyone is into macs nowadays). The transition was pretty good, with the exception of moving my oracle database from windows to mac, since there is no native installation of oracle on mac I had to use VMWare fusion to install oracle.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Lessons from Re-Learning</title>
      <link>https://sadalage.com/post/relearning/</link>
      <pubDate>Thu, 27 Dec 2007 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/relearning/</guid>
      <description>&lt;p&gt;I have been working on a project that I had worked in 2005, trying to get a handle on what I had done about 3 years back. Exploring code and the database has been fun, also discovering the data layout and building new set of data for production has been extremely entertaining. What I learnt from this whole experience was this &lt;em&gt;if your code(application or other wise) is not expecting data, this data should not be provided or even considered valid by the database, the database should be designed such that it does not even allow invalid combinations of the data.&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Lesson learnt changing firewall settings</title>
      <link>https://sadalage.com/post/lesson_learnt_firewall/</link>
      <pubDate>Thu, 13 Sep 2007 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/lesson_learnt_firewall/</guid>
      <description>&lt;p&gt;On any machine running network related services, like in my case Oracle Listener and Dispatch Services. Don&amp;rsquo;t rebuild/stop and restart the firewall stuff like iptables.&lt;/p&gt;&#xA;&lt;p&gt;Had to spend a lot of time, figuring out what was going on. So hard lesson learnt don&amp;rsquo;t mess with iptables when you are running oracle listener/dispatcher&lt;/p&gt;</description>
    </item>
    <item>
      <title>Nulls need special love</title>
      <link>https://sadalage.com/post/nulls_need_special_love/</link>
      <pubDate>Thu, 15 Feb 2007 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/nulls_need_special_love/</guid>
      <description>&lt;p&gt;The following SELECT statement in code&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#d0d0d0;background-color:#202020;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;stmt&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;=&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;DB.&lt;span style=&#34;color:#bbb&#34;&gt;prepare&lt;/span&gt;(&lt;span style=&#34;color:#ed9d13&#34;&gt;&amp;#34;select id,name,state,zip &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;+&lt;span style=&#34;color:#666&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#ed9d13&#34;&gt;&amp;#34;from customer &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;+&lt;span style=&#34;color:#666&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#ed9d13&#34;&gt;&amp;#34;where &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;+&lt;span style=&#34;color:#666&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#ed9d13&#34;&gt;&amp;#34;phone = ? &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;+&lt;span style=&#34;color:#666&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#ed9d13&#34;&gt;&amp;#34;and active = ?&amp;#34;&lt;/span&gt;);&lt;span style=&#34;color:#666&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;&lt;/span&gt;stmt.&lt;span style=&#34;color:#bbb&#34;&gt;setString&lt;/span&gt;(1,&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;customerPhone);&lt;span style=&#34;color:#666&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;&lt;/span&gt;stmt.&lt;span style=&#34;color:#bbb&#34;&gt;setBoolean&lt;/span&gt;(2,&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;isActive);&lt;span style=&#34;color:#666&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;&lt;/span&gt;stmt.&lt;span style=&#34;color:#bbb&#34;&gt;execute&lt;/span&gt;();&lt;span style=&#34;color:#666&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;where &lt;strong&gt;customerPhone&lt;/strong&gt; and &lt;strong&gt;isActive&lt;/strong&gt; are values you would pass in to the SELECT before its executed. Everything is fine when one day the value passed for &lt;strong&gt;customerPhone&lt;/strong&gt; is NULL. For a database (Oracle is what I know most) a NULL will never be equal to NULL , the SELECT will not return rows where the customer.phone is NULL, leading to wrong results. The SELECT will have to be changed to&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kids teaching International Relations&#34;</title>
      <link>https://sadalage.com/post/kids_teaching_international_relations/</link>
      <pubDate>Tue, 26 Sep 2006 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/kids_teaching_international_relations/</guid>
      <description>&lt;p&gt;You learn a lot from kids, and this lesson I will never forget.&lt;/p&gt;&#xA;&lt;p&gt;So I&amp;rsquo;m at Lyon (in France) airport and there are a couple of kids (4-5 year olds) playing in the airport play area which had slides, call these two kids TA and TB my daughter call her AA joins these kids and they all start playing with the slide.&lt;/p&gt;&#xA;&lt;p&gt;All is going well when a family with two kids, mom, dad and grandma join in, mom and dad are staying away and grandma takes the kids lets call them FA and FB to play on the slides. Grandma makes the previous kids (AA, AB, AA)  stop playing and clears the slide for her grand kids (EA and EB) to play the slide. Grandkids start playing for a while and TA and TB are just waiting around not knowing what to do. AA by now has moved on to a different toy in the airport.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
