YouTube Icon

Interview Questions.

Top Couchdb Interview Questions And Answers - Dec 29, 2020

fluid

Top Couchdb Interview Questions And Answers

1. Look at CouchDB and MongoDB 

Criteria CouchDB MongoDB
Interface REST/HTTP TCP/IP Custom Protocol
Object Storage Documents in database Database in collections in database
Replication Master-Master Master-Slave

2. What is CouchDB? 

CouchDB is an information base that totally grasps the web. Store your information with JSON records. Access your records and question your lists with your internet browser, through HTTP. Record, consolidate, and change your reports with JavaScript. CouchDB functions admirably with current web and versatile applications. You can even serve web applications straightforwardly out of CouchDB. Also, you can circulate your information, or your applications, productively utilizing CouchDB's gradual replication. CouchDB upholds ace expert arrangements with programmed struggle identification. 

CouchDB accompanies a set-up of highlights, for example, on-the-fly archive change and continuous change notices, that makes web application improvement a breeze. It even accompanies a simple to utilize web organization support. You got it, served up straightforwardly out of CouchDB! We care very much about disseminated scaling. CouchDB is profoundly accessible and parcel open minded, but on the other hand is at last reliable. What's more, we care very much about your information. CouchDB has an issue open minded stockpiling motor that puts the security of your information first. 

3. What Language is CouchDB Written in? 

Erlang, a simultaneous, utilitarian programming language with an accentuation on adaptation to internal failure. Early work on CouchDB was begun in C++ yet was supplanted by Erlang OTP stage. Erlang has so far demonstrated an astounding counterpart for this venture. 

CouchDB's default see worker utilizes Mozilla's Spidermonkey JavaScript library which is written in C. It additionally underpins simple reconciliation of view workers written in any language. 

4. For what reason Does CouchDB Not Use Mnesia? 

A few reasons: 

The first is a capacity restriction of 2 gig for every record. 

The second is that it requires an approval and fixup cycle after an accident or force disappointment, so regardless of whether the size impediment is lifted, the fixup time on enormous records is restrictive. 

Mnesia replication is appropriate for bunching, however not disengaged, conveyed alters. The vast majority of the "cool" highlights of Mnesia aren't generally valuable for CouchDB. 

Additionally Mnesia isn't generally a universally useful, enormous scope information base. It works best as a setup type information base, the sort where the information isn't key to the capacity of the application, yet is important for the typical activity of it. Think things like organization switches, HTTP intermediaries and LDAP catalogs, things that should be refreshed, arranged and reconfigured regularly, yet that setup information is once in a while huge. 

5. How would I use exchanges with CouchDB? 

CouchDB utilizes an "hopeful simultaneousness" model. In the easiest terms, this fair implies that you send an archive form alongside your update, and CouchDB rejects the change if the current report variant doesn't coordinate what you've sent.It's misleadingly basic, truly. You can reexamine numerous typical exchange based situations for CouchDB. You do have to kind of toss out your RDBMS space information when learning CouchDB, however. It's useful to move toward issues from a more significant level, instead of endeavoring to form Couch to a SQL based world.Keeping track of inventoryThe issue you plot is basically a stock issue. In the event that you have an archive depicting a thing, and it incorporates a field for "amount accessible", you can deal with simultaneousness issues this way: 

Recover the report, observe the _rev property that CouchDB sends along 

Decrement the amount field, if it's more prominent than zero 

Send the refreshed report back, utilizing the _rev property 

On the off chance that the _rev matches the as of now put away number, be finished! 

On the off chance that there's a contention (when _rev doesn't coordinate), recover the freshest record rendition 

In this occurrence, there are two potential disappointment situations to consider. In the event that the latest archive rendition has an amount of 0, you handle it simply like you would in a RDBMS and caution the client that they can't really purchase what they needed to buy. In the event that the latest record rendition has an amount more prominent than 0, you basically rehash the activity with the refreshed information, and start back toward the start. This powers you to do a smidgen more work than a RDBMS would, and could get a bit of irritating if there are continuous, clashing updates. 

Presently, the appropriate response I just gave surmises that you will get things done in CouchDB similarly that you would in a RDBMS. I may move toward this issue a piece in an unexpected way: 

I'd start with a "ace item" record that incorporates all the descriptor information (name, picture, depiction, cost, and so forth) At that point I'd add an "stock ticket" archive for every particular occurrence, with fields for product_key and claimed_by. In case you're selling a model of sledge, and have 20 of them to sell, you may have records with keys like mallet 1, hammer-2, and so on, to speak to each accessible mallet. 

At that point, I'd make a view that gives me a rundown of accessible mallets, with a lessen work that allows me to see a "all out". These are totally spur of the moment, yet should give you a thought of what a working perspective would resemble. 

Map

function(doc)
{
if (doc.type == ‘inventory_ticket’ && doc.claimed_by == null ) {
emit(doc.product_key, { ‘inventory_ticket’ :doc.id, ‘_rev’ : doc._rev });
}
}
This gives me a list of available “tickets”, by product key. I could grab a group of these when someone wants to buy a hammer, then iterate through sending updates (using the id and _rev) until I successfully claim one (previously claimed tickets will result in an update error).

Reduce

function (keys, values, combine) {
return values.length;
}

This decrease work basically restores the all out number of unclaimed inventory_ticket things, so you can tell the number of "hammers" are accessible for procurement. 

Provisos 

This arrangement speaks to generally 3.5 minutes of absolute intuition for the specific issue you've introduced. There might be better methods of doing this! All things considered, it does significantly diminish clashing updates, and eliminates the need to react to a contention with another update. Under this model, you won't have various clients endeavoring to change information in essential item section. Best case scenario, you'll have numerous clients endeavoring to guarantee a solitary ticket, and in the event that you've snatched a few of those from your view, you just proceed onward to the following ticket and attempt again . 

6. How would you think about MongoDB, CouchDB and CouchBase? 

MongoDB and CouchDB are report arranged information base. MongoDB and CouchDB are the most commonplace agent of the open source NoSQL information base. They don't share anything for all intents and purpose other than are put away in the record outside. MongoDB and CouchDB, the information model interface, object stockpiling and replication techniques have various. 

7. How is PouchDB unique in relation to CouchDB? 

PouchDB is additionally a CouchDB customer, and you should have the option to switch between a nearby information base or an online CouchDB case without changing any of your application's code. 

Notwithstanding, there are some minor contrasts to note: 

View Collation – CouchDB utilizes ICU to arrange keys in a view question; in PouchDB they are ASCII requested. 

View Offset – CouchDB restores a counterbalance property in the view results. In PouchDB, counterbalance just mirrors the skip boundary as opposed to restoring a genuine balance. 

8. So is CouchDB currently going to written in Java? 

Erlang is an extraordinary fit for CouchDB and I have positively no designs to get the venture off its Erlang base. IBM/Apache's just concerns are we eliminate permit contradictory outsider source code packaged with the task, a basic prerequisite for any Apache project. So a few things may need to supplanted in the source code (perhaps Mozilla Spidermonkey), yet the center Erlang code remains. 

A significant objective is to keep interfaces in CouchDB straightforward enough that making viable executions on different stages is plausible. CouchDB has just motivated the information base tasks RDDB and Basura. Like SQL information bases, I think CouchDB needs rivalry and an environment to be practical long haul. So Java or C++ forms may be made and I would be pleased to see them, however it probably won't be me who does it. 

9. What does IBM's inclusion mean for CouchDB and the network? 

The principle results of IBM's inclusion are: 

– The code is presently being apache authorized, rather than GPL. 

– Damien will be contributing considerably more time! 

10. Notice the primary highlights of CouchDB? 

JSON Documents – Everything put away in CouchDB reduces to a JSON archive. 

Peaceful Interface – From creation to replication to information inclusion, each administration and information task in CouchDB should be possible through HTTP. 

N-Master Replication – You can utilize a limitless measure of 'aces', making for some intriguing replication geographies. 

Worked for Offline – CouchDB can repeat to gadgets (like Android telephones) that can go disconnected and handle information sync for you when the gadget is back on the web. 

Replication Filters – You can channel correctly the information you wish to recreate to various hubs.

11. What is the utilization of CouchDB? 

CouchDB permits you to compose a customer side application that discussions straightforwardly to the Couch without the requirement for a worker side center layer, altogether decreasing improvement time. With CouchDB, you can without much of a stretch handle interest by adding more replication hubs effortlessly. CouchDB permits you to reproduce the information base to your customer and with channels you could even recreate that particular client's information. 

Having the information base put away locally implies your customer side application can run with basically no inertness. CouchDB will deal with the replication to the cloud for you. Your clients could get to their solicitations on their cell phone and make changes with no observable inertness, all while being disconnected. At the point when an association is available and usable, CouchDB will consequently imitate those progressions to your cloud CouchDB. 

CouchDB is an information base intended to run on the web of today for the present work area like applications and the associated gadgets through which we access the web. 

12. What is CouchdbKit? 

Couchdbkit will probably give a system to your Python application to get to and oversee Couchdb. It gives you a full included and simple customer to get to and oversee CouchDB. It permits you to deal with a CouchDB worker, information bases, doc administrations and view access. All items generally reflect python objects for accommodation. Worker and Databases items could be utilized for instance as simple as utilizing a dict.

 




CFG