Tag Info

Hot answers tagged

5

Option 4: Class Table Inheritance This is a design technique used to implement a class/subclass situation. In this situation, attributes often apply only to one subclass, and not to all rows in the table. Visit the tag of the same name over in SO to see a bunch of relevant questions and answers. This has the advantage eliminating NULLS (mostly), ...


5

cqlsh -k mykeyspace -e 'COPY fromTable(columnNames) TO STDOUT' | head -n -1 | cqlsh -k mykeyspace -e 'COPY toTable(columnNames) FROM STDIN'


5

Welcome to database hell! NoSQL is often championed as a solution to these types of applications. However, your problem here is clearly that the programmers have no idea what they are doing. Furthermore, it looks like your management is afraid of change, or unwilling to take the hard decisions which you correctly list and which are likely to fix the root ...


4

[EDIT - added several public dataset sites]. First off, there is no real evidence that NoSQL databases are "better" at handling large datasets than traditional (OldSQL) RDBMSs. Check out Ted Dziuba's article about how he can't wait for NoSQL to die. He makes the point that Walmart continue to use RDBMSs - and they're not a small company! He says that NoSQL ...


3

As you have multiple rows inside the JSON column, you need a function that returns a set. This can be done using the json_to_recordset() function: select j.* from json_test, json_to_recordset(json_data) as j(name text, country text, hobby text, address text, sex text); Because this is an anonymous record type, you must explicitly define each column. ...


3

Use the maxmemory to set a limit to how much your Redis database can grow too. Failing to do so, Redis will grow until the OS will kill it once memory is exhausted (per your current experience). The usage of maxmemory should be coupled with maxmemory-policy - you can choose from different eviction policies depending on your use case's requirements. For ...


2

MongoDB's dynamic schema supports different fields for documents within the same collection, so there is no strict requirement for all documents to have an active field. The main consideration here will be how that affects your application logic; it may be simpler to have an explicit field present and check the value. If you have an index on a field, ...


2

For your use case of key-value data, where the value is simple, MongoDB is more than you need. It is a document-oriented data store for complex value types. A specific key-value store would suit your needs. RIAK is the one I've looked at though several others exist. Since your retrieval will be by time range i.e. key range, Elastic's full-text ...


2

My largest obstacle right now with Cassandra are the no-join, no order by (since everything is ordered by key for you), and mass update. If your current data structure depends on joins (or aggregation) to pull off the queries you need you won't find a nosql option that includes these. You do have some options: Consider reviewing your current data ...


2

Although Cassandra allows the definition of "columns" within a "table", these are much less strict than a relational database schema. As it says here different rows in the same column family do not have to share the same set of columns, and a column may be added to one or multiple rows at any time. In this world, the new value is only added to the ...


2

SQL Server has Change Data Capture in it's Enterprise edition. From msdn link to information: Change data capture records insert, update, and delete activity that is applied to a SQL Server table. This makes the details of the changes available in an easily consumed relational format. Column information and the metadata that is required to apply ...


1

For mongo shell sessions there is a concept of mongorc files which include JavaScript to execute when the mongo shell starts. You can use this feature to extend or customise the behaviour of the interactive shell. If you want secondary reads to be allowed by default for all shell sessions you can either: add the rs.slaveOk() command to the .mongorc.js in ...


1

JShean, I am with the MarkLogic product team, I saw your question and wanted to point you to some information. In general, mlcp is the most efficient way to load documents into MarkLogic, though I know many customers don't like dumping all the data to disk. Have you considered doing the process in batch - dump a certain set to disk, use mlcp to load and ...


1

All things being equal, it is logical to assume that better hardware = better performance. However, computers are strange beasts - I know that with Oracle, if you assign very large sizes (you need good hardware) to certain caches, you can actually slow down the machine. The only real suggestion that I have is that you test, test and test again. You cannot ...


1

In your question you are using "SQL" and "relational" to mean the same thing. In the same way you can think of "NoSQL" as meaning "not relational" i.e. there is no primary key / foreign key concept; there is no "normalisation" enforced or implied; there is no real meaning of the words "table" or "column". To a key-value store all it knows about is a big ...


1

Someone make this bench: http://mimdl.tumblr.com/post/115308901909/benchmarking-handlersocket-mysql-innodb-memcached Get Operation with HandlerSocket was completed in 1.20499610901 Sec, i.e; making 8,299 QPS (Queries per second) Get Operation with InnoDB Memcached Plugin was completed in .93115 seconds i.e; making 10,739 QPS Select Query for MySQL took ...


1

Many NoSQL products have sharding built-in. The DBMS itself looks after storing a particular key range on a certain server and keeping redundant copies for high availability. Client connections are routed within the DBMS rather than in the application. Multi-server scale out becomes easy, at the cost of CAP compromises.


1

I can't test this at the moment, but that's the basic format. You should change your date data type to ISO so it works easily with the below code: var lastWeek = new Date(); lastWeek.setDate(lastWeek.getDate() -7); db.messages.find({ "rep_header.share_date_2.$date": { $gte: lastWeek} } } );


1

You can get the 2-way Sync feature using Couchbase Mobile (client-side) solution and on the backend using Couchbase Server Can check out an example on this blog post


1

Just execute on shell "use dbname" When you insert the first document on any collection you will see the db with "show dbs"


1

Using an RDBMS is fine, but the sticky part is how to store the parameters needed to render each type of question. I would caution against having separate table definitions (or lots of type-specific columns) for each type of question. While these details (such as the list choices for a multiple-choice question) can be seen through a relational lens, it ...


1

The problem (from what I can see) From what I can see from your output, you have a monotonically increasing shard key like ObjectId or a Date or something similar. MongoDB sharding is done with key ranges over the selected shard key. Put simply, it works like "shard0000 is supposed to hold the rang from -infinity to $i, shard0001 the keys from $h to $p and ...


1

In Cassandra you need to take a query-based modeling approach. In your case, I would create a similarly-structured query table like this: CREATE TABLE topicbyuser ( topic_id text, user_id text, event_time timestamp, data text, PRIMARY KEY (user_id,event_time), ) WITH CLUSTERING ORDER BY (event_time DESC); And then, if you wanted to ...


1

As NoSQL databases typically do not support joins, they expect you to store the data in de-normalized form. (So, throw the codd normalization rule book away. Just kidding). In this case, the thrid table better have the values duplicated something like (orderid, ordertime, [itemnames], waitername, orderserviced yes/no, servicetime, ...). itemnames can be a ...


1

You can also set the bin to null to delete it. http://www.aerospike.com/docs/client/java/usage/kvs/write.html#delete-a-bin


1

Neo4j is a schema-optional graph database. You could choose to enforce a full schema and reap the benefits.


1

In general, clustered-NoSQL databases offer you better horizontal scalability. So, as you scale you can get higher capacity (both memory & compute power) by simply adding new nodes. So, it will be a good insurance for the future. When it comes to ACID properties, NoSQL databases offer flexibility. So, it boils down to how much ACIDness you want and how ...


1

Ok, I found the solution, I have to use the reduce function for that, like: function(keys, values, rereduce){ var result = null; var orders = [] for(var i =0; i< values.length; i++){ if(values[i].type=='customer') result = values[i]; else{ orders.push(values[i]) } } result.orders = orders; return result; }


1

You can run a --repairDatabase for that node: mongod --repair --repairpath <repair_path> Keep in mind that the repair path should have at least as your data size free disk space. (if you have 100GB, the repair path should have at least 100GB free also. That should take care of problems of that sort. Also, in the future if anything of some sort ...


1

This is almost certainly memory fragmentation, as redis is well-known and loved in production and you probably haven't found a memory leak. The recommendations about setting the size of the pool won't help fragmentation. You'll have to specifically lower the Redis size - lower than your actual memory size - because Redis can't account for fragmentation - ...



Only top voted, non community-wiki answers of a minimum length are eligible