Nosql Standouts: the Best Key-Value Databases

Nosql Standouts: the Best Key-Value Databases

® SEPTEMBER 13, 2017 GET TECHNOLOGY RIGHT® INSIDER NoSQL standouts: The best key-value databases Aerospike, Hazelcast, Memcached, Microsoft Azure Cosmos DB, and Redis put different twists on fast and simple data storage Most any application needs some form of persis- Aerospike configured to synchronize against one another. tence—a way to store the data outside of the applica- If Redis is Memcached on steroids, Aerospike could be Like Redis, Aerospike allows developers to write Lua tion for safekeeping. The most basic way is to write said to be Redis on steroids. Like Redis, Aerospike is a scripts, or UDFs (user-defined functions), that run inside data to the file system, but that can quickly become key-value store that can operate as a persistent data- the Aerospike engine. UDFs can be used to read or alter a slow and unwieldy way to solve the problem. A full- base or a data cache. Aerospike is designed to be easy records, but they are best used as a way to perform high- blown database provides a powerful way to index and to cluster and easy to scale, the better to support enter- speed, read-only, map-reduce operations across collec- retrieve data, but may also be overkill. Sometimes all prise workloads. tions or “streams” of records on multiple nodes.. you need is a quick way to take a freeform piece of Much in Aerospike echoes both other key-value information, associate it with a label, stash it some- stores and other NoSQL databases. Data is stored and Hazelcast IMDG where, and pull it back out again in a jiffy. retrieved by way of keys, and the data can be kept in Hazelcast comes billed as an “in-memory data grid,” Enter the key-value store. It’s essentially a database, a number of fundamental data types including 64-bit essentially a way to pool RAM and CPU resources but one with a highly specific purpose and a delib- integers, strings, double-precision floats, and raw across multiple machines to allow data sets to be dis- erately constrained design. Its job is to let you take binary data serialized from a number of common pro- tributed across those machines and manipulated in- data (a “value”), apply a label to it (a “key”), and store gramming languages. memory. Hazelcast can be used as a key-value store, it either in-memory or in some storage system that’s Aerospike also can store data in complex types—lists and, according to its makers, as an alternative to prod- optimized for fast retrieval. Applications use key-value of values, collections of key-value pairs called maps, ucts like Pivotal Gemfire, Software AG Terracotta, or databases for everything from caching objects to shar- and geospatial data in the GeoJSON format. Aerospike Oracle Coherence. ing commonly used data among application nodes. can perform native processing on geospatial data—e.g., Hazelcast is built with Java and has a Java-centric Many relational databases can function as key-value determine which locations stored in the database are ecosystem. Each node in a Hazelcast cluster runs an stores, but that’s a little like using a tractor-trailer to go closest to each other by just performing a query—mak- instance of Hazelcast’s core library, IMDG, on the on grocery runs. It works, but it’s dramatically inefficient, ing it an attractive option for developers of applications JVM. The way Hazelcast works with data is also closely and there are far less top-heavy ways to solve the prob- that rely on location mapped to Java’s language structures. Java’s Map inter- lem. A key-value store provides just enough infrastruc- Data stored in Aerospike can be organized into a face, for instance, is used by Hazelcast to provide key- ture for simple value storage and retrieval, integrates number of hierarchical containers. Each kind of con- value storage. As with Memcached, nothing is written more directly with applications that use it, and scales tainer lets you set different behavioral properties on to disk; everything is kept in-memory at all times. in a more granular way with the application workload. the data inside it. For instance, the topmost level of Hazelcast can be run as a distributed service or Here we’ve examined five widely used products containers, namespaces, determines whether the data embedded directly inside a Java application. Clients are (including one cloud service) that are explicitly billed will be stored on disk or in RAM or both, whether the currently available for Java, Scala, .Net, C/C++, Python, as key-value databases, or which offer key-value stor- data is replicated within the cluster or across clusters, and Node.js, and one for Go is in the works. age as a central feature. All have their differences. and when or how data is expired or evicted. Through Hazelcast clusters have no master/slave setup; Hazelcast and Memcached tend toward minimalism, namespaces, Aerospike allows developers to keep the everything is peer-to-peer. Data is automatically and don’t even bother to back the data in question on most frequently accessed data in memory for the fast- sharded and distributed across all members of the disk. Aerospike, Cosmos DB, and Redis are fuller fea- est possible response. cluster. One benefit Hazelcast can provide in a distrib- tured, but still revolve around the key-value metaphor. Aerospike can keep its data on most any filesystem, uted environment is “near cache,” where commonly See the table to compare features. Read on for brief dis- but it has been written specifically to take advantage of requested objects are migrated to the server making cussions of each database. SSDs. That said, don’t expect to drop Aerospike on any the requests. This way, the requests can be performed old SSD and expect good results. Aerospike’s develop- directly in-memory on the same system, without ers maintain a list of approved devices, and they have requiring a round trip across the network. created a tool, ACT, to rate the performance of SSD Aside from key-value pairs, many other kinds of storage devices under Aerospike workloads. data structures can be stored and distributed through Aerospike, like most NoSQL systems, uses a shared- Hazelcast. Some are simple implementations of Java nothing architecture for the sake of replication and objects, like Map. Others are specific to Hazelcast. Mul- clustering. Aerospike has no master nodes and no tiMap, for instance, is a variant on key-value storage manual sharding. Every node is identical. Data is ran- that can store multiple values under the same key. domly distributed across the nodes and automatically Hazelcast also has measures in place to ensure that rebalanced to keep bottlenecks from forming. If you operations only proceed if at least a certain number want to, you can set rules for how aggressively data is of nodes are online. However, this behavior has to be rebalanced. Multiple clusters, running in different net- configured manually, and it only works for certain data work segments or even different datacenters, can be structures. Memcached or REST API call. Memcached is about as basic and fast as key-value stor- Cosmos DB also offers global reach. Data age gets. Originally written as an acceleration layer for stored in Cosmos DB can be automatically the blogging platform LiveJournal, Memcached has replicated throughout all 36 regions of the since become a ubiquitous component of web technol- Azure cloud. You can also specify one of ogy stacks. If you have many small fragments of data five consistency levels for reads or queries, that can be associated with a simple key and don’t need depending on the needs of your application. to be replicated between cache instances, Memcached If you want the lowest possible latency for is just about right. reads at the expense of consistency, choose Memcached is most commonly used for caching the eventual consistency model. If you want queries from a database and keeping the results in strong consistency, you can have it, but at memory. In fact, Memcached does not back its data the cost of your data being confined to a store with anything. All keys are held in memory only, single Azure region. Three other options Unlike Memcached, where the data goes poof once so they evaporate whenever the Memcached instance strike different balances between these poles. the server stops, Redis keeps a periodically updated or the server hosting it is reset. Thus Memcached can’t snapshot of the dataset on disk. The default way to do really be used as a substitute for a database. Redis this is to have Redis write out changes every x seconds Any data that can be serialized to a binary stream If Memcached doesn’t offer enough, consider Redis. if y changes have been made. Another option is “append can be stashed in Memcached. Values can be set to Redis starts with the same basic idea behind Mem- only,” where changes are appended to the existing snap- expire after a certain length of time, or on-demand, cached, an in-memory key-value data store, but takes it shot, which is then periodically truncated in the back- by referencing the keys to the values from an applica- further. Redis not only can store and manipulate more ground. One advantage to the former approach is that tion. The amount of memory you can devote to any complex data structures than just simple binary blobs, snapshot files, once written, can be backed up or cop- given instance of Memcached is entirely up to you, and but also supports on-disk persistence.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us