Monday, June 4, 2012

For anyone that is interested in using the ScrappyDB ASP.NET Membership Provider for Amazon SimpleDB...

I would like to announce that I am actively developing an updated version of ScrappyDB that will also support Amazon DynamoDB as a backend. Functionality should be identical, and it should be transparent which backend you are using.

The primary differences are pricing and scalability:

For a low volume site SimpleDB should be cheaper.

For a high volume site DynamoDB should provide near infinite scalability with consistent performance.

Monday, June 27, 2011

For several years I've been working on ScrappyDB, which is my personal open source .NET library for Amazon SimpleDB.

I quietly released version 1.0 on CodePlex (http://scrappydb.codeplex.com/) several years ago, and despite a few downloads I'm not aware of a single production user (other than me). Not to worry... no hard feelings... I wrote this for my own use and released it in hopes that it "might" prove useful for somebody else someday...

This month I released version 2.0 to Nuget (http://nuget.org/List/Packages/ScrappyDB) with slightly higher expectations: "ScrappyDB 2.0 is a code first style object mapping library and Linq provider for Amazon SimpleDB. Also included is an ASP.NET Membership Provider for Amazon SimpleDB."

With support for "Entity Framework style" code first syntax and Linq I'm hopeful that a few other people might actually find this useful. But nobody is going to use it if they can't find it and so I'm taking it upon myself to start writing a few blog posts demonstrating how it works, and eventually to highlight how easy it is to use Amazon SimpleDB as a backend for .NET websites.

To get started here are a few code examples that demonstrate using ScrappyDB to run the example queries found in the excellent SimpleDB Query 101 document from Amazon:

Following EF Code First conventions we create a class to define our schema and then a context class to access the database. The only syntactic difference between EF and ScrappyDB at this point is "SdbContext" in place of "DbContext".

var dbContext = new AwsSampleContext();var result = from a in dbContext.Books where a.Title == "The Right Stuff" select a;

SimpleDB only supports one datatype which is a string. This means no native numeric types, no datetime. ScrappyDB supports strongly typed data for a subset of common .NET types.

Linq was designed generically and doesn't always map well to underlying database features and implementation oddities. This is particularly true with SimpleDB, where the "simple" feature set can't support many concepts that are typical in Linq to SQL.

Here is another sample query from the Query 101 document, and several different ways to approach implmenting it in ScrappyDB:

select * from mydomain where Year > '1985'

The .NET centric way to implement this in ScrappyDB would be to define the Year field as a numeric type, in which case the Linq query would be as you might expect from Linq to SQL:

var dbContext = new AwsSampleContext();var result = from a in dbContext.Books where a.YearInt > 1985 select a;

If you defined the field "Year" as a string in your .NET class then you will need to use the ScrappyDB specific extension method "GreaterThan" to implement this query:

var dbContext = new AwsSampleContext();var result = from a in dbContext.Books where a.Year.GreaterThan("1985") select a;

If you would like to see more you can check out the source code on BitBucket (https://bitbucket.org/scrappydog/scrappydb). The Integration Tests in the source implement almost all the examples from the Query 101 document.

After that, I launch Terminal and run `gzip -9 filename.css && gzip -9 filename.js` to compress them as tightly as possible. This will give me filename.css.gz and filename.js.gz. I remove the .gz extension, and upload those files to S3.

Lastly, I add a custom HTTP header — `Content-Encoding: gzip` — to each of the files in S3. This tells the browser the same thing as Apache would if it were compressing them on the fly. The browser then knows to decompress the content after downloading it.

Since the files are pre-compressed instead of compressing on the fly (a la Apache), fewer server resources are used and the response times are faster. "

Tuesday, September 7, 2010

I've been playing around with Google Voice for a while know and I really like the speech to text transcription it does on voicemails, and so I've decided to start using it as my primary phone number for all business stuff.

Interesting to note how much Google and Amazon cloud stuff I use in my day to day life... and nothing from Microsoft... hmmm...