MongoDB to Use Sharding with $lookup Aggregation Operator

As the docs you quote indicate, you can’t use $lookup on a sharded collection. So the best practice workaround is to perform the lookup yourself in a separate query. Perform your aggregate query. Pull the “localField” values from your query results into an array, possibly using Array#map. Perform a find query against the “from” collection, … Read more

Are there any REAL advantages to NoSQL over RDBMS for structured data on one machine?

If you’re starting off on a single server, then many advantages of NoSQL go out the window. The biggest advantages to the most popular NoSQL are high availability with less down time. Eventual consistency requirements can lead to performance improvements as well. It really depends on your needs. Document-based – If your data fits well … Read more

When do you start additional Elasticsearch nodes? [closed]

Let’s clarify the terminology a little first: Node: an Elasticsearch instance running (a java process). Usually every node runs on its own machine. Cluster: one or more nodes with the same cluster name. Index: more or less like a database. Type: more or less like a database table. Shard: effectively a lucene index. Every index … Read more

Database partitioning – Horizontal vs Vertical – Difference between Normalization and Row Splitting?

Partitioning is a rather general concept and can be applied in many contexts. When it considers the partitioning of relational data, it usually refers to decomposing your tables either row-wise (horizontally) or column-wise (vertically). Vertical partitioning, aka row splitting, uses the same splitting techniques as database normalization, but ususally the term (vertical / horizontal) data … Read more

MySQL sharding approaches?

The best approach for sharding MySQL tables to not do it unless it is totally unavoidable to do it. When you are writing an application, you usually want to do so in a way that maximizes velocity, developer speed. You optimize for latency (time until the answer is ready) or throughput (number of answers per … Read more

ElasticSearch: Unassigned Shards, how to fix?

By default, Elasticsearch will re-assign shards to nodes dynamically. However, if you’ve disabled shard allocation (perhaps you did a rolling restart and forgot to re-enable it), you can re-enable shard allocation. # v0.90.x and earlier curl -XPUT ‘localhost:9200/_settings’ -d ‘{ “index.routing.allocation.disable_allocation”: false }’ # v1.0+ curl -XPUT ‘localhost:9200/_cluster/settings’ -d ‘{ “transient” : { “cluster.routing.allocation.enable” : … Read more