Showing posts with label NoSQL. Show all posts
Showing posts with label NoSQL. Show all posts

Wednesday, January 7, 2015

Upgrade MongoDB MMS monitoring agent

PROBLEM:
How to upgrade MongoDB MMS monitoring agent?

SOLUTION:
The MongoDB Monitoring Service (MMS) is a cloud-based monitoring service, designed by MongoDB, to monitor the health of MongoDB deployments. MMS provides an agent that runs on MongoDB servers, and this agent reports information such as opcounters, memory information, number of connections, network I/O, database storage size, and more. All of this information is available in customizable charts that are displayed in your web browser.

To install the monitoring agent register here and follow the wizard instructions.

To upgrade:

  • Open MMS dashboard
  • Choose "Administration" -> "Agents"
  • Click one of the links in the "Monitoring" section
  • A window with header "Install or Update the Monitoring Agent.." will open
  • In the header section, choose "UPDATE"
  • Continue with the instructions in the page (example below..)


Example (for RHEL/CentOS (5.X, 6.X), SUSE, and Amazon Linux - RPM):


1. Download the 32-bit or 64-bit rpm.

curl -OL https://mms.mongodb.com/download/agent/monitoring/mongodb-mms-monitoring-agent-2.8.0.143-1.x86_64.rpm

2. Install the package

sudo rpm -U mongodb-mms-monitoring-agent-2.8.0.143-1.x86_64.rpm

If you find this useful, you are welcome to press one of the ads in this page.. Thanks!


Tuesday, December 2, 2014

Will NoSQL kill the DBA position?

I’m afraid it’s unlikely. You see, every new or old technology has its advantages and drawbacks. The reality is that NoSQL stands for “Not Just SQL” rather than “No SQL” so the relational database isn't going away anytime soon. Organizations still need transaction atomicity for their mission critical business transactions. When a customer makes a credit card payment or a trader executes a trade, those business transactions need to be committed in real-time to disk. The state of the transaction and its data needs to be consistent wherever that data is updated and accessed from. The reason why NoSQL solutions are so fast, elastic, scalable, and available is because they are basically in-memory distributed data stores that run across multiple nodes and physical servers–meaning that if one node fails, there are plenty others to take over. Therefore when a transaction writes to one node, it’s incredibly fast–but that data has to then be replicated across all nodes in the NoSQL grid for the data to be truly consistent.

Read/Write consistency is still something that NoSQL based solutions have yet to conquer; they sacrifice ACID for read/write performance, elasticity, and high availability.  So while NoSQL enables applications to scale with high transaction concurrency and data volumes, they need to work in parallel with relational databases to ensure data consistency.

If you find this useful, you are welcome to press one of the ads in this page.. Thanks!

Tuesday, August 13, 2013

Use MongoDB in Windows Azure

PROBLEM:
You want to use MongoDB in Windows Azure

SOLUTION:
See the following links:

  1. MongoDB Installer for Windows on Azure
  2. Securing MongoDB on Windows Azure

If you find this useful, you are welcome to press one of the ads in this page.. Thanks!


Tuesday, June 11, 2013

MongoDB Hardware Tips

PROBLEM:
You need some hardware tips for your MongoDB installation:
  • Buy $1k 1000 servers or $10k 100 servers?
  • Fast CPU vs. more CPU cores?
  • More RAM is good?
  • Virtualization is ok?
  • SSD is good?
  • Disable NUMA (Non-Uniform Access Memory) in BIOS?
  • File system settings?
SOLUTION:
See this: https://www.youtube.com/watch?v=19VZJ9H3LmQ

If you find this useful, you are welcome to press one of the ads in this page.. Thanks!

Sunday, June 9, 2013

Step by step guide for MongoDB sharding

PROBLEM:
What is a MongoDB sharded cluster?

SOLUTION:
While sharding is a powerful and compelling feature, it comes with significant infrastructure requirements and some limited complexity costs. As a result, use sharding only as necessary and when indicated by actual operational requirements.

Here is a step by step guide for MongoDB sharding:

Introduction to Sharding

Sharding Setup Demo

The config database

Setup Part 2 Adding the Initial Shards

Enabling sharding for a collection

Working with a sharded collection

Choosing shard keys

Process and Machine Layout

Bulk inserts and pre-splitting

Further tips and best practices

If you find this useful, you are welcome to press one of the ads in this page.. Thanks!


Tuesday, May 28, 2013

MongoDB performance tuning, indexes, explain plan, hints and profiler

PROBLEM:
What you need to know for MongoDB performance tuning?

SOLUTION:
The following links will cover performance tuning, obviously a key aspect of database administration. You can find there how to optimize the performance of operations against a MongoDB database, including both queries and write operations. Indexes of course play a key component in many cases; thus you can find also a talk about MongoDB indexes in detail. You can find there also other performance related features including the explain plan and hint commands and the profiler.

Indexes in MongoDB
https://www.youtube.com/watch?v=a7TrHP1C6qQ

Indexes types
https://www.youtube.com/watch?v=pyoOGhGDoj8

Covered Indexes
https://www.youtube.com/watch?v=boAkBnMUBnw

Hints
https://www.youtube.com/watch?v=oaTm0Kftit8

Read vs. Writes
https://www.youtube.com/watch?v=USDbDotmums

Current Operations and Kill Operations
https://www.youtube.com/watch?v=i7XEKAtRS_M

Profiler
https://www.youtube.com/watch?v=MzLmI8FNB94

Mongostat & Mongotop
https://www.youtube.com/watch?v=fEgl1DT_lDA


If you find this solution useful, you are welcome to press one of the ads in this page.. Thanks!

Wednesday, April 10, 2013

Optimizing MongoDB

PROBLEM:
How to optimize your MongoDB?

SOLUTION:
Here are some tips and tricks for optimizing your MongoDB deployment:

Design an efficient schema
1. When you’re designing your schema for MongoDB, think about the ways that you are going to access your data and the common access patterns. You want to take advantage of MongoDB’s flexible schema and design rich documents
2. A key question when designing a MongoDB schema is when to embed and when to link. Embedding is the nesting of objects and arrays inside a BSON document. Links are references between documents. Embedding is a bit like "prejoined" data. Operations within a document are easy for the server to handle. Links in contrast must be processed client-side by the application; the application does this by issuing a follow-up query.
Generally, for "contains" relationships between entities, embedding should be be chosen. Embedding documents when it should actually be linked would result in duplication of data.

Optimize your queries
Have slow database queries? Get more information on the performance of your queries using the explain feature. Using the mongo shell, invoke the explain() method on a cursor:

> db.collection.find(query).explain()

The result will be a document that contains the explain output:

{
   "cursor" : "BasicCursor",
   "indexBounds" : [ ],
   "nscanned" : 57594,
   "nscannedObjects" : 57594,
   "nYields" : 2 ,
   "n" : 3 ,
   "millis" : 108, 
   "indexOnly" : false,
   "isMultiKey" : false,
   "nChunkSkips" : 0 
}

Know your working set size
Retrieving data in RAM is orders of magnitude faster than disk. Think about the total database size in relation to the set of data that is active at any given point in time. If you want your queries to be fast, make sure that you have enough memory to hold your active working set in RAM.
Don’t forget your indexes. They take up memory too!

More Information

If you find this solution useful, you are welcome to press one of the ads in this page.. Thanks!

Thursday, March 21, 2013

MongoDB Deployment Strategies

PROBLEM:
Ready to deploy MongoDB? Here's what you need to know

SOLUTION:

Use Replication
Replication is the best way to ensure the safety of your data. It is recommended that you use replica sets, a form of asynchronous master/slave replication that adds automatic failover and automatic recovery of member nodes.
More information on replication:
Replica Sets
Best practices for replica sets on EC2

Sharding is there when you need it
If your data exceeds the resources of a single database server, MongoDB can convert to a sharded cluster for horizontal scaling across multiple nodes. With MongoDB sharding, the failover and balancing of nodes is handled automatically, with few or no changes to the original application code.

Deploying in the cloud
MongoDB was designed to run on commodity and virtualized environments. Because it does not depend on high end compute, network or storage resources, your deployment is not limited by the biggest server resources you can get in cloud environments like Amazon EC2 or Rackspace Cloud. You can add additional storage, memory and transaction capacity by adding more virtual servers to your deployment.
Docs: Amazon EC2
Docs: VMware Cloud Foundry
Docs: Red Hat OpenShift
Docs: Windows Azure
Docs: Hosting Center

Monitoring your deployment
MongoDB includes many diagnostic commands and tools, like mongostat, the query profiler, and more. In addition the open source community has built plugins from monitoring tools like Ganglia, munin, and cacti.
In addition, 10gen offers a cloud-based monitoring and alerting solution for MongoDB deployments called MongoDB Monitoring Service (MMS). MMS is a publicly available software-as-a-service solution available at mms.10gen.com.


If you find this solution useful, you are welcome to press one of the ads in this page.. Thanks!





Wednesday, February 27, 2013

Your first MongoDB application

PROBLEM:
What you need to know to build your first MongoDB application?

SOLUTION:
MongoDB Terminology
As you build your first application with MongoDB, you should start by knowing some basic terminology. Here are a few key terms and the equivalent concepts in a relational database:

RDBMSMongoDB
Rows, ViewsDocuments
TablesCollections
IndexIndex
JoinEmbedded Documents
PartitionShard

Data as Documents
One of the major benefits of MongoDB is schema flexibility. In MongoDB, there are no predefined fields, collections can have heterogenous structure across documents, and the fields and their value datatypes can vary. For example, here is how you might model a blog post in MongoDB:

{author: "meghan",
date: new Date(),
text: "MongoDB is great!",
tags: ["mongodb", "intro"]}

As you can see with the tags field in the example above, we have stored an array of strings within our document. And if we want to add another field to our document, we can do so easily. This facility enables you to develop applications iteratively with MongoDB.

Querying
Even though MongoDB is a NoSQL database, you can still access your data with dynamic queries. You'll find that many SQL queries translate easily to MongoDB's document-based query language.
For example, suppose we're using the MongoDB shell and want to return every document in the users collection. Our query would look like this:

db.users.find({})

In this case, our selector is an empty document, which matches every document in the collection. Here's a more selective example:

db.users.find({'last_name': 'Smith'})

Here our selector will match every document where the last_name attribute is 'Smith.'
MongoDB supports a wide array of possible document selectors. For more examples:


For more information
Interested in learning more about building applications with MongoDB? Here are a few resources to get you started:


If you find this solution useful, you are welcome to press one of the ads in this page.. Thanks!