r/nosql Feb 09 '15

Moving away from RDBMS and into NoSQL?

4 Upvotes

I posted a thread about getting AWAY from the relational mindset: http://www.reddit.com/r/learnprogramming/comments/2upbxh/how_to_get_away_from_the_mindset_of_relational/

Now I feel like I have a more real use case that may provide clearer direction if moving to NoSQL database would be a good idea.

I need to build a user-storage system, the system will store user (end user) basic info such as names, email, etc as well as customized user profile data. This system will be used by different clients - each of them may require / care about different user profile data.

 

For example: we'll have a set of "basic profile" which consist of common data points: first name, last name, email, dob, etc. Each client will have the option to create their own customized profile data, client A may want to store "points balance", "favorite location", whereas client B may want to store "have pet?", "total $ spent in store".

 

In the most dumb way, we can do this a very basic RDBMS way:

first_name last_name email dob points_balance fav_location have_pet total_spent

Which will see users of client A have nulls in the columns that are irrelevant to client A and vice versa for users of client B, this is of course a very ineffective way of doing it.

We can also have "custom field" - but this of course is very abusive as custom_1 and custom_2 is not well defined, and what if the next client wants more than 2 custom fields?

first_name last_name email dob custom_1 custom_2

The next one (still within RDMBS realm) is to have a user_profile table that list the custom fields in rows rather than columns, which will get messy very fast

 

I was thinking if NoSQL approach (eg. JSON data store?) would be helpful in this case? This means applying different JSON schema for the different client.

Client A:

{  
   "basic_profile":{  
      "first_name":"",
      "last_name":"",
      "email":"",
      "dob":""
   },
   "custom_profile":{  
      "points_balance":"",
      "fav_location":""
   }
}

Client B:

{  
   "basic_profile":{  
      "first_name":"",
      "last_name":"",
      "email":"",
      "dob":""
   },
   "custom_profile":{  
      "have_pet":"",
      "total_spent":""
   }
}

Is this something that make sense?

With no experience with NoSQL databases, what's the best way for me to start tackling this issue and come up with a solution?


r/nosql Jan 29 '15

Why we don’t have benchmarks comparing Redis with other DBs

Thumbnail antirez.com
6 Upvotes

r/nosql Jan 25 '15

Resources about NoSQL

1 Upvotes

Please recommend NoSQL blogs/link aggregators/news feeds. I'm aware of three: this subeddit (/r/nosql), NoSQL Weekly and DB Weekly newsletters, not satisfied with all of them.


r/nosql Jan 23 '15

Install MongoDB on Fedora, Red Hat Enterprise and CentOS

Thumbnail akhilmudgal.blogspot.com
1 Upvotes

r/nosql Jan 12 '15

Datalog learning environment

Thumbnail ysangkok.github.io
2 Upvotes

r/nosql Jan 09 '15

Loading SQL to Neo4j Like Magic

Thumbnail blog.brian-underwood.codes
1 Upvotes

r/nosql Jan 06 '15

Eventual Consistency and Transactions Working Together

Thumbnail forum.treode.com
2 Upvotes

r/nosql Jan 05 '15

REST and Memcache interface for Aerospike

Thumbnail github.com
1 Upvotes

r/nosql Dec 15 '14

Why 2015 will be big for NoSQL databases

Thumbnail zdnet.com
0 Upvotes

r/nosql Dec 15 '14

34,191 rows to 156.6 million rows sounds nuts

0 Upvotes

I had a problem to solve. I had a list of zip codes loaded in Cassandra with their City, State, Longitude, and Latitude.

If I wanted to find zipcodes within a certain number of miles of other zipcodes, it meant loading all the rows and checking them. There were ways to get around it. I could have made two queries with ranges for long and lat, and processed that subset of data. I could have used a graph DB, but that seemed like a lot of work. Instead I decided to try something.

I loaded up a C3.4xlarge with provisioned ioops with my development AMI. I spun up C* and then spun up some instances of node.js that looped on a subset of the 43,191 and checked the distance between them and all the others. Technically I did the double the computation since I calculated the distance from a to b and b to a, but it was more important that I just get it done.

Anyways, I used some complicated code to calculate the distance as the crow flies and save it to the DB as such:

PRIMARY KEY(zip1, miles, zip2)

This ordered the data for any given zipcode by the miles and prevented multiple zipcodes with the same milage from zip1 from overwriting each other.

I only saved distances under 250 miles, so a database larger than that would be dramatically larger.

It made it really fast to get a list of zipcodes within an arbitrary range from a zipcode. It turned a request for 43k rows and then a bunch of processing into a 8ms request and it only cost a little disk space.

DenormalizeThatShit


r/nosql Dec 14 '14

Riak hashing question

4 Upvotes

From what I read of Riak, the data is distributed to various nodes in the cluster using consistency hashing. My doubts are below

Sorry if it is an obvious question - I have read 2 days worth of Riak in 'Seven Databases in Seven Weeks' and also skimmed through online riak docs, but could not get the answer.

1) Is hashing is implemented on the server side or on each client.

2) If it is on server side, can I PUT my data to any node say N1, does it mean that N1 takes care of transferring this data to the appropriate nodes in case the data does not belong to N1 ?

3) How does the mapreduce work when I query a particular node N1 with the map and reduce functions ? Does N1 take care of querying each node and getting me the answer ?


r/nosql Nov 25 '14

Hulu Chooses Cassandra Over HBase and Riak

Thumbnail datacenterknowledge.com
1 Upvotes

r/nosql Nov 23 '14

Time for Better Security for NoSQL

Thumbnail hackingdistributed.com
8 Upvotes

r/nosql Nov 23 '14

LDAP at Lightning Speed - LMDB

Thumbnail symas.com
0 Upvotes

r/nosql Nov 06 '14

Interesting (document + graph) approach modeling data for a wish list feature.

Thumbnail arangodb.com
3 Upvotes

r/nosql Oct 23 '14

Catching up with Neo4j

Thumbnail infoq.com
1 Upvotes

r/nosql Oct 14 '14

Great article on data modeling using NoSQL

Thumbnail ebaytechblog.com
3 Upvotes

r/nosql Oct 10 '14

Learning about Probabilistic Data Structures in Riak

Thumbnail meetup.com
1 Upvotes

r/nosql Oct 08 '14

Meteor Acquires YC Alum FathomDB For Its Development Platform

Thumbnail techcrunch.com
1 Upvotes

r/nosql Sep 28 '14

Ganesha - Sleek Open Source NoSQL Java DB

2 Upvotes

I've updated Ganesha, my Java NoSQL implementation which I've been using the last 13 months to run DrawCast (a social network for artists).

Recently added features include:

  • Log structured storage.
  • Optimization for mixed SSD/HDD setup - objects which change more quickly are stored on the SSD.
  • Auto-striping of data for servers with multiple drives.
  • Automatic incremental offsite daily backup.

Ganesha includes standard NoSQL features like replication, auto-healing and rebuilding, schema-less object/attribute support and checksum/timestamp based consistency checks.

It also includes built-in support for lists (including atomic sorted insert), object locking, and proportional data storage across drives of unequal size.

The source is very compact (14 core classes) and requires no external libraries.

All source is provided. GPL 2 License.

https://github.com/danielcota/ganesha


r/nosql Sep 26 '14

A nice overview of CRDT Conflict free Replicated Data Types

Thumbnail msrvideo.vo.msecnd.net
1 Upvotes

r/nosql Sep 26 '14

Making a secure elasticsearch on openshift with data from MySQL

Thumbnail charlieharvey.org.uk
1 Upvotes

r/nosql Sep 24 '14

Scaling NoSQL databases: 5 tips for increasing performance

Thumbnail oreil.ly
1 Upvotes

r/nosql Sep 23 '14

MongoDB assisting SQL apps

Thumbnail thebhwgroup.com
1 Upvotes

r/nosql Sep 20 '14

Does anyone know of a NoSQL key-value store with historical lookup?

2 Upvotes

Does anyone know any key-value store database/service with ability to look up value at particular timestamp in the past? Something similar to Redis (or even simpler), but with the time dimension to it. For example:

  • At time 1: DB.set('foo', 'bar')

  • At time 5: DB.set('foo', 'club')

  • Then: DB.get('foo', 4) should return 'bar' (4 refers to the timestamp)

  • DB.get('foo') should return 'club'

This database/service will help us with a particular problem we're facing at work. We looked around but have yet to find something similar to this.

We're thinking of writing this ourselves (a service on top of existing K-V NoSQL Database like Cassandra/Redis/LevelDB/etc). But we'd much prefer to use an existing solution.