Archive for October 14th, 2009

Experimenting with MongoDB from C#

I’ve often felt that we treat relational databases as a hammer to use with every kind of nail, screw, bolt, rivet, metric nut, and wall anchor we encounter in software development. The modern relational databases is a marvelous piece of engineering, and we have centuries of collective experience in designing, optimizing, securing, and managing them, but they just aren’t the best fit for every scenario.

The last few months I’ve been keeping an eye on the growing No-SQL movement. I’d like to make room for the No-SQL conference (nosqleast – their motto is: select fun, profit from real_world where relational=false;), but I’ll just have to wait for a debrief from Matt P. Here are a couple great blog posts for background on the No-SQL thing:

MongoDB I wanted to experiment with a document oriented database myself and chose MongoDB. From the FAQ:

MongoDB is an document-oriented DBMS. Think of it as a persistent object store. It is neither a relational database, nor even "table oriented" like Amazon SimpleDB or Google BigTable. If you have used object-relational mapping layers before in your programs, you will find the Mongo interface similar to use, but faster, more powerful, and less work to set up.

I chose MongoDB because it looked easy to setup and run with.

  1. Download and extract the binaries from MongoDB downloads.
  2. Create a c:\data\db directory (that’s the default storage location – you can override it)
  3. Run the MongoDB daemon – mongod.exe

To talk to MongoDB I used mongodb-csharp. You can either download the source as a zip file, or use a Git client like Git on Windows to clone the github repository. Sounds difficult, but Git is easy once you’ve adopted to the terminology, and as a bonus, it’s screaming fast. There is a Visual Studio solution included with the sources, so you can open it, build it, and out pops a MongoDB.Driver assembly.

Connecting to a database looks like this:

var mongo = new Mongo();
mongo.Connect();
var db = mongo.getDB("movieReviews");

I’m running MongoDB on the local machine and it’s listening on the default port with no special security settings. That simplifies the code, but also notice I can ask for a database (movieReviews), and if it doesn’t exist MongoDB will create the database for me. I don’t need to create tables or schemas or setup primary keys. It just works. I’m thinking document oriented databases are to relational databases what dynamic languages are to static languages.

The next step is to get/create a collection and start adding documents to it.

var movies = db.GetCollection("movies");

var movie = new Document();
movie["title"] = "Star Wars";
movie["releaseDate"] = DateTime.Now;
movies.Insert(movie);

A collection is somewhat analogous to a table in the RDBMS world, but instead of rows and columns a collection is a bunch of documents that internally are stored in a binary JSON format (BSON). The documents can contain anything – they are schemaless, but MongoDB understands how to index and query the documents.

var spec = new Document();
spec["title"] = "Star Wars";
var starWars = movies.FindOne(spec);

With a few more abstractions (and a little bit of LINQ), document oriented databases could be a huge hit in .NET. Although, they might be better aligned with a language that runs on the DLR…


OneFileCMS For Simple File and Content Management

OneFileCMS is a flat, lightweight, one file CMS (Content Management System) entirely contained in an easy-to-implement, highly customizable, database-less PHP script. It comes with a code editor and all the basic necessities of an FTP application, allowing you to maintain a whole website completely in-browser without any external programs.

OneFileCMS requires your website to be hosted on UNIX/Linux machine with Apache, PHP5 and ability to change file permission. OneFileCMS is 100% re-brandable; CSS and images are externally hosted CSS but you can easily move them to your own server for customization.

Developed by Tommy; OneFileCMS is available for download under Creative Commons Attribution Non-Commercial ShareAlike License. You can find further information, demo & download on OneFileCMS Website.

Similar Posts:


New Video Feature: Jump Or Skip Time

Recently, we added a super-useful little feature so you can skip around in the videos without having the video fully loaded. All the videos on the DevExpress Channel are now converted to support the new feature.

How does it work?

  1. We inject ‘metadata’ into the video as a final step in the production process.
  2. You click to any point in the video and the player will start streaming from the new cue point. Take a look at the shot of the 9 minute screencast below. I’ve clicked to the 4 minute mark and video player started streaming from this point forward. Sweet!

DevExpress Channel: Jump To Time Point

Who does #2 work for?

Everyone! Especially on those really long videos. For example, if you had to stop watching a video half way through and wanted to continue where you'd left off, you're just one jump point away.

But wait, there’s more…

One of our internal teams is hard at work on a complete site redesign. The new site has a lot of your suggestions like a playlist feature built-in. Stay tuned for details in the coming weeks.


SharePoint Conference: Theater Sessions at Our Booth + Ipod Nanos

We will have our team and a large booth at the SharePoint Conference next week in Las Vegas. We've designed the booth this year with a mini-theater area (50" plasma, sound system, chairs, etc.) so that our experts can conduct short sessions on topics that we feel we have a special perspective on.

We plan for these sessions to be short (approximately 15 minutes) and on a very specific topic. So, if you are in the exhibit hall and want to take a break from swag hunting for a few minutes and see a quick presentation delivered by an expert on the topic, we invite you to stop by. Like I said, this is a "mini" theater, so don't expect a big area that will accommodate hundreds. We'll have a half-dozen seats available and then standing room for another 10 - 12 people.

You should be able to easily find us as we will be right next to the Microsoft Pavilion where Microsoft will have lots of individual stands demonstrating various features in SharePoint 2010.

Here is the schedule we are planning for right now:

Sunday Evening, October 18:

6:15 - 6:30, "Top 3 Best Practices for Deploying SharePoint on the Extranet"

6:45 - 7:00, "Easy SharePoint Extranet with Extranet Collaboration Manager"

7:15 - 7:30, "Outlook Email and SharePoint Integration with WISDOM Message"

7:45 - 8:00, "SharePoint Designer Workflow Series: Looping Through SharePoint Lists"

8:15 - 8:30, "Automating and Controlling Your Site Request, Creation and Permission Process"

Monday Afternoon, October 19:

4:00 - 4:15, "Souping up SharePoint for Document Management: WISDOM DMF"

Tuesday Afternoon, October 20:

4:00 - 4:15, "The New SharePoint Help Community Website"

Wednesday Afternoon, October 21:

4:00 - 4:15, "After One Year with MOSS for the Internet: Lessons Learned From sharepointsolutions.com"

Wednesday Evening, October 21:

5:45 - 6:00, "Expert Opinion: The New Workflow Features in SharePoint 2010"

6:15 - 6:30, "Expert Opinion: Impact of SharePoint 2010 on Extranet Deployments"

6:45 - 7:00, "Expert Opinion: Usability Improvements in SharePoint 2010"

In addition to these sessions, we will always be available (when the exhibit hall is open - which, unlike previous years, is most of the time) to talk and do one-on-one demos.

Finally, we will be giving away one of the new 5th Generation Ipod Nanos (the new one that comes with an integrated video camera) each day. All you have to do to get in on the drawing is come by the booth and let us scan your badge to enter you.

If you are attending, make sure to stop by and say hello! Looking forward to seeing everyone at the conference!

SharePoint 2010 Training is Coming!


In preparation for the SharePoint Conference next week, on our website we've outlined our plans for offering SharePoint 2010 training.

The short version of the story is that we have already started working on a full lineup of SharePoint 2010 courses that will be targeted at a variety of audiences such as: IT Administrators, IT Developers, IT Managers, non-IT Managers and non-IT Users.

Furthermore, one of the courses, "SharePoint 2010 Skills Upgrade and Planning" will begin to be offered in December (assuming the public beta of SharePoint 2010 is released sometime in November.)

This new SharePoint 2010 course will be offered 1 - 2 times per month at different locations around the US and online. It is being designed by, and will be taught by, our most seasoned SharePoint instructors/consultants. It will be targeted at IT Professionals and non-IT Project Leaders who will be responsible for planning out the SharePoint 2010 adoption strategy for their organization.

If you would like to be notified when we release new information about our SharePoint 2010 training classes (such as course outlines, dates, locations, etc.), I encourage you to visit this page and sign-up for an email alert.

We're getting excited about SharePoint 2010 and are looking forward to offering a new slate of classes!

  • Sponsored Links

  •  

  • .

    Copyright © 1996-2010 Answer My Query. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress