210
F. Firouzi and B. Farahani
MongoDB’s flexible structure is preferable over Cassandra. If you have no clear
schema defined, MongoDB is likely a solid choice. It can also be a good choice if
you require scalability or caching for real-time analytics. MongoDB is not designed
for transactional data such as accounting systems, etc.
Redis Although Cassandra was designed to handle huge amounts of big data, Redis
is faster than Cassandra in retrieving and storing (key-value) data, especially when
it comes to live streaming. Redis is best used when you have rapidly evolving data
and you can estimate that the size of your final data can fit in memory. Redis is also
great for analytics and real-time data communication.
Elasticsearch Primary use cases include:
• Text Search – Preferable when performing text searches where RDBMS cannot
perform well due to poor configuration. Elasticsearch is customizable and
extendable via plug-ins and allows you to create a high-quality search without
extensive knowledge quickly.
• Fuzzy Search – This search allows for spelling errors such as finding “Levenshte”
when searching for “Levenstein.”
• Instant Search – Searching while the user is still typing via simple suggestions
from existing tags, predicting based on search history, or creating a new search
for each keystroke.
• Content-Based Product/Document Recommendation – Elasticsearch can function
as a simple recommendation engine. In this case, Elasticsearch translates user
content recommendation problems into a search query for implied interests of
users. In addition, Elasticsearch includes document scoring by relevancy and
document filtering by attribute.
• Logging and Analysis – Centrally stores logs from various sources for analysis.
Kibana is useful in this case because it connects with Elasticsearch clusters and
promptly creates visualizations.
4.6.1.7 CAP Theorem
CAP Theorem is a fundamental theorem which enables system architects to select
the appropriate database platform for a data-driven solution (see Fig. 4.26). CAP
Theorem states that a distributed database is only capable of meeting two of the
following three conditions: consistency, availability, and partition tolerance (CAP).
Partition Tolerance Systems keep running, in spite of the number of messages
delayed between nodes. A partition-tolerant system can sustain any level of
network failure without reaching whole network failure. Data is replicated across
multiple node combinations and networks to ensure the system stays up throughout
intermittent outages.
High Consistency All nodes see data simultaneously. Executing a “read” operation
returns the value of the newest “write” operation, causing all nodes to send back the
Précédent

- 217/647

Suivant