<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>build broken &#187; Release</title>
	<atom:link href="http://blog.aztec-project.org/category/release/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.aztec-project.org</link>
	<description>but we can fix it! Sometimes :)</description>
	<lastBuildDate>Fri, 11 Jun 2010 12:52:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>StupidDB &#8211; object-persistence-framework</title>
		<link>http://blog.aztec-project.org/2009/07/13/stupiddb-object-persistence-framework/</link>
		<comments>http://blog.aztec-project.org/2009/07/13/stupiddb-object-persistence-framework/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 13:30:33 +0000</pubDate>
		<dc:creator>Stefan Kölle</dc:creator>
				<category><![CDATA[Release]]></category>
		<category><![CDATA[StupidDB]]></category>

		<guid isPermaLink="false">http://blog.aztec-project.org/?p=407</guid>
		<description><![CDATA[Angeregt durch die Diskussion auf dem Open-Spaces zum Thema schemalose Datenbanken, werden wir heute bereits die Vorabversion unserer StupidDB als open-source releasen. Die StupidDB entstand bei uns aus der Notwendigkeit, immer wieder Objekte und Files schnell und einfach zu speichern, dies serverlos und trotzdem skalierbar und hochverfügbar vorzuhalten. Die StupidDB lässt sich am besten wie [...]]]></description>
			<content:encoded><![CDATA[<p>Angeregt durch die Diskussion auf dem Open-Spaces zum Thema schemalose Datenbanken, werden wir heute bereits die Vorabversion unserer StupidDB als open-source releasen.</p>
<p>Die StupidDB entstand bei uns aus der Notwendigkeit, immer wieder Objekte und Files schnell und einfach zu speichern, dies serverlos und trotzdem skalierbar und hochverfügbar vorzuhalten. Die StupidDB lässt sich am besten wie folgt beschreiben:</p>
<blockquote><p>StupidDB ist ein einfaches Objektspeicherungs-Framework auf dem Filesystem. Vergleichbar mit dem WebCache kann man in der StupidDB jegliches Objekt ablegen, welches kosteneffizient auf dem Filesystem gespeichert wird. Geladen werden können Objekte und Binärdaten mit einem eindeutigen Key und einer Partition. Den echten Speicherort auf der Festplatte ermittelt StupidDB selbst. Durch Replikation des Filesystems z.B. per Windows-DFS ist zudem eine einfache Hochverfügbarkeit und Skalierbarkeit der Datenbasis herzustellen.</p></blockquote>
<p>Angeregt durch einen <a href="http://techblog.tilllate.com/2008/08/14/webtuesday-lightning-talk-slides/" target="_blank">Blogeintrag von tilllate.com</a> letztes Jahr, entstand bereits vor einem Jahr die erste Version von StupidDB, welches bis zum Blogeintrag nur aus einem Konzept bestand. Leo Büttiker hat zwar ein leicht anderes Konzept als unsere Implementierung, in den Kernpunkten ähnelt sich aber das Design. StupidDB bekam durch diesen Blogpost damals jedoch seinen Namen.</p>
<p>Für folgende Anwendungsszenarien sehen wir StupidDB als geeignet:</p>
<ul>
<li> Userdaten wie Fotos und Mediadaten, die eine Datenbank nur unnötig aufblähen</li>
<li> temporäre Daten</li>
<li> Statusdaten</li>
<li>Versionierung von Daten</li>
</ul>
<p>Als Vorteile gegenüber z.B. MogileFS, CouchDB zählt für uns vor allem, dass kein zentraler Server für die Datenbank benötigt wird, sondern nur ein Share im Netz. Die Implementierung ist dadurch enorm vereinfacht. Mit weiteren Windows-Board-Mitteln kann man danach das ganze System um Hochverfügbarkeit und Skalierbarkeit einfach ausbauen.</p>
<p>Die Nutzung selbst ist denkbar einfach. Folgendes Mitarbeiter-Objekt möchte ich speichern.</p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: #2b91af;"> 65</span> <span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">Mitarbeiter</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 66</span> {</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 67</span> <span style="color: blue;">public</span> <span style="color: blue;">int</span> Id { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 68</span> <span style="color: blue;">public</span> <span style="color: blue;">string</span> Name { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 69</span> <span style="color: blue;">public</span> <span style="color: blue;">string</span> Vorname { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 70</span> <span style="color: blue;">public</span> <span style="color: blue;">string</span> Ort { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 71</span> <span style="color: blue;">public</span> <span style="color: blue;">string</span> Plz { <span style="color: blue;">get</span>; <span style="color: blue;">set</span>; }</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 72</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 73</span> <span style="color: blue;">public</span> <span style="color: blue;">string</span> VollerName</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 74</span> {</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 75</span> <span style="color: blue;">get</span> { <span style="color: blue;">return</span> <span style="color: blue;">string</span>.Format(<span style="color: #a31515;">&#8220;{0} {1}&#8221;</span>, Vorname, Name); }</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 76</span> }</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 77</span> }</p>
</div>
<p>Dazu nutzt man die Put-Methode der StupidDB.</p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: #2b91af;"> 20</span> <span style="color: #2b91af;">IStupidDB</span> stupidDB = <span style="color: blue;">new</span> <span style="color: #2b91af;">StupidDB</span>(<span style="color: #a31515;">&#8220;test&#8221;</span>);</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 21</span> <span style="color: #2b91af;">Mitarbeiter</span> mitarbeiter = <span style="color: blue;">new</span> <span style="color: #2b91af;">Mitarbeiter</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 22</span> {</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 23</span> Id = 1,</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 24</span> Name = <span style="color: #a31515;">&#8220;Christian&#8221;</span>,</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 25</span> Vorname = <span style="color: #a31515;">&#8220;Thomas&#8221;</span>,</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 26</span> Ort = <span style="color: #a31515;">&#8220;Rosenheim&#8221;</span>,</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 27</span> Plz = <span style="color: #a31515;">&#8220;83026&#8243;</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 28</span> };</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 29</span> stupidDB.Put( <span style="color: #a31515;">&#8220;TestPartition&#8221;</span>, <span style="color: #a31515;">&#8220;EinMitarbeiter&#8221;</span>, mitarbeiter );</p>
</div>
<p>Um das gleiche Objekt wieder zu lesen, nutzt man mal eine Get Methode. Die Parameter sind Partition und Key:</p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: #2b91af;"> 32</span> <span style="color: #2b91af;">Mitarbeiter</span> mitarbeiterAusgelesen =</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 33</span> (<span style="color: #2b91af;">Mitarbeiter</span>)stupidDB.GetObject(</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 34</span> <span style="color: #a31515;">&#8220;TestPartition&#8221;</span>,</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 35</span> <span style="color: #a31515;">&#8220;EinMitarbeiter&#8221;</span>,</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 36</span> <span style="color: blue;">typeof</span>(<span style="color: #2b91af;">Mitarbeiter</span>)</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 37</span> );</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 38</span> <span style="color: blue;">if</span> (mitarbeiterAusgelesen != <span style="color: blue;">null</span>)</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 39</span> {</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 40</span> <span style="color: #2b91af;">Console</span>.WriteLine(<span style="color: #a31515;">&#8220;Name des Mitarbeiters: {0}&#8221;</span>,</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 41</span> mitarbeiterAusgelesen.VollerName);</p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 42</span> }</p>
</div>
<p>Die StupidDB selbst wird über die app.config definiert.</p>
<div style="font-family: Courier New; font-size: 10pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: #2b91af;"> 3</span> <span style="color: blue;">&lt;</span><span style="color: #a31515;">configuration</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 4</span> <span style="color: blue;"> &lt;</span><span style="color: #a31515;">configSections</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 5</span> <span style="color: blue;"> &lt;</span><span style="color: #a31515;">section</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">stupidDB</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">type</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">Aztec.StupidDB.DBConfigCollection, Aztec.StupidDB, Version=1.0.0.0, Culture=neutral</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">allowLocation</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">true</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">allowDefinition</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">Everywhere</span>&#8220;<span style="color: blue;">/&gt;</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 6</span> <span style="color: blue;"> &lt;/</span><span style="color: #a31515;">configSections</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 7</span> <span style="color: blue;"> &lt;</span><span style="color: #a31515;">stupidDB</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 8</span> <span style="color: blue;"> &lt;</span><span style="color: #a31515;">DB</span><span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">test</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">root</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">temp\test</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">tiefe</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">3</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">versionierung</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">false</span>&#8220;<span style="color: blue;"> /&gt;</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 9</span> <span style="color: blue;"> &lt;/</span><span style="color: #a31515;">stupidDB</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #2b91af;"> 10</span> <span style="color: blue;">&lt;/</span><span style="color: #a31515;">configuration</span><span style="color: blue;">&gt;</span></p>
</div>
<p>Wer sich den aktuellen Code einmal ansehen möchte, kann dies gerne unter folgendem Link ansehen:<a href="https://stupiddb.svn.sourceforge.net/svnroot/stupiddb/trunk"></p>
<p>https://stupiddb.svn.sourceforge.net/svnroot/stupiddb/trunk</a></p>
<p><a href="http://dotnet-kicks.de/kick/?url=http%3a%2f%2fblog.aztec-project.org%2f2009%2f07%2f13%2fstupiddb-object-persistence-framework%2f"><img src="http://dotnet-kicks.de/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fblog.aztec-project.org%2f2009%2f07%2f13%2fstupiddb-object-persistence-framework%2f" border="0" alt="kick it on dotnet-kicks.de" /></a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.aztec-project.org%2F2009%2F07%2F13%2Fstupiddb-object-persistence-framework%2F&amp;title=StupidDB%20%26%238211%3B%20object-persistence-framework"><img src="http://blog.aztec-project.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.aztec-project.org/2009/07/13/stupiddb-object-persistence-framework/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

