September and October quit peak, interviewing essential Redis + MongoDB often face questions asked 80

Foreword

With "Golden September and Silver October," said the recruiting season is open, switch to the peak period also come to the party.

This article primarily a Raiders Redis + MongoDB knowledge, hoping to help to you.

More content, everyone is ready to be patient and seeds of mineral water.

Redis

memcached and redis What is the difference? Why sometimes complicated by high single-threaded multi-threaded ratio redis

memcached higher efficiency?

the difference:

1.mc be cached images and video. In addition to supporting rd k / v more data structures;

2.rd can use virtual memory, rd durable and aof disaster recovery, rd backup data from the main support;

3.rd can make the message queue.

The reason: mc multithreading model introduces cache coherency and locks, lock brings the performance loss.

 

redis master-slave replication how to achieve? How redis cluster model to achieve? The key is how redis addressed?

 

Master-slave replication to achieve: the master node will own the data memory to do a snapshot, the snapshot sent from the node, from the number of nodes

According to revert to memory. After again each time a new data, the master node in a manner similar side mysql binary log

The statement is sent from the formula to the node, the node from the master node sends the statement to get over reproduced.

Split mode:

- Client fragment

- Agent-based fragment

● Twemproxy

● codes

- routing query fragments

● Redis-cluster (itself provides the ability to automatically Redis Cluster dispersing data of different nodes, the entire data set

Bonded to a subset of data stored in the node which is transparent to the user)

redis-cluster fragment Principle: Cluster in a groove (virtual channel) of a length 16384, numbered from 0 to 16383.

Each Master node will be responsible for part of the tank, when there is a certain key is mapped to a Master responsible groove, that

Why this Master is responsible for providing services to this key, as to which node is responsible for which Master slot, the user can

Specified, it can be automatically generated at initialization time, it owns only Master slot. Master node dimension

16384/8 guarding a byte bit sequence, Master bit nodes to identify themselves with respect to whether it has a groove. ratio

As for the number of tank 1, Master as long as the second bit sequence is determined (the index starting from 0) is not for a can.

This structure can easily add or delete nodes. For example, if I want to add a new node D, I need from node A, B,

Obtained in part C to the groove D. (Space is too big so just to name a few, face questions + answers receive mode at the end of the text)

MongoDB

You say NoSQL database What does it mean? RDBMS and NoSQL directly what is the difference? Why should I use and non-use

NoSQL database? Talk about several advantages NoSQL database?

 

NoSQL non-relational databases, NoSQL = Not Only SQL.

Structured data using a relational database, NoSQL uses key-value pairs stored data.

When ready to respond to dynamic optimization can increase items; when unstructured / semi-structured data is large; when extended in a horizontal direction

Consider using NoSQL database.

In considering the maturity of the database; support; analysis and business intelligence; managing and professional issues, priority should be given relational database.

 

What types of NoSQL databases?

 

Type of NoSQL databases

例如:MongoDB, Cassandra, CouchDB, Hypertable, Redis, Riak, Neo4j, HBASE, Couchbase,

MemcacheDB, RevenDB and Voldemort are the examples of NoSQL databases. Read.

What is the basic difference between MySQL and MongoDB is?

Both MySQL and MongoDB are free open source database. MySQL and MongoDB there are many fundamental differences table includes data

Shown (data representation), query, relationships, transaction, and Schema definition of the design, standardization (Normalization), speed

And performance.

By comparing MySQL and MongoDB, in fact we are comparing relational and non-relational databases that store different data structures.

Redis + MongoDB 80 ANSWERS PDF

September and October quit peak, interviewing essential Redis + MongoDB frequently asked interview questions 80 answers Portal

Guess you like

Origin www.cnblogs.com/chengxuwang/p/11454258.html