NOSQL Interview Questions for Freshers/NOSQL Interview Questions and Answers for Freshers & Experienced

Explain the feature “Tunable Consistency” in detail

This is one of the most awaited characteristics which stood as an essential preference by most of the Analysts, Developers and Big Data Architects. The main function of “Tunable consistency” is that is synchronizes and keeps all the data rows on their respective replicas up to date. This consistency level can be opted by the users as per their preference and requirement. There are two types of consistencies present in Cassandra namely – Strong consistency and Eventual consistency.

Can you explain CAP theorem and the applications of CAP theorem?

In the year 2000, Eric Brewer discovered the CAP theorem which provides three main benefits to the NoSQL database management system and they are as follows:

Consistency – Through this benefit, every node can view the same data at a single point of time.

Availability – Every request will get an instant response whether it will become successful or not.

Partition Tolerance – This benefit is actually highly crucial as it will continue the work even if some of the practices or in error or if it is not working.

Explain how NoSQL database budget memory in detail

Replication node is the type of node that manages the data that are stored in the NoSQL database and it is also known as the memory consumer. The performance is calculation with the help of the java heap and the cache size that are found in the replication node. And, these two factors are calculated by NoSQL by means of memory that is available to a specific storage node where the specification for the memory of the storage node is highly required. If the storage node has more than one replication node, then the memory will be evenly scattered among the various replication node present.

Explain how NoSQL database budget memory in detail

Because MongoDB uses memory-mapped files so when you run a 32-bit build of MongoDB, the total storage size of the server is 2 GB. But when you run a 64-bit build of MongoDB, this provides virtually unlimited storage size. So 64-bit is preferred over 32-bit.

How to do Transaction/locking in MongoDB?

MongoDB doesn’t use traditional locking or complex transaction with Rollback. MongoDB is designed to be lightweight, fast and predictable to its performance. It keeps transaction support simply to enhance performance.

Can you explain the transaction support by using a BASE in NoSQL?

The CAP theorem states that distributed systems cannot achieve all three properties at the same time; consistency, availability and partition tolerance. The BASE system gives up on consistency while maintaining the other two. The BASE system works well despite physical network partitions and always allow a client with reading and write availability.

BASE stands for:
* Basically Available
* Soft state
* Eventual consistency

List out some of the pros of graph database

The main advantages of graph database are as follows:

* Graph database is highly preferred to implement successful networking applications
* It can also support any of the object-oriented system with high efficiency

What do you mean by graph databases? Explain in detail

Graph database is one of the special types of NoSQL database where graphical representations are highly used. The main aim of graph database is to store valuable relationships between specific nodes.

How Does NoSQL relate to big data?

NoSQL databases are designed with “Big Data” needs in mind. Since they are not bound by a fixed schema model, this makes them suitable for today’s business needs where there is a large volume of non-uniform data (Big Data).

Explain the structure of ObjectID in MongoDB.

ObjectID is a 12-byte BSON type. These are:

1. 4 bytes value representing seconds
2. 3-byte machine identifier
3. 2-byte process id
4.3 byte counter

Can you achieve primary key – foreign key relationships in MongoDB?

We can achieve the primary key-foreign key relationships by embedding one document inside another. For example, An address document can be embedded inside the customer documents.

Is MongoDB better than other SQL databases? If yes then how?

MongoDB is better than other SQL databases because it allows a highly flexible and scalable document structure.

For example:
One data document in MongoDB can have five columns and the other one in the same collection can have ten columns.
MongoDB database is faster than SQL databases due to efficient indexing and storage techniques.

What are the different types of NoSQL databases? Give some examples.

NoSQL database can be classified as 4 basic types:

1. Key-value store NoSQL database
2.Document store NoSQL database
3.Column store NoSQL database
4. Graph-based NoSQL database

There are many NoSQL databases. MongoDB, Cassandra, CouchDB, Hypertable, Redis, Riak, Neo4j, HBase, Couchbase, MemcacheDB, Voldemort, RevenDB, etc. are examples of NoSQL databases.

What do you mean by eventual consistency in NoSQL stores?

Eventual consistency in NoSQL means that when all the service logics have been executed, the system is left in a consistent state. For achieving high availability, this concept is used in the distributed systems. It gives a guarantee that, if new updates are not made to a given data item, then eventually all accesses to that item will return the last updated value. In NoSQL, it is provided in terms of BASE and RDMS are also known as the ACID properties. Present NoSQL databases provide client applications with a guarantee of eventual consistency. Some NoSQL databases like- MongoDB and Cassandra are eventually consistent in some of the configurations.

What is the CAP Theorem? How is it applicable to NoSQL systems?

The CAP theorem was proposed by Eric Brewer in early 2000. In this, three system attributes have been discussed within the distributed databases. That is-
Consistency- in this, all the nodes see the same data at the same time.
Availability- it gives us a guarantee that there will be a response for every request made to the system about whether it was successful or not.
Partition tolerance- it is the quality of the NoSQL database management system which states that the system will work even if a part of the system has failed or is not working.

List the different kinds of NoSQL data stores?

The variety of NoSQL data stores available which are widely distributed are categorized into four categories. They are: –
Key-value store– it is a simple data storage key system that uses keys to access different values.
Column family store– it is a sparse matrix system. It uses columns and rows as keys.
Graph store– it is used in case of relationships-intensive problems.
Document stores- it is used for storing hierarchical data structures directly in the database.

What are the pros and cons of a graph database under NoSQL databases?

Following are the pros and cons of a graph database which is a type of NoSQL databases: –
Pros of using graph database:
These are tailor-made for networking applications. A social network is a good example of this.
They can also be perfect for an object-oriented programming system.
Cons of using graph database:
Since the degree of interconnection between nodes is high in the graph database, so it is not suitable for network partitioning.
Also, graph databases don’t scale out well in NoSQL databases.

Does MongoDB need a lot of RAM?

No. There is no need a lot of RAM to run MongoDB. It can be run even on a small amount of RAM because it dynamically allocates and de-allocates RAM according to the requirement of the processes.

Can you achieve primary key - foreign key relationships in MongoDB?

We can achieve primary key-foreign key relationship by embedding one document inside another. For example: An address document can be embedded inside customer document.

What are the major challenges with traditional RDBMS?

Following are some of the major challenges with RDBMS systems:

* Not optimized to scale out: RDBMS systems are not optimized for horizontal scaling out.

* Not able to handle unstructured data: RDBMS systems are not able to handle schema-less data (semi-structured or unstructured)

* Costly: There is a high licensing cost for data analysis with RDBMS systems.
Not able to handle the high velocity of data ingestion: RDBMS systems are designed for steady data retention.

What is the CAP theorem? How is it applicable to NoSQL systems?

This is the frequently asked NoSQL Interview Questions in an interview.CAP theorem states that there are three basic requirements for an application with distributed architecture:

* Consistency: Data in the database must be consistent before and after the execution of any operation. For example, after an update operation, every user should see the same data.
* Availability: The system should always be up and running; there should be no downtime.
* Partition Tolerance: The system should work even if the communication among the servers is unreliable.

Theoretically, it is not possible to achieve all three requirements. CAP theorem allows distributed systems to follow any two of these requirements. Since partition tolerance is mandatory for distributed databases. Thus, we are left only with CP (Consistency, Partition tolerance) and AP (availability, Partition tolerance).

What are the advantages of NoSQL?

NoSQL databases come with a lot of benefits when compared to RDBMS. This benefits list include:

* NoSQL databases come with scale-out architecture instead of monolithic architecture. It helps to handle massive volumes of data efficiently.
* NoSQL databases can store unstructured, semi-structured and structured data which is easier to understand and use by enterprise applications.
* Developers can easily update the schema and fields. You can add any new document easily without affecting the existing structure.
* NoSQL databases are developer friendly as they need less transformations before using them in the applications.

Many NoSQL databases not only support easy scale-out architecture but they also allow you to change the structure of the database with Zero Downtime.

What is a Graph Database (GDB)?

Graph Database is a specialized, single-purpose database to store and navigate relationships. Graph database is derived from the concept of Graph where nodes are used to store entity information and edges store the relationships. Graph databases use cases include Credit card fraud detection, Social media analysis etc.

What is the Column store database?

Columnar column-oriented, column-family databases store the data table in the form of columns rather than by rows. Columnar databases are optimized for fast retrieval of columns from databases similar to how RDBMS is optimized for fast retrieval of rows. Amazon Redshift, Apache Cassandra are the examples of columnar databases. Column-wide databases are typically used for analytical applications as Column-wide nature of storage helps to load less data with less Disk I/O requirements.

What is sharding in nosql?

Sharding in NOSQL is the process of storing data records across multiple machines.It is a partitioning pattern in which each shard is held on a separate database server instance, to spread load and provide fast data access.

What do you understand by Polyglot Persistence in NoSQL?

While storing data, it is advisable to choose multiple data storage systems so that the system allows us to store various data in our future. This is a safer type of data storage system because we do not want to risk on single data storage system. This type of storage is called as polyglot persistence in NoSQL.

What do you mean by eventual consistency in NoSQL stores?

Eventual consistency in NoSQL means that when all the service logics have been executed, the system is left in a consistent state. For achieving high availability, this concept is used in the distributed systems. It gives a guarantee that, if new updates are not made to a given data item, then eventually all accesses to that item will return the last updated value. In NoSQL, it is provided in terms of BASE and RDMS also known as ACID properties. Present NoSQL databases provide client applications with guarantee of eventual consistency. Some NoSQL databases like- MongoDB and Cassandra are eventually consistent in some of the configurations.

What is CAP theorem? How is it applicable to NoSQL systems?

The CAP theorem was proposed by Eric Brewer in early 2000. In this, three system attributes have been discussed within the distributed databases. That is-

* Consistency- in this, all the nodes see the same data at the same time.

* Availability- it gives us a guarantee that there will be a response for every request made to the system about whether it was successful or not.

* Partition tolerance- it is the quality of NoSQL database management system which states that the system will work even if a part of the system has failed or is not working.

A distributed database system might provide only 2 of the 3 above qualities.

List the different kinds of NoSQL data stores?

The variety of NoSQL data stores available which are widely distributed are categorized into four categories. They are: –

* Key value store- it is a simple data storage key system which uses keys to access different values.

* Column family store- it is a sparse matrix system. It uses columns and rows as keys.

* Graph store- it is used in case of relationships-intensive problems.

* Document stores- it is used for storing hierarchical data structures directly in the database.

In NoSQL, what do you mean by “Polyglot persistence”?

It is advisable to use several data storage systems when saving data so that the system can store a variety of data in the future. We don’t want to take a chance on a single data storage system, therefore this is a simple option. Polyglot persistence is the name given to this sort of storage in NoSQL.

Explain the distinctions between NoSQL and RDBMS.

The following are some of the distinctions between NoSQL and RDBMS –

* In terms of data format, no SQL does not adhere to any particular order. When it comes to the format of its data, RDBMS is more ordered and systematic.

* In terms of scalability, NoSQL is far superior and more scalable. I DBMS, on the other hand, is average and less scalable than NoSQL.

* Since NoSQL does not include a joint clause, it is restricted in terms of data querying. I DBMS, on the other hand, can imply querying since it uses the structured query language.

What different types of NoSQL Databases are you aware of?

There are 4 most common types of NoSQL databases as below.

* Key-value databases
* Document databases
* Wide-column or Column-family databases
* Graph databases stores

What exactly do you mean when you say “eventual consistency” about NoSQL databases?

NoSQL, eventual consistency implies that the system is left in a consistent state after all of the service logic has been completed. This idea is utilized in distributed systems to achieve high availability. It ensures that if no new changes I made to a particular item, all access to that item will ultimately return the last modified value. It is expressed in terms of BASE and RDMS, which are also known as ACID characteristics in NoSQL

Client applications may now rely on eventual consistency thanks to no SQL databases. Mongo DB and Cassandra are two NoSQL databases that are eventually consistent in various start-ups.

Explain Oracle NoSQL database?

The Oracle NoSQL Database is a distributed key-value database. It is designed to provide highly reliable, scalable and available data storage across a configurable set of systems that function as storage nodes.Data is stored as key-value pairs, which are written to particular storage node(s), based on the hashed value of the primary key. Storage nodes are replicated to ensure high availability, rapid failover in the event of a node failure and optimal load balancing of queries. Customer applications are written using an easy-to-use Java/C API to read and write data.
Oracle NoSQL Driver links with the customer application, providing access to the data via appropriate storage node for the requested key. A web based console as well as command line interface is available for easy administration of the cluster.

How does column-oriented NoSQL differ from document-oriented?

The main difference is that document stores (e.g. MongoDB and CouchDB) allow arbitrarily complex documents, i.e. subdocuments within subdocuments, lists with documents, etc. whereas column stores (e.g. Cassandra and HBase) only allow a fixed format, e.g. strict one-level or two-level dictionaries.

For example a document-oriented database (like MongoDB) inserts whole documents (typically JSON), whereas in Cassandra (column-oriented db) you can address individual columns or supercolumns, and update these individually, i.e. they work at a different level of granularity. Each column has its own separate timestamp/version (used to reconcile updates across the distributed cluster).

The Cassandra column values are just bytes, but can be typed as ASCII, UTF8 text, numbers, dates etc. You could use Cassandra as a primitive document store by inserting columns containing JSON - but you wouldn't get all the features of a real document-oriented store.

What does Document-oriented vs. Key-Value mean in context of NoSQL?

A key-value store provides the simplest possible data model and is exactly what the name suggests: it's a storage system that stores values indexed by a key. You're limited to query by key and the values are opaque, the store doesn't know anything about them. This allows very fast read and write operations (a simple disk access) and I see this model as a kind of non volatile cache (i.e. well suited if you need fast accesses by key to long-lived data).

A document-oriented database extends the previous model and values are stored in a structured format (a document, hence the name) that the database can understand. For example, a document could be a blog post and the comments and the tags stored in a denormalized way. Since the data are transparent, the store can do more work (like indexing fields of the document) and you're not limited to query by key. As I hinted, such databases allows to fetch an entire page's data with a single query and are well suited for content oriented applications (which is why big sites like Facebook or Amazon like them).

What are the pros and cons of a graph database under NoSQL databases?

Following are the pros and cons of a graph database which is a type of NoSQL databases: –

Pros of using graph database:

* These are tailor-made for the networking applications. A social network is a good example of this.

They can also be perfect for an object-oriented programming system.
Cons of using graph database:

* Since the degree of interconnection between nodes is high in graph database, so it is not suitable for network partitioning.

* Also, graph databases don’t scale out well in NoSQL databases.

Explain Oracle NoSQL database management system?

The NoSQL database management system is a distributed key-value database. It is designed so that it can provide highly reliable and scalable data. It can make the data storage available across all the configurable set of systems which functions as storage nodes. In this database system, data is stored as key-value pairs. This data is written to a particular storage node. These databases provide a mechanism for the storage and retrieval of data which is composed in a way other than the tabular method which was used in the relational databases.

When would you use NoSQL?

It depends from some general points:

* NoSQL is typically good for unstructured/"schemaless" data - usually, you don't need to explicitly define your schema up front and can just include new fields without any ceremony.

* NoSQL typically favours a denormalised schema due to no support for JOINs per the RDBMS world. So you would usually have a flattened, denormalized representation of your data.

* Using NoSQL doesn't mean you could lose data. Different DBs have different strategies. e.g. MongoDB - you can essentially choose what level to trade off performance vs potential for data loss - best performance = greater scope for data loss.

* It's often very easy to scale out NoSQL solutions. Adding more nodes to replicate data to is one way to a) offer more scalability and b) offer more protection against data loss if one node goes down. But again, depends on the NoSQL DB/configuration. NoSQL does not necessarily mean "data loss" like you infer.

* IMHO, complex/dynamic queries/reporting are best served from an RDBMS. Often the query functionality for a NoSQL DB is limited.

* It doesn't have to be a 1 or the other choice. My experience has been using RDBMS in conjunction with NoSQL for certain use cases.
NoSQL DBs often lack the ability to perform atomic operations across multiple "tables".

Explain difference between scaling horizontally and vertically for databases

* Horizontal scaling means that you scale by adding more machines into your pool of resources whereas

* Vertical scaling means that you scale by adding more power (CPU, RAM) to an existing machine.

In a database world horizontal-scaling is often based on the partitioning of the data i.e. each node contains only part of the data, in vertical-scaling the data resides on a single node and scaling is done through multi-core i.e. spreading the load between the CPU and RAM resources of that machine.

Good examples of horizontal scaling are Cassandra, MongoDB, Google Cloud Spanner. and a good example of vertical scaling is MySQL - Amazon RDS (The cloud version of MySQL).

What is the difference between NoSQL & Mysql DBs’?

NoSQL databases are becoming a major part of the database landscape today, and with their handful of advantages, they can be a real game changer in the enterprise arena. However, NoSQL isn’t ripe yet, and professionals in the industry need to approach it with caution.

This is because it lacks the maturity that SQL databases like MySQL offer. If your application doesn’t fall into the category of the likes of Google, Yahoo, Facebook or Wikipedia, you should reconsider your options for using NoSQL and stick with MySQL instead. Not only is there a major skills gap with finding NoSQL professionals, but issues like analytics, performance reporting and migration also need to be considered.

What are the advantages of NoSQL over traditional RDBMS?

NoSQL is better than RDBMS because of the following reasons/properities of NoSQL:

<> It supports semi-structured data and volatile data
<> It does not have schema
<> Read/Write throughput is very high
<> Horizontal scalability can be achieved easily
<> Will support Bigdata in volumes of Terra Bytes & Peta Bytes
<> Provides good support for Analytic tools on top of Bigdata
<> Can be hosted in cheaper hardware machines
<> In-memory caching option is available to increase the performance of queries
<> Faster development life cycles for developers


Still, RDBMS is better than NoSQL for the following reasons/properties of RDBMS:

<> Transactions with ACID properties - Atomicity, Consistency, Isolation & Durability
<> Adherence to Strong Schema of data being written/read
<> Real time query management ( in case of data size < 10 Tera bytes )
<> Execution of complex queries involving join & group by clauses

Does NoSQL Database Interact With Oracle Database?

NoSQL Database supports retrieving records through the Oracle Database External Table functions. This makes it possible to perform some queries from Oracle Database and retrieve records from NoSQL Database.

Explain Oracle NoSQL database management system?

The NoSQL database management system is a distributed key-value database. It is designed so that it can provide highly reliable and scalable data. It can make the data storage available across all the configurable set of systems which functions as storage nodes. In this database system, data is stored as key-value pairs. This data is written to a particular storage node. These databases provide a mechanism for the storage and retrieval of data which is composed in a way other than the tabular method which was used in the relational databases.

How does NoSQL database management system budget memory?

The node which manages the data in the NoSQL database store is the replication node. It is also the main consumer of the memory. The java heap and the cache size which are used by the replication node are the important factors in terms of performance. By default, these two things are calculated by NoSQL in terms of the amount of memory available to the storage node. Specification of the available memory for a storage node is recommended. The memory will be evenly divided between all the RN’s if the storage node hosts more than one replication node.

What are advantages and disadvantages of NoSQL?

Advantages of NoSQL

>> Using the new node concepts, the database of NoSQL can be expanded to the set limit. Low commodity hardware takes this point as an added advantage.
>> NoSQL databases are used to store a massive volume of information. Big data and recently posted user reviews utilize the concept of NoSQL.
>> There is no expensive administration required to monitor the database of NoSQL.

>> NoSQL can be installed with cheap economy instead of spending money on complicated systems.

Disadvantages of NoSQL

>> Since NoSQL is a new technology of database storage, there are many other systems in the market which are already leading in the market.
>> The previously built systems have the support available round the clock, but the NoSQL support system is less comparatively.
>> Since NoSQL is a new technology, it is not supporting the old commands that are used in the system.

How does NoSQL DB budget memory?

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.

Explain “Polyglot Persistence” in NoSQL?

In 2006, Neal Ford coined the term polyglot programming, to express the idea that applications should be written in a mix of languages to take advantage of the fact that different languages are suitable for tackling different problems.

Complex applications combine different types of problems, so picking the right language for each job may be more productive than trying to fit all aspects into a single language.Similarly, when working on an e-commerce business problem, using a data store for the shopping cart which is highly available and can scale is important, but the same data store cannot help you find products bought by the customers’ friends—which is a totally different question. We use the term polyglot persistence to define this hybrid approach to persistence.

Explain the difference between NoSQL v/s Relational database?

The history seem to look like this:
Google needs a storage layer for their inverted search index. They figure a traditional RDBMS is not going to cut it. So they implement a NoSQL data store, BigTable on top of their GFS file system. The major part is that thousands of cheap commodity hardware machines provides the speed and the redundancy.Everyone else realizes what Google just did.Brewers CAP theorem is proven. All RDBMS systems of use are CA systems. People begin playing with CP and AP systems as well. K/V stores are vastly simpler, so they are the primary vehicle for the research.

Software-as-a-service systems in general do not provide an SQL-like store. Hence, people get more interested in the NoSQL type stores.I think much of the take-off can be related to this history. Scaling Google took some new ideas at Google and everyone else follows suit because this is the only solution they know to the scaling problem right now. Hence, you are willing to rework everything around the distributed database idea of Google because it is the only way to scale beyond a certain size.Get to know more about this NoSQL vs. SQL – What is Better? that can help you grow in your career.

What are the features of NoSQL?

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:

* Large volumes of structured, semi-structured, and unstructured data
* Agile sprints, quick iteration, and frequent code pushes
* Object-oriented programming that is easy to use and flexible
* Efficient, scale-out architecture instead of expensive, monolithic architecture

What is NoSQL?

NoSQL encompasses a wide variety of different database technologies that were developed in response to a rise in the volume of data stored about users, objects and products. The frequency in which this data is accessed, and performance and processing needs. Relational databases, on the other hand, were not designed to cope with the scale and agility challenges that face modern applications, nor were they built to take advantage of the cheap storage and processing power available today.

Search
R4R Team
R4R provides NOSQL Freshers questions and answers (NOSQL Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,NOSQL Interview Questions for Freshers,NOSQL Freshers & Experienced Interview Questions and Answers,NOSQL Objetive choice questions and answers,NOSQL Multiple choice questions and answers,NOSQL objective, NOSQL questions , NOSQL answers,NOSQL MCQs questions and answers Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for NOSQL fresher interview questions ,NOSQL Experienced interview questions,NOSQL fresher interview questions and answers ,NOSQL Experienced interview questions and answers,tricky NOSQL queries for interview pdf,complex NOSQL for practice with answers,NOSQL for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .