Showing posts with label NOSQL. Show all posts
Showing posts with label NOSQL. Show all posts

Tuesday, 18 August 2015

Installing Cassandra on ubantu

Standard




Prerequisite already installed Java

java -version
echo $JAVA_HOME
 
 

 Installing Cassandra
To install Cassandra, download the binary files from the website, unpack them and move it to your personal folder:

cd ~/temp
wget http://www.us.apache.org/dist/cassandra/1.2.16/apache-cassandra-1.2.16-bin.tar.gz
tar -xvzf apache-cassandra-2.2.0-bin.tar.gz
 
 mv apache-cassandra-2.2.0 ~/cassandra
 
Next, make sure that the folders Cassandra accesses, such as the log folder, exists and that Cassandra has the right to write on it:

sudo mkdir /var/lib/cassandra
sudo mkdir /var/log/cassandra
sudo chown -R $USER:$GROUP /var/lib/cassandra
sudo chown -R $USER:$GROUP /var/log/cassandra
 
Now set Cassandra’s variables by running:
export CASSANDRA_HOME=~/cassandra
export PATH=$PATH:$CASSANDRA_HOME/bin
 
You’re going to need to configure Cassandra’s per-thread stack size to a larger one than default. Do so by running:

nano ~/cassandra/conf/cassandra-env.sh
 
and scrolling down to the line that says:

JVM_OPTS="$JVM_OPTS -Xss180k"
and changing it to:
JVM_OPTS="$JVM_OPTS -Xss280k"
like the image below:
Simply press CTRL+O to save and CTRL+X to exit.


Running Cassandra
To run a single-node test cluster of Cassandra, you aren’t going to need to change anything on the cassandra.yaml file. Simply run:
sudo sh ~/cassandra/bin/cassandra
 
and then run:
sudo sh ~/cassandra/bin/cassandra-cli
and if it says "Connected to: 'Test Cluster'" as it does on the image below, you are now running your single-node cluster.

Monday, 10 August 2015

Limitations of MongoDB

Standard






1    No support for two phase commit transactions.   
2    Atomicity and transactions   
3    Max document size: 16 MB ( Using gridfs. It allows to store documents in chunks. Here's the link: http://docs.mongodb.org/manual/reference/gridfs/)
4    Max document nesting level: 100   
5    Namespace is limited to ~123 chars    
6    DB name is limited to 64 char   
7    Default .ns file can store about 24000 namespaces   
8    If you index some field, that field can’t contain more than 1024 bytes   
9    Max 64 indexes per collection   
10    Max 31 fields in a compound index   
11    Fulltext search and geo indexes are mutually exclusive (you can’t use both in the same query)   
12    If you set a limit of documents in a capped collection, this limit can’t be more than 2**32. Otherwise, number of documents is unlimited.   
13    Max 12 nodes in a replica set    Replica sets are the preferred replication mechanism in MongoDB. However, if your deployment requires more than 12 nodes, you must use master/slave replication.
14    Max 7 voting nodes in a replica set    A replica set can have up to 12 members, but can have at most only 7 voting members. If you need more than 7 members in one replica set, set votes to 0 for the additional non-voting members.
15    You can’t automatically rollback more than 300 MB of data. If you have more than this, manual intervention is needed.   
16    group command doesn’t work in sharded cluster.   
17    db.eval() doesn’t work on sharded collections. Works on unsharded, though   
18    $isolated, $snapshot, geoSearch don’t work in a sharded cluster.   
19    You can’t refer db object in $where functions.   
20    If you want to shard a collection, it must be smaller than 256 GB, or else it will likely fail to shard.   
21    Individual (not multi) updates/removes in a sharded cluster must include shard key. Multi versions of these commands may not include shard key.   
22    Max 512 bytes for shard key values   
23    You can’t change shard key for a collection once it’s sharded.   
24    You can’t change value of a shard key of a document.   
25    aggregate/$sort produces error if sorting takes more than 10 percent of RAM   
26    You can’t use $or in 2d geo queries   
27    You better not use queries with multiple $in parts. If this results in more than 4 million combinations - you get error.   
28    Database names are case-sensitive (even on case-insensitive file systems)   
29    Forbidden characters in database names: linux - /. “, windows - /. “*<>:|?   
30    Forbidden characters in collection names: $ sign, “system.” prefix   
31    Forbidden characters in field names: .$   
32    Hashed index can’t be unique   
33    Max connection number is hardcoded to 20k.   
34    here are some  restrictions, like the allowed characters in object field names.   
35    Read/write lock is currently global level   
36     No joins across collections   
37    No referential integrity support   
38    Map / Reduce and aggregation are single-threaded. To be more specific, one per mongod process.   
39    12-node limit to the replica-set strategy   
40    The 32 bit version of MongoDB is also considered deprecated because it can only handle 2 Gb of data   
41    http://docs.mongodb.org/manual/reference/limits/   
42     Starting from version 2.6, MongoDB will not create an index if the value of existing index field exceeds the index key limit.