New Posts  All Forums:Forum Nav:

No SQL databases

post #1 of 8
Thread Starter 
Does anyone have any experience with them?

I'm looking for something that can handle nested data, is relatively high performance and is preferably open source, as the sort of queries I'm building don't seem well suited for SQL (I guess the other option is to write a stored procedure, but I'd rather avoid that if I can)
post #2 of 8
Thread Starter 
Anyone? frown.gif

Does anyone know of any good resources / places to read up more on this - even if you don't personally know much on the subject yourself?
Edited by Plan9 - 8/2/13 at 3:04am
post #3 of 8

I've done a little with mongodb (it's the most popular and AGPL). From a user POV it's basically entering and storing stuff as json objects.

post #4 of 8
Thread Starter 
Quote:
Originally Posted by hajile View Post

I've done a little with mongodb (it's the most popular and AGPL). From a user POV it's basically entering and storing stuff as json objects.
What's AGPL? (edit: ahh, it's a software licence. I was thinking it was a database term doh.gif)

I'll have a look at mongodb but JSON might not suite my needs as I'm working with nested data so would need something a little more programmatic (sadly SQL isn't great with nested data either).

Isn't there a no-sql db which supports Javascript queries?

Because of the complex way in which I want to drill into the data and the long term aim of code portability - I think I might be better off going with expensive SQL requests but caching that data in a bespoke "in memory" database (basically a structured object I can build into the project itself).

This would probably give me the best balance between a standard library of tools (eg the code will run against any SQL database) but also performance.

Though I'm still open to suggestions if anyone has any smile.gif

Mod edit: Please use the edit button instead of double posting.
post #5 of 8
Quote:
Originally Posted by Plan9 View Post


What's AGPL? (edit: ahh, it's a software licence. I was thinking it was a database term doh.gif)

I'll have a look at mongodb but JSON might not suite my needs as I'm working with nested data so would need something a little more programmatic (sadly SQL isn't great with nested data either).

Isn't there a no-sql db which supports Javascript queries?

Because of the complex way in which I want to drill into the data and the long term aim of code portability - I think I might be better off going with expensive SQL requests but caching that data in a bespoke "in memory" database (basically a structured object I can build into the project itself).

This would probably give me the best balance between a standard library of tools (eg the code will run against any SQL database) but also performance.

Though I'm still open to suggestions if anyone has any smile.gif

Mod edit: Please use the edit button instead of double posting.

mongodb IS javascript code and JSON storage (from the user's perspective). All the queries are done with js style calls and the mongo shell runs arbitrary js.

http://docs.mongodb.org/manual/tutorial/getting-started-with-the-mongo-shell/


As far as nested data, will this work?

http://docs.mongodb.org/manual/tutorial/model-tree-structures-with-nested-sets/

 

It's a little off-topic, but shouldn't you be using something like memcached or redis anyway?


Edited by hajile - 8/2/13 at 5:05am
post #6 of 8
Thread Starter 
Quote:
Originally Posted by hajile View Post

mongodb IS javascript code and JSON storage (from the user's perspective). All the queries are done with js style calls.
Oh right. I think I might need to find some examples of mongo in action to really understand it's implementation. (this stuff is completely outside my comfort zone redface.gif )
Quote:
I was looking at that earlier and the impression I got (perhaps wrongly?) was that it didn't suit hierarchical data that's subject to change regularly - which mine is.
thanks for the link though - I'll give it another, more thorough, look tonight.
Quote:
Originally Posted by hajile View Post

It's a little off-topic, but shouldn't you be using something like memcached or redis anyway?
Possibly. I've never used them before redface.gif
post #7 of 8
Quote:
Originally Posted by Plan9 View Post

Oh right. I think I might need to find some examples of mongo in action to really understand it's implementation. (this stuff is completely outside my comfort zone redface.gif )
I was looking at that earlier and the impression I got (perhaps wrongly?) was that it didn't suit hierarchical data that's subject to change regularly - which mine is.
thanks for the link though - I'll give it another, more thorough, look tonight.
Possibly. I've never used them before redface.gif

What do you mean by "subject to change regularly"? Do you have an example you can share?

 

As to redis or memcached, they're basically optimized key: value storage held in memory (they're used by every major website in existence). The idea behind using memcached is that you shouldn't ever touch the database directly. You should simply have "if in cache, return cached value else poll db". In addition, each data change is first made in cache and should then be queued for entry into the database. Ideally, when the server restarts for some reason, you will have a script that initializes the db into memcached (either entirely or using heuristics of what's popular).

 

Even small websites benefit greatly from caching in memory rather than waiting for the database to spin up.

post #8 of 8
Thread Starter 
Quote:
Originally Posted by hajile View Post

What do you mean by "subject to change regularly"? Do you have an example you can share?
It's basically a threaded forum - a bit like reddit.
Quote:
Originally Posted by hajile View Post

As to redis or memcached, they're basically optimized key: value storage held in memory (they're used by every major website in existence). The idea behind using memcached is that you shouldn't ever touch the database directly. You should simply have "if in cache, return cached value else poll db". In addition, each data change is first made in cache and should then be queued for entry into the database. Ideally, when the server restarts for some reason, you will have a script that initializes the db into memcached (either entirely or using heuristics of what's popular).
That sounds like what I was talking about recreating. Though I don't think a simple key-value store will be enough for the data I'm grouping.
I'm thinking I could have an object (well, a structured type since I'm using Go - which isn't really OO) as a data map against the parent comment ID (it's basically how I'm structuring the data before outputting to HTML anyway - so it makes sense to expand the scope of that a little and build it into a proper cache)
Quote:
Originally Posted by hajile View Post

Even small websites benefit greatly from caching in memory rather than waiting for the database to spin up.
Yeah, that much I know already. I've just not needed to cache lookups before now (none of my personal projects have needed to scale and professionally I'm a sysadmin)


Thanks for all your help on this btw. I've been rep'ing you generously.
Edited by Plan9 - 8/2/13 at 6:04am
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming