Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mathias_10gen
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
mathias_10gen
13y ago
Actually in C++11 you can just say: auto id = mongo::OID("1234..."); This gives you much (not all) of the brevity and flexibility of dynamic typing, while maintaining the power and safety of static typing.
2.
▲
by
mathias_10gen
13y ago
Actually, as of 2.4 there is an experimental text search feature built-in: http://docs.mongodb.org/manual/core/text-search/ . While it is no Lucene (and is still considered experimental) it does provide simple tokenizing, stop-words and st
3.
▲
by
mathias_10gen
14y ago
One case that could break by this change is if you relied on insert's old default of being a no-op if an object with the same _id already exists. This can be used to efficiently insert a default document without race conditions. Example at
4.
▲
by
mathias_10gen
14y ago
Out of curiosity, did you have an index on the ts field that you are matching with? By the way, if you (or anyone else for that matter) come up with useful benchmarks I'd love to get a copy of them at mathias@10gen.com. I have a few of my o
5.
▲
by
mathias_10gen
14y ago
There is an official tutorial on http://mongodb.org , just click "Try It Out" in the top banner. Karl Seguin also wrote two great tutorials (one on basics, one on geo queries) at http://tutorial.mongly.com/ .
6.
▲
by
mathias_10gen
14y ago
Locking in particular has improved substantially since 1.6. For example, 2.0 introduced yielding in some cases where MongoDB would go to disk rather than page-faulting with the lock held[1]. This has been extended and improved for 2.2, alon
7.
▲
by
mathias_10gen
15y ago
Thanks for bringing this to our attention. It has just been fixed in master.
8.
▲
by
mathias_10gen
15y ago
Take a look at the $push and $addToSet[1] update operators in mongodb. They are both for atomically adding one or more elements to an array in an object. On the other hand, MongoDB doesn't support server-side set union or intersection so if
9.
▲
by
mathias_10gen
15y ago
I don't know exactly what your GIS needs are, but it might be worth seeing if MongoDB's geospatial indexing meets them if you are interested in querying free-form data. http://www.mongodb.org/display/DOCS/Geospatial+Indexing http://www.m
10.
▲
by
mathias_10gen
15y ago
We try to keep documentation on EC2 best practices here: http://www.mongodb.org/display/DOCS/Amazon+EC2
11.
▲
by
mathias_10gen
15y ago
True, but since the current version of SM that we use (1.7) isn't thread-safe all calls to it need to be inside of a mutex to prevent trashing global state. It is possible that with a switch to V8 or upgrade to the lastest SM (1.8.5?) it is
12.
▲
by
mathias_10gen
15y ago
Writing to the journal is actually done outside of the write lock most of the time. It does hold a readlock, however as of 2.0 most commits will release the lock before doing any disk I/O.
13.
▲
by
mathias_10gen
15y ago
2.0 has a new index format that should reduce your index sizes by ~20-30% to fit more in RAM. If you haven't looked at upgrading yet, it is probably worth testing with 2.0.1 to see how it performs in your use case. You will need to reindex(
14.
▲
by
mathias_10gen
15y ago
FYI, as of 1.8 MongoDB now has a WAL implementation optionally enabled by starting with --journal. We made it the default in 2.0 for 64-bit platforms.
15.
▲
by
mathias_10gen
15y ago
The global write lock, while important, is probably the most over-written-about and misunderstood issue. The writelock is only held while the db is actually in the middle of an write and tends to only be held for a very brief period (about
16.
▲
by
mathias_10gen
15y ago
Even worse is that modern x86 (and probably other) CPUs also have instructions for 16-byte vector registers that can be used to copy or compare data much faster than 1 byte per cycle. Recent versions of glibc use some linker magic to pick t
17.
▲
by
mathias_10gen
15y ago
Surprisingly good although not complete: http://gcc.gnu.org/projects/cxx0x.html Unfortunately a lot of companies don't use today's compilers, but use many-year old versions. For example, Apple still ships gcc 4.2 which is over 4 years old
18.
▲
by
mathias_10gen
15y ago
I think Effective C++ by Scott Meyers[1] is the gold standard when it comes to books on writing good clean C++. It assumes that you already know the basic syntax though and already know how to program. This allow him to skip the intro stuff
19.
▲
by
mathias_10gen
15y ago
Actually since most if not all CPUs have an atomic increment instruction it is quite easy to make shared_ptr<> thread-safe. In fact, that is what boost::shared_ptr<> does. This makes it a good tool for resources that may be
20.
▲
by
mathias_10gen
15y ago
That line was referring to restarting just the mongod process on a running machine (eg, when upgrading or changing config flags). In that case, the data should still be in the OS file cache and will result in minor rather than major pagefau
21.
▲
by
mathias_10gen
15y ago
It was probably either http://try.mongodb.org or http://mongly.com/
22.
▲
by
mathias_10gen
15y ago
Its actually possible to be fully consistent if you include the "tension" documents when fetching the main docs. For example, in the canonical transaction example of Alice giving Bob $5 you could insert a document in the transactions collec
23.
▲
by
mathias_10gen
15y ago
I don't want to turn this into a MongoDB vs Riak thread, but you may want to take another look at Mongo as the points you've mentioned are now handled. As of 1.6 we support automatic fail-over[1] and synchronous replication[2]. In 1.8 we ad
24.
▲
by
mathias_10gen
15y ago
The defualt mapping of Y is arguably broken since it doesn't follow the normal vi conventions. I have these lines in my .vimrc to "fix" it: "make shift Y behave like shift-[cd] (copy to end of line) nnoremap Y y$
25.
▲
by
mathias_10gen
15y ago
ci( is another nifty trick that will do the same but will work anywhere between the two ('s not just at the beginning of globalConfig. See ":help text-objects" for more details on one of the more powerful feature of vim.
26.
▲
by
mathias_10gen
15y ago
While this is a very nifty bit of code, I'd be very careful about using it for unit testing as there is a high likelihood of minor behavior differences verses a real mongod which can cause surprises in production. Also, for anyone looking t
27.
▲
by
mathias_10gen
15y ago
MongoDB doesn't require everything in ram either.
28.
▲
by
mathias_10gen
15y ago
FYI - Your _id trick is similar to the ObjectID type mongodb uses by default. "A BSON ObjectID is a 12-byte value consisting of a 4-byte timestamp (seconds since epoch), a 3-byte machine id, a 2-byte process id, and a 3-byte counter. Note t
29.
▲
Fun with MongoDB replica sets
(engineering.foursquare.com)
16 points
by
mathias_10gen
15y ago
|
0 comments
30.
▲
by
mathias_10gen
15y ago
One thing you may want to consider adding to your client is a "mongotunnel" command which will set up an ssh tunnel with compression between the user's computer and your mongodb servers. I've noticed some significant performance benefit to
More ›