Archive | MongoDB RSS feed for this section

MongoSF 2013 : scaling the hyperbola of evolution with MongoDB

Palace Hotel lobby, c. 1930

Palace Hotel, c. 1930

You know, I attend a fair number of MongoDB events, and frankly I keep expecting them to get stale. But after being at MongoSF this past Friday, I’m happy to say it hasn’t happened yet. The growth and vigor of the Mongo ecosystem was everywhere apparent, and it has never been more encouraging. Our sincere thanks go out to the 10gen team for putting together another fabulous and informative event.

If you were there and managed to stop by MongoLab’s table in the exhibit hall of the super-elegant Palace Hotel, then thanks! It was nice to meet you and/or see you again! Hope you got as much out of the day as we did. If you didn’t — or if you’d just like my personal take on the whole thing — well, please read on.

Ecosystem predicts viability

Setting aside any of the relative merits of MongoDB as a database for just a moment, I have to say my top takeaway continues to be amazement at the size and enthusiasm of the community around MongoDB.

[I]f an organism or aggregate of organisms sets to work with a focus on its own survival and thinks that that is the way to select its adaptive moves, its “progress” ends up with a destroyed environment. If the organism ends up destroying its environment, it has in fact destroyed itself. … The unit of survival is a flexible organism-in-its-environment.” [1]

History is littered with the scarcely recognizable fossils of good ideas, clever inventions, and even superior products that might have flourished save for one thing: adoption. The modern proving ground for technological species looks less and less like the traditional “marketplace” with pockets of asymmetric information and discrete “deals.”  Today, the landscape has evolved to include open-source transparency, synergies of technologies and ideas, and a globally interconnected (and often, informed) fabric of opinion. A vigorous ongoing conversation (and overlap!) among diversified populations of users and developers is now the surest predictor, I believe, of long-term survival.

So, more than the database technology (which is impressive) or the well-capitalized company devoted to developing it (which is formidable), it is the people and the strength of this community that inspire my confidence that MongoDB will continue to thrive, improving and growing in popularity as a viable or even preëminent database for an ever increasing number of applications.

MongoDB: the Next Generation

Eliot Horowitz, 10gen CTO & Co-founder, kicked things off on a strong note, clearly articulating his focus for the immediate future of MongoDB. In my opinion, these are exactly the right priorities for taking the platform to the next level:

  • Maturity
  • Innovation
  • Operations

If you peer into its internals today, you’ll see the evolutionary legacy of MongoDB: steadily improving and expanding functionality, accreted around a core of pragmatic and sometimes downright scrappy engineering — just what you might expect from a small, clever team with a product rapidly establishing itself in the marketplace. But many of the expedients that accelerate a large piece of software in the short term can eventually bog down development and become obstacles to its further progress. You want a larger team to be able to add and maintain a growing number of features, without commensurate increases in code complexity. At some point, once experience has shown where the grain boundaries lie, there comes a time to refactor (not reinvent!) the core, teasing out clear and minimal abstraction contracts that the new implementations of existing and future features can target.

This engineering story arc is not lost on Eliot. Cleaner factoring, he explains, will be a a key enabler to efficiently deliver capabilities that MongoDB has needed for a long time, to make it a more “mature,” fully-featured general purpose database. It will also form the groundwork for innovating and building on the strengths of MongoDB as a data substrate for modern applications. Specific examples Eliot mentioned included:

  • non-constant query constraints — e.g., find all documents where the values of fields “a” and “b” are equal.
  • inline aggregation operations — e.g., update each document to set its “total” field to the sum of the “dollarAmt” field of each element of its “lineItems” array.
  • index intersections — e.g., optimize a query like {a: 3, b: 6} by dynamically combining an index on “a” with an index on “b” to yield performance comparable to what today would require an explicit compound index comprising both fields.

So that’s the broad story around Maturity and Innovation — right on. What about the third item: Operations? This of course refers to the realities of keeping a database running and available behind a production system of any kind. Happily, there is another three-item list here:

  • Monitoring
  • Backups
  • Management

Eliot spoke to 10gen’s efforts on each of these facets: MMS, which became available some 18 months ago; the remote backup service, which is in Limited Release now; and a suite of management tools to be announced later this year.

Of course, the topic of production-class operations is near to our hearts: seamlessly handling these three facets for our customers is what MongoLab is all about!

You got your lagerstätten in my Burgess Shale!

Opabinia

Opabinia, c. 505,000,000 BC

Max Schireson, the 10gen CEO who claims to have been born the same year as the relational database, followed up with a pointedly evolutionary perspective on database technologies. He compared today’s landscape to the early part of the Cambrian Explosion, in which biodiversity increased by orders of magnitude in a small fraction of the total history of life on earth up to that point. Of course, the unstated implication was that hitherto more “established” databases (Oracle, MySQL) were the long-dominant single-celled organisms in this analogy, whereas MongoDB would be perhaps more like a sighted predator of some kind.

Schireson quoted some consumption figures from the top of the food chain (e.g., 3 of the top 10 global investment bank use MongoDB) and noted some recent shifts in environmental pressures (e.g., developer-driven decision making).  He also cited an amusing factoid: prior to this year’s report, the last Gartner Research update on databse technology came out in 2003. That’s right: a full ten years ago. Something new must be going on. (Can you guess what?)

In short, Schireson made it sound like a pretty exciting time to be in databases, with MongoDB figuring prominently on the changing landscape.

Okay, now back to your niche…

After this inspiring keynote, of course, there followed a full day of stimulating talks and sessions at all levels of the mongo-guru ladder — oceans of fresh, insightful, useful stuff.

My personal favorite was probably the session led by Charity Majors, who is responsible for the MongoDB servers at the heart of Parse.com. If you were lucky enough to catch her outstanding talk on the care and feeding of a grown-up mongo deployment, you’ll know that there’s a whole host of operational issues that you’d just rather not worry about — or at the very least, you’d very much like an experienced hand at the helm when you do. Why do I say her talk was outstanding? Because that stuff is our bread and butter. It’s what we do all day every day here at MongoLab: hook you up with the database of tomorrow, so you can use more of your energy to dominate YOUR product’s ecological niche today, and still get a good night’s sleep (assuming your species isn’t nocturnal).

There’s never been a richer ecosystem, or a better time to be a database consumer. And there are more reasons than ever today for your consumption preferences to be of the MongoDB phyla. Yummy! Why not try one right now?

T. Dampier, 2013-05-11

Notes

[1] Source: Gregory Bateson, “Form, Substance and Difference”, 19th Annual Alfred Korzybski Memorial Lecture, 9 Januiary 1970, Oceanic Institute, Hawaii. From the book Ecology and Consciousness, edited by Richard Grossinger, North Atlantic Books, 1978. p. 32.

{ "comments": 1 }

[“Thinking”, “About”, “Arrays”, “In”, “MongoDB”]

Greetings adventurers!

The growing popularity of MongoDB means more and more people are thinking about data in ways divergent from traditional relational models. For this reason alone, it’s exciting to experiment with new ways of modelling data. However, with additional flexibility comes the need to properly analyze the performance impact of data model decisions.

Embedding arrays in documents is a great example of this. MongoDB’s versatile array operators ($push/$pull, $addToSet, $elemMatch, etc.) offer the ability to manage data sets within documents. However, one must be careful. Data models that call for very large arrays, or arrays with high rates of modification, can often lead to performance problems.

Continue Reading →

{ "comments": 43 }

How to use MongoDB on RedHat OpenShift with MongoLab

Hey RedHat fans – we’ve got your MongoDB hosting needs covered!

In today’s post we’ll be presenting a quick-start guide on how to connect OpenShift, the free RedHat auto-scaling Platform-as-a-Service (PaaS), with our popular MongoDB Database-as-a-Service (DBaaS), MongoLab.

For demonstration purposes, we’ll be using a Node.js application that we’ve written (available for download here). All it takes to connect your OpenShift application is five easy steps!

Continue Reading →

{ "comments": 7 }

MongoLab at Overdriver.com

Overdriver_Logo

We’re excited to partner with Overdriver, a unique Platform-as-a-Service for gaming that is showcasing their beta service for the first time at this year’s Game Developers Conference (GDC)!

This exciting partnership means that MongoLab will serve as the core data storage provider for Overdriver’s online game developer community. You can find out more right here.

By marrying dynamic cloud scaling with gaming-specific tooling for features like virtual goods and social functionality, Overdriver addresses the biggest demand issue that game studios face: bringing titles to market quickly but with little operational risk.

MongoDB naturally supports the object-oriented information model in games, capturing concepts such as user characters, possessions, game pieces, and state of play. MongoLab’s robust and performant MongoDB-as-a-Service lets Overdriver game developers give their full attention to designing compelling games.

We are fascinated by Overdriver and honored to be an inaugural partner in their ground-breaking specialized PaaS approach.

If you’re in San Francisco this week stop by their booth, #1838, at GDC and meet the Overdriver team. Also, be sure to sign up for an account at Overdriver.com. FYI, creating a new environment at Overdriver automatically creates a new MongoLab account and database.

We can’t wait to play with what you build!

Replication Lag & The Facts of Life

So you’re checking in on your latest awesome application one day — it’s really getting traction! You’re proud of its uptime record, thanks in part to the MongoDB replica set underneath it. But now … something’s wrong. Users are complaining that some of their data has gone missing. Others are noticing stuff they deleted has suddenly reappeared. What’s going on?!?

Don’t worry… we’ll get to the bottom of this! In doing so, we’ll examine a source of risk that’s easy to overlook in a MongoDB application: replication lag — what it means, why it happens, and what you can do about it.

Continue Reading →

{ "comments": 7 }

Object Modeling in Node.js with Mongoose

Check it out! We’ve just updated our Heroku Dev Center tutorial on object modeling in Node.js using Mongoose, a MongoDB ODM library. Mongoose gives your collections structure and simplifies Node’s callback patterns to make using MongoDB with Node.js even easier.

Learn more and download the sample Node.js app right here at the Heroku Dev Center.

Node.js and MongoLab on Windows Azure

(This tutorial was originally published on the Windows Azure documentation portal in January 2013)

Greetings, adventurers! Welcome to MongoDB-as-a-Service. Are you looking to create a Node.js Application on Windows Azure with MongoDB using the MongoLab Azure Store add-on?

In this tutorial you will:

  1. Provision the database – The Windows Azure Store MongoLab add-on will provide you with a MongoDB database hosted in the Windows Azure cloud and managed by MongoLab‘s cloud database platform.
  2. Create the app – It’ll be a simple Node.js app for maintaining a list of tasks.
  3. Deploy the app – By tying a few configuration hooks together, we’ll make pushing our code a breeze.
  4. Manage the database – Finally, we’ll show you MongoLab’s web-based database management portal where you can search, visualize, and modify data with ease.

At any time throughout this tutorial, feel free to kick off an email to support@mongolab.com if you have any questions. To complete this tutorial, you need a Windows Azure account that has the Windows Azure Web Sites feature enabled. You can create a free trial account and enable preview features in just a couple of minutes. For details, see the Create a Windows Azure account and enable preview features tutorial.

In addition, ensure that you have the following installed:
Continue Reading →

{ "comments": 3 }

Experiment with MongoDB 2.4 on MongoLab!

Hello to all our friends and users!

We’re happy to announce that free, experimental databases running MongoDB 2.4 are now available at MongoLab! To get started quickly, follow our step-by-step guide.

Please note: This release is not ready for production yet and should not be used for any production applications.

Release Highlights

Here are the exciting new features and improvements in MongoDB 2.4 that we’d like to highlight:

Full-text search

For your exploration, we are boldly ignoring the warning label on this feature, which is described as an “experimental feature” in 2.4, and are running these servers with textSearchEnabled=true.

You get one text index per collection and create it, similarly to spatial indexes, by providing a special value in your index creation call.

The following simple example text-indexes the “skills” field of the “players” collection.

> db.players.ensureIndex({"skills": "text"})

You can include more than one text-indexed field in a single text index as well as other fields, such as:

> db.players.ensureIndex({"skills": "text", "interests": "text", "age": 1})

To run a query that returns documents that contain the word “telepathy” (case-insensitive) in either the skills or interests fields:

> db.players.runCommand("text", {"search": "telepathy"})

There are several considerations when making a text index and even useful options such as weighting of fields. So… before you make use of this feature, be sure to read the text indexes documentation.

The above example uses the mongo shell. If you want to run through this example in MongoLab’s admin UI, scroll on down…

JavaScript engine now uses v8 as the default

The default JavaScript interpreter used throughout MongoDB, for the mongo shell, mapreduce, $where and eval is now v8 instead of SpiderMonkey. For all users making use of the JavaScript engine, we encourage you to run the same code against this new engine and see how it performs!

Better GeoSpatial indexing

Spherical Geospatial queries are now supported by their own index type. You can create this new type of index just like you currently create a geospatial index, except that you need to specify “2dsphere” in the index definition instead of “2d”. Much like the 2d index requirement of storing [long, lat] data in a certain format, 2dsphere indexes have specific data considerations; for example, you must store a point, line, or polygon in GeoJSON format.

This new index type becomes even more useful with the $geoIntersects operator. Now, MongoDB can tell you if two of your shapes overlap. This is a powerful but specialized tool, so familiarize yourself with the details by reading the release notes and make sure it’s right for you.

An interrupted index build can now be resumed

Ah – this feature improvement is music to our ops-centric ears!  Previously if your mongod process died (either through intentional shutdown or unexpected termination) while you were building an index, you had to start the index build from scratch again.  As of this release, mongod will continue where it left off on an index build after the process starts again.

Example: A simple full-text search using MongoLab

Below is a step-by-step guide to creating a free database running MongoDB 2.4 and running your first full-text search.

[1] Sign up for a MongoLab account if you don’t already have one

[2] Click the “Create new” button after you are logged in to create the database, checking the highlighted checkbox below.  Note that database names need to be unique within an account and mongod process.
Screen Shot 2013-02-07 at 12.44.48 PM

[3] On the “Collections” tab click “Add” and create a collection called “players”

[4] We need some data to run a search against, so click into the row representing this collection so that we can add some.

[5] Click “Add” and copy the following document into the JSON editor:

     { "skills": "telepathy archery",
       "interests": "eating drinking",
       "age": 34 }

[6] On the “Indexes” tab click “Add” to text-index the “skills” and “interests” fields

Screen Shot 2013-02-08 at 12.42.25 PM

[7] Let’s run our first full-text search! On the “Tools” tab and the “commands” sub-tab, select the “text” command:

Screen Shot 2013-02-08 at 12.37.08 PM

Questions or Thoughts?

As you play around with our experimental databases running this new release, please email us anytime! We are eager to help you as you explore this exciting release or if you have any other questions or thoughts about MongoDB.

{ "comments": 3 }