Ready to get started with NoSQL and MongoDB? Here are two 7-minute walkthroughs for installing MongoDB as a Windows service / OS X daemon.
These are both excerpts from my upcoming online MongoDB course for DevelopMentor. You can take the first 1 1/2 hours for free here:
Early access: MongoDB and NoSQL for .NET developers
I’ve been working with MongoDB for a long time now. Back in the early days, there really were no management tools analogous to RDBMS tools (e.g. SQL Server Management Studio). Since then, things have changed significantly. It’s time to look around and see what management / monitoring tooling is around these days for MongoDB.
The news is good. There are many different options to choose depending on your platform and use-cases.
1. Robomongo, price: $0 / open-source, platforms: Windows, OS X, Linux
Key features: Continue reading
[Update: Available via NuGet - MongoDB.Kennedy.Concurrency]
This article demonstrates a technique and supporting library for adding optimistic concurrency control to NoSQL databases and MongoDB in particular.
Watch a video walk-through using this library:
Quickly, what is optimistic concurrency control?
Ideally, all databases that allow concurrent access or disconnected access need to implement some form of concurrency control. This usually comes in two flavors:
- Pessimistic concurrency control
- Optimistic concurrency control
Pessimistic concurrency control is usually used when working heavily within transactions. That may be fine for bank transfers, but it typically falls down in the face of disconnected models used by almost all ORMs such as Entity Framework. Moreover, it is entirely inappropriate for NoSQL databases.
Frameworks such as Entity Framework have optimistic concurrency control built in (although it may be turned off). It’s instructive to quickly see how it works. Basically there are three steps:
- Get an entity from the DB and disconnect.
- Edit in memory.
- Update the db with changes using a special update clause. Something like: “Update this row WHERE the current values are same as original values”.
If that update returns “0 rows modified” then we know it was changed since we loaded it and are about to overwrite someone’s changes. This results in a concurrency exception and not changes go through.
Optimistic concurrency control for MongoDB
By carefully constructing update commands in C# with the official 10gen C# driver, we can achieve almost exactly the same flow. At the end of this article is a simple C# class (data context) which has save and delete methods which internally are safe via optimistic concurrency control. Continue reading
I am very proud to announce an exciting new online learning platform from DevelopMentor:
At DevelopMentor we have been thinking deeply about online training. We wanted to create an environment that combines the best parts of online learning and classroom training, the best parts of self-directed exploration and expert-led mentoring. We believe we have created just such an environment and I am thrilled to publicly announce it today.
Here’s a short 2-minute video which will give you a quick overview. You can get more details at http://www.learninglineapp.com.
Online training today
There are many shortcomings in how developers learn online today. Continue reading
Here’s a quick post on how and why you want to consider using NuGet package restore.
First, if you’re unfamiliar with NuGet, it’s basically “add reference” to external software projects (typically open source ones such as jQuery, but also for Microsoft ones such as Entity Framework). You definitely need to check out David Ebbo’s post introducing it. NuGet will change the way you develop.
Now when using NuGet it maintains a packages folder near your solution file. For things like ASP.NET MVC that heavily leverage NuGet, you’ll see this folder is very large. It’s usually much larger than your project itself in the beginning.
If you write small projects and share them out as compressed files (e.g. zip’s), and size matters to you, you might want to consider enabling NuGet package restore (off by default) for those projects and delete the packages folder before zipping and sending it out.
As an example, with a typical MVC 4 project, the “raw” content is 680 KB. After doing a build and counting the packages folder you’ll see it jumps to 16.9 MB. If that helps you significantly, then it’s probably a good idea to use package restore.
Three things have to happen to use NuGet package restore. Continue reading
I recently blogged about how web apps have hotkeys too. To encourage more developers to add hotkeys to their web applications, I created a jQuery plugin called jQuery.hotKeyMap.js and a sample application.
I just added a download link for the source code:
It’s an ASP.NET MVC 3 web app. Hope you find it useful!
Hot keys (or accelerator keys) have been an important navigational tool for desktop applications for many years. Finally, web applications are adopting this functionality too. Check out this simple example of a web app with hotkeys.
Expect a more general blog post on the topic soon. For now, I’d like to share my jQuery plugin that enables this capability with you.
Announcing jQuery.hotKeyMap.js: A jQuery plugin that allows you to add complex hot-key functionality and navigation to your web apps with very little effort.
Update: Thanks to everyone who came. You can download the sample application we build here and slides below:
So maybe I’m late to the party, but I recently started playing with NuGet. It’s a killer new way to find, install, maintain, and manage references to open source libraries in Visual Studio 2010. Plenty of people have written about it (Phil Haack and Scott Hanselman for example). Let’s just say you should learn about NuGet if you don’t know it already.
What I want to talk about is all the cool open source projects I found just by flipping through the pages of the NuGet directory in the Visual Studio “Add Library Package Reference” dialog.
[Update: See the follow-up post here: TDD Invades Space Invaders]
Tuesday, October 27, 2009 at 10am Pacific time Llewellyn Falco and I will be giving a live, unscripted, and no safety-net demonstration of Test Driven Development (TDD) as part of the DevelopMentor webinar series (this particular series is a 3-part series on Agile development).
We already have a bunch of attendees registered. But we have room for as many of you who are interested in agile and TDD. Sign up here:
In addition to core TDD techniques, you will see how an amazing technique and set of tools designed by Llewellyn called Approval Tests makes writing tests as simple as verifying an image or text file. Tired of writing 50 lines of test code for every 50 lines of production code but you still want the power of TDD? You need to learn more about Approvals and we’ll demo that live tomorrow!
I hope to see you all online. Feel free to help me get the word out by tweeting this or shouting it (see icons below).