InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How Does Redis Differ From Mongodb? Is There A Use Case When For Redis If Using Mongodb? |
|
Answer» MongoDB is an unstructured (at LEAST, in definition) distributed document storage. For clearing purpose you can think about it as a high SCALABLE and not so high performance JSON storage (though actually it uses BSON). It has a simple but EFFECTIVE multitype index system, replication and sharding, and a lot of more nice FEATURES. Redis is a simplest key/value STORE, with transient data caching. It can works as an efficient queue system. Looking for more specific information you will find a lot of scenarios where both them are used, Mongo as a true persistent canonical storage, and Redis as an transient/cache storage. MongoDB is an unstructured (at least, in definition) distributed document storage. For clearing purpose you can think about it as a high scalable and not so high performance JSON storage (though actually it uses BSON). It has a simple but effective multitype index system, replication and sharding, and a lot of more nice features. Redis is a simplest key/value store, with transient data caching. It can works as an efficient queue system. Looking for more specific information you will find a lot of scenarios where both them are used, Mongo as a true persistent canonical storage, and Redis as an transient/cache storage. |
|
| 2. |
What Do You Mean By "redis Is Binary Safe"? |
|
Answer» Binary SAFE means that it has a known length but not LIMITED by any SPECIAL character. You can store any VALUE upto the given size. A STRING value can be 512 MB in length. Binary safe means that it has a known length but not limited by any special character. You can store any value upto the given size. A string value can be 512 MB in length. |
|
| 3. |
How To Delete Current Database? |
|
Answer» To DELETE current DATABASE USE the FOLLOWING code: redis-cli flushdb To delete current database use the following code: redis-cli flushdb |
|
| 4. |
How To Remove All Database? |
|
Answer» To REMOVE all DATABASE USE the FOLLOWING CODE: redis-cli flushall To remove all database use the following code: redis-cli flushall |
|
| 5. |
How To Check Redis Is Running? |
|
Answer» To CHECK Redis is running try out the following code : try To check Redis is running try out the following code : try |
|
| 6. |
How To Set Value In Redis? |
|
Answer» To SET the value in REDIS USE the following COMMAND: $redis->set("name", "Set string in redis"); To set the value in Redis use the following command: $redis->set("name", "Set string in redis"); |
|
| 7. |
How To Get Value From Redis? |
|
Answer»
ECHO $redis->get('name'); //Set string in redis To get value from Redis : echo $redis->get('name'); //Set string in redis |
|
| 8. |
How To Set Multiple Values (array) In Redis? |
|
Answer» To set multiple values in REDIS use the FOLLOWING commands: $redis->lpush("tutorials", "PHP"); To set multiple values in Redis use the following commands: $redis->lpush("tutorials", "PHP"); |
|
| 9. |
How To Get Array Data From Redis? |
|
Answer» To get the array data from REDIS use the following command : $list = $redis->lrange("tutorials", 0 ,5); To get the array data from Redis use the following command : $list = $redis->lrange("tutorials", 0 ,5); |
|
| 10. |
How To Get All Keys From Redis? |
|
Answer»
$keyList = $redis->keys("*"); print_r($keyList); /*Array ( [0] => tutorials [1] => NAME ) */ Use the following commands: $keyList = $redis->keys("*"); print_r($keyList); /*Array ( [0] => tutorials [1] => name ) */ |
|
| 11. |
How To Stop Redis? |
|
Answer» You can STOP REDIS by USING FOLLOWING PATH: You can stop Redis by using following path: |
|
| 12. |
How To Start Redis? |
|
Answer» You can START REDIS by USING following PATH: /etc/init.d/redis-server start You can start Redis by using following path: /etc/init.d/redis-server start |
|
| 13. |
How To Re-start Redis? |
|
Answer» You can RESTART REDIS by USING FOLLOWING PATH: /etc/init.d/redis-server restart You can restart Redis by using following path: /etc/init.d/redis-server restart |
|
| 14. |
How Do I Move A Redis Database From One Server To Another? |
| Answer» | |
| 15. |
Why Redis Is Different As Compared To Other Key-value Stores? |
| Answer» | |
| 16. |
What Do You Mean By Data Modeling In Redis? |
|
Answer» Just like any other database, data modeling represents the storage pattern of how and which data structures are USED to store the data to ACHIEVE a domain requirement. For example in relational database world, we use PRIMARY key to ESTABLISH a relationship between two entities. Data STORED in relational databases are in table format, where as in Redis there are set of data structures available, which are used to represent the domain data. There is certainly different design mindset needed to convert the relational data to a Redis dataset. Just like any other database, data modeling represents the storage pattern of how and which data structures are used to store the data to achieve a domain requirement. For example in relational database world, we use primary key to establish a relationship between two entities. Data stored in relational databases are in table format, where as in Redis there are set of data structures available, which are used to represent the domain data. There is certainly different design mindset needed to convert the relational data to a Redis dataset. |
|
| 17. |
What Is The Difference Between Overriding A Value By Using Set Vs Append? |
|
Answer» A value set by using SET command will set the value for the key.Doing it over again will OVERRIDE the value. HOWEVER , using append has the EFFECT of set only when the key has no value earlier, but if there is a value already ASSIGNED to the key , then doing append on the key would lead to an appended value to the existing value of the key. A value set by using SET command will set the value for the key.Doing it over again will override the value. However , using append has the effect of set only when the key has no value earlier, but if there is a value already assigned to the key , then doing append on the key would lead to an appended value to the existing value of the key. |
|
| 18. |
What Are The Things You Must Have To Take Care While Using Redis? |
|
Answer» While using Redis, you must have to take care of following instructions:
While using Redis, you must have to take care of following instructions: |
|
| 19. |
In Which Language Redis Is Written? |
|
Answer» REDIS is written in ANSI C and mostly used for cache solution and SESSION management. It creates UNIQUE KEYS for store values. Redis is written in ANSI C and mostly used for cache solution and session management. It creates unique keys for store values. |
|
| 20. |
What Are The Main Features Of Redis? |
|
Answer» Following are the main features of Redis:
Following are the main features of Redis: |
|
| 21. |
We All Know That Reds Is Fast, But Is It Also Durable? |
|
Answer» No. Redis compromises with durability to enhance the SPEED. In Redis, in the case of system failure or crash, it WRITES to disk but MAY FALL behind and lose the data which is not stored. No. Redis compromises with durability to enhance the speed. In Redis, in the case of system failure or crash, it writes to disk but may fall behind and lose the data which is not stored. |
|
| 22. |
How Can You Use Redis With .net Application? |
|
Answer» To use Redis in .Net applications, follow these STEPS:
To use Redis in .Net applications, follow these steps: |
|
| 23. |
What The Basic Features Are Of Redis Which Makes It Awesome Compared To Memcache? |
Answer»
|
|
| 24. |
Explain Repl? |
|
Answer» REPL STANDS for READ EVAL Print LOOP. It an interactive mode where the user types COMMANDS and get replies. REPL stands for Read Eval Print Loop. It an interactive mode where the user types commands and get replies. |
|
| 25. |
What Is Redis-cli? |
|
Answer» Redis-cli is the Redis command line INTERFACE, a simple program that allows SENDING commands to Redis, and READ the REPLIES sent by the server, directly from the TERMINAL. Redis-cli is the Redis command line interface, a simple program that allows sending commands to Redis, and read the replies sent by the server, directly from the terminal. |
|
| 26. |
How We Can Use Redis With .net Application? |
|
Answer» For USE Redis in .net application need to FOLLOW GIVEN steps:
For use Redis in .net application need to follow given steps: |
|
| 27. |
List Out The Operation Keys Of Redis? |
|
Answer» Operation keys of REDIS INCLUDES: Operation keys of Redis includes: |
|
| 28. |
What Is Limitations Of Redis? |
| Answer» | |
| 29. |
List The Data Structures Supported By Redis? |
|
Answer» REDIS supports FOLLOWING Data STRUCTURES:
Redis supports following Data Structures: |
|
| 30. |
What Is Advantages Of Using Redis? |
| Answer» | |
| 31. |
What Is Main Feature Of Redis? |
Answer»
|
|