|Data format||Does not follow any order||Organized and structured|
|Querying||Limited as no Join Clause||Using SQL|
|Storage mechanism||Key-Value Pair, document, column storage, etc.||Data & relationship stored in different tables|
When compared to relational databases, NoSQL databases are more scalable and provide superior performance, and their data model addresses several issues that the relational model is not designed to address:
Learn No sql in 8 hrs. Download e-book now
The Replication Node manages the data in a NoSQL DB store and is the main consumer of memory. The Java heap and cache size used by the Replication Node can be important performance factors. By default, the Replication Node heap and cache are calculated by NoSQL DB based on the amount of memory available to the Storage Node.We recommend that you specify the available memory for a Storage Node using the -memory_mb flag for makebootconfig, or the memory_mb Storage Node parameter. If you do not define memory_mb, it will default to the memory available on the node. NoSQL DB will then use 85% of memory_mb as the heap for the Replication Node processes hosted by that Storage Node. If the Storage Node hosts more than one Replication Node, the memory will be divided evenly between all RNs. If the number of Replication Nodes on a Storage Node changes, the per-RN memory will be recalculated dynamically. The percentage used for heap is controlled by the rnHeapPercent Storage Node parameter. You can choose to override the default value of 85%.Each Replication Node uses a cache, and the size of that cache defaults to 70% of the Replication Node heap. You can override the 70% default by setting the rnCachePercent Replication Node parameter.The Replication Node heap can also be specified directly by setting the -Xmx in the Replication Node javaMiscParams parameter. Likewise, the Replication Node cache can be set directly with the cache Size Replication Node parameter. While that’s possible, it’s advisable to use the Storage Node memory_mb setting.
As an example, suppose you specify that a Storage Node may use 3000 MB of memory, by setting memory_mb to 3000. If that Storage Node hosts two Replication Nodes, the heap for each RN will be (3000 * .85)/2 = 1275MB. Each RN cache will be (1275 * .70) = 892MB.
You may find that you want to build the same NoSQL DB configuration repeatedly for testing purposes. The Admin CLI commands can be scripted in several ways.Many uses of the Admin CLI are simple commands, such as java -jar kvstore.jar makebootconfig to initially configure a StorageNode, shown above. These are as amenable to scripting as any other UNIX commands and will not be discussed further here.The interactive commands available in java -jar kvstore.jar runadmin, among which are those used to create and execute plans, can be scripted in two ways. You can create a file containing the sequence of commands that you want to run, and run them in a batch using java -jar kvstore.jar runadmin load -file <script>.For example, a script file named deploy.kvs could contain commands such as the following:
configure -name mystore
plan deploy-datacenter -name boston -rf 3 -wait
plan deploy-sn -dcname boston -host localhost -port 5000 -wait
plan deploy-admin -sn sn1 -port 5001 -wait
You could execute this script by issuing the command
java -jar kvstore.jar runadmin -host localhost -port 5000 load -file
Another way to script commands is to run individual CLI commands as separate shell command lines. Trailing arguments in this command line are considered to be a single CLI command.
This usage mode lets you use features of a more capable scripting language, such as a UNIX shell, and provides more flexibility for integrating NoSQL DB commands with other commands that are not available in the the interactive java -jar kvstore.jar runadmin environment.
The same sequence of commands as those from the example above could be couched in a shell script this way:
#!/bin/sh HOST=localhost PORT=5000 HTTPPORT=5001 KVADMIN=”java -jar lib/kvstore.jar runadmin -host $HOST -port $PORT” # Each CLI command that follows “$KVADMIN” is executed in a new invocation of runadmin $KVADMIN configure -name mystore $KVADMIN plan deploy-datacenter -name boston -rf 3 -wait $KVADMIN plan deploy-sn -dcname boston -host localhost -port $PORT -wait $KVADMIN plan deploy-admin -sn sn1 -port $HTTPPORT –wait
Download latest questions asked on No Sql in top MNC's ?