Skip to main content

Posts tagged with 'couchbase'

My job as a developer evangelist for Couchbase means than I work much less with SQL Server than I used to. However, it doesn't mean I don't keep up with it.

In fact, inspired by Couchbase, I decided to try out using SQL Server as a sort of document data store. SQL Server 2016 introduced some interesting new features that make this kinda possible: JSON_VALUEJSON_QUERY, and JSON_MODIFY.

I set up a "document" table, which is two fields: a guid and an nvarchar(max). This is kinda like a Couchbase bucket: a key and a JSON document to go with it.

I put fairly complex hierarchical documents in these fields, something like:

I say "fairly complex", because representing this in a standard normalized fashion would require at least two tables, foreign keys, constraints, and then data migration and schema migration as the model evolves.

Now, suppose I want to execute a query and find all the document that are "Show=true". With Couchbase and N1QL, I would just use something like "SELECT * FROM `bucket` WHERE show = true".

With SQL Server, there's a little more work. "SELECT t.key, t.doc FROM [table] t WHERE JSON_VALUE(t.SpeakingInfo,'$.Show') = 'true'". Notice that JSON_VALUE is being applied to a text field, and a JSON path is used within JSON_VALUE to get a specific value from within that JSON object.

For this simple project I'm doing, that's all I need. No idea yet what kind of performance level I can expect from JSON_VALUE and more complex JSON paths.

But, this is definitely an example of the kinds of database convergence I've been telling people about. The separations between NoSQL and SQL are becoming less strict, at least in terms of data modeling and querying.

You need to be using SQL Server 2016 or SQL Server Azure to take advantage of the JSON_* functions.

Couchbase Day Columbus 2016

October 17, 2016 mgroves 0 Comments
Tags: couchbase event

Couchbase Day is a day-long FREE event where you can participate in hands-on workshops and technical presentations. If you've never used NoSQL databases before, or you're interested in Couchbase Server in particular, this is the event for you.

Couchbase Day is coming to Columbus, Ohio on October 27, 2016.

Click that link for more details, including the technical prerequisites that you will use during the workshops.

Sign up today, and I'll see you there!

(This is a cross-post of a blog that was originally posted to the Couchbase Blog - Upcoming #Couchbase Events in Austin, Houston and New York City)

I’m going to be in New York on October 8th and Texas from October 10th to October 13th. If you’re in either of those areas and interested in NoSQL and Couchbase, now is a good chance to attend some sessions, visit some great user groups, and ask me questions in-person.

Couchbase in Texas

Here’s where I will be in between meals of beef brisket (image by Arnold Gatilao, licensed through Creative Commons):

A great NYC conference! Four great Texas groups! I’m going to bring whatever stickers and swag that I can fit in my luggage with me, and I may even just bring the CouchCase along too.

I was recently on David Giard's show Technology and Friends! This is my second time on his show. This time I got to talk about NoSQL and Couchbase Server in particular. Check it out, and check out Couchbase Server.

 

(This is a repost of content that was originally posted on the Couchbase Blog: Upcoming #Couchbase Events in Chicago)

I’m going to be in Chicago for most of next week. If you’re in Chicago and interested in NoSQL and Couchbase, now is a good chance to attend some sessions, visit some great user groups, and ask me questions in-person.

Couchbase in Chicago

I won’t be at Wrigley Field (the above image was doctored :), but here’s where I will be:

Three different sessions and three great Chicago groups. There will be some surprises in store, and I’m going to bring whatever stickers and swag that I can fit in my luggage with me.

If you're in Chicago, why not tweet me and say hi!

Matthew D. Groves

About the Author

Matthew D. Groves lives in Central Ohio. He works remotely, loves to code, and is a Microsoft MVP.

Latest Comments

Twitter