Yesterday I got a thought:
why not write something very simple that can store object-graphs without mappings and other fuss.
Yes I know there’s MongoDb, RavenDb and several others, but it’s always a great deal of fun to write something of your own. So, inspired by Ayende’s technology choices, I spent a few hours last night just fiddling around with Lucene.Net and Json.Net. The result:
A simple model
public class Address
{
public string Street { get; set; }
public string Zip { get; set; }
public string City { get; set; }
public string Country { get; set; }
}
public class Customer
{
[Key]
public Guid? Id { get; set; }
[Index]
public string Firstname { get; set; }
[Index]
public string Lastname { get; set; }
[Index]
public int ShoppingIndex { get; set; }
public Address BillingAddress { get; private set; }
public Address DeliveryAddress { get; private set; }
public Customer()
{
BillingAddress = new Address();
DeliveryAddress = new Address();
}
}
Consuming a Storage-provider
var customer = new Customer
{
Id = Guid.NewGuid(),
Firstname = "Daniel",
Lastname = "Wertheim",
ShoppingIndex = 99
};
customer.DeliveryAddress.Country = "Sweden";
var store = new LuceneStructureStore();
store.Insert(customer);
var refetched = store.GetByKey<Customer>(customer.Id.ToString());
...
...
Maybe it will grow to something useful. In the meantime I will continue my work with my MongoDB-provider, Simple-MongoDB.
//Daniel
Advertisement
Trust me when I say it’ll take time to do it well
I think the best place to start is the academic papers from Stonebraker and also his latest project, VoltDB and Vertica.
BTW, I like the EF4 code first stuff you’ve published. Very helpful.
Cheers,
Damien Wintour
Necessary and Sufficient
Horizontal DB
Hi Dennie,
hope u dnt mind if i address u as dennie.
hey as u told u designed ur own drivers for MongoDB which r simpler, n its an open source.
so if u dnt mind may i have that source code for reference
Hi,
The code (which is discontinued) is located here: http://code.google.com/p/simple-mongodb/
//Daniel