April 1, 2010
@ 09:58 AM

There seems to be some backlash building up against NoSQL with posts like Ted Dziuba  “I Can't Wait for NoSQL to Die” or Dennis Forbes’  “The Impact of SSDs on Database Performance and the Performance Paradox of Data Explodification (aka Fighting the NoSQL mindset)”.

These are interesting articles to read and yes RDBMSs are not going the way of the dodo yet (I even said that in  “The RDBMS is dead”, which by the way, was written before NoSQL was coined, but I digress ). Nevertheless, other options, namely various NoSQL choices, prove to be easier to work with, and  are  a better fit in some circumstances.

Few time (ok very few times), that’s because of sheer size (The “Google”s) but what about the rest of us, should we just stick to good-old-RDBMSs?

If you are have a good understanding of RDBMSs (and/or a great applicative DBA working in your team) then in many cases the answer would be yes. I had a chance to review a couple of systems recently that deal with large amounts of data (in the Petabytes) both systems had a very good DBA teams working on the solution to a point that even ORM was not that important for the solution.

However, in many other cases NoSQL can be a better option. For instance let’s take the Digg case Dennis Forbes talks about. Assuming, for the sake of argument that Dennis completely nailed Digg’s requirements(*) and his single computer +SSD solution is a reasonable solution for Digg. Still the fact is that the Digg’s team where not able to solve their problem with an RDBMS and the same team was able to pull it off with a NoSQL solution. So even if we say the team is mediocre (something they are probably not), NoSQL made it easier to solve a problem they couldn’t have otherwise – that’s a good thing in my book. 

There are additional reasons to use NoSQL besides  sheer size and better alignment with developers’ mind-share though. The more important ones of those are  to get cheaper (vs. comparable commercial RDBMS solutions) scalability and availability.  Again if we look at the Digg switch to Cassandra they cited  “the lack of redundancy on the write masters is painful” and the administrative overhead as main reasons.

In any event it It is important to keep in mind that  NoSQL is not a silver bullet. You need to assess whether or not it is suitable for the problem you have at hand for instance NoSQL solutions place emphasis on different parts of the CAP theorem than RDBMSs do is this what you need? etc.

 

 

* I think that Dennis over-simplify Diggs situation since they also, for example, have heavy concurrent writes etc. 


 
Tags: Software Architecture | Trends

You’ve probably read/heard that yesterday Google held a press event on making the ChromeOS the’ve been working on an open source project. Actually they’ve announced ChromeOS back in July, but now that the source is available it is making more waves. This is a very logical move for Google, and even though I think that they will need to enable some local/offline capabilities before it would be a viable option.

As usual* for Google, they are not the first in this space (If you want to get a webbook today you can try out litl, which looks like a very nice,  or the GOS cloud on the Gigabyte M912)  - but Google’s size and position in the market makes this interesting for everybody.

Anyway, I am almost thinking about a career change to analyst as I’ve been says that’s what they’ve up to since they released Chrome in Sept. 2008. when I published Google Chrome -The browser is the new Desktop. Here’s an excerpt:

Now,in my opinion, Google makes a bold move to change the rules and re-define the playground - if webapss need to run on the desktop, let's make the browser the new desktop.
What makes me say that? because it is focused on application (see the comics),because the browser runs each tab in its own process, because it has a process monitor, because it is a link on the google home page...

From the chrome "OS" point of view we can look at javascript,HTML etc. as the IL (bytecode in java speak) on which the application run. This makes cross-compilers like GWT and the good side of MS Volta (vs. the bad side) the next abstraction layer. I expect these will be more significant in the future

On the same note, it is probably good time to provide a link to a presentation on the future of PCs I’ve created in 2007, which highlights some of the trends that are more apparent today in moving to the cloud


* the most obvious example is of course search (altavista, hotbot etc. have all been there before..), a more recent example is the free GPS turn-by-turn where Waze (an Israeli company by they way) is already there but Google’s announcement is considered disruptive


 
Tags: Cloud Computing | General | Trends

June 23, 2009
@ 10:03 PM

In one of my previous posts (Rest: good, bad and ugly), I made a passing comment, about how I think using CRUD in RESTful service  is a bad practice. I received a few comments / questions asking why do I say that – so what’s wrong with CRUD and REST?

On the surface, it seems like a very good fit (both technically and architecturally), however scratch that surface, and you’d see  that it isn’t a good fit for either.

REST over HTTP is the most common (almost only) implementation of the REST architectural style - to the point REST over HTTP is synonymous with REST. I would say most of the people who think of REST in CRUD terms, think about mapping of the HTTP verbs.

CRUD which stands for Create, Read, Update and Delete, are the four basic database operations. Some of the  HTTP verbs, namely POST, GET, PUT and DELETE (there are others like OPTIONS or HEAD) seem to have a 1-1 mapping to CRUD. As I said earlier they don’t. The table below briefly contrast HTTP verbs and CRUD

Verb CRUDdy Candidate Actually
GET SELECT (Read) Get a representation of a resource. While it is very similar to SELECT it also has a few features beyond an out-of-the-box SELECT e.g. by using If-Modified-Since (and similar modifiers) you might get an empty reply.
Delete Delete Maps well
PUT Update Put looks like an update but it isn’t since:
1. You have to provide a complete replacement for the resource (again similar to update but not quite)
2. You can use PUT to create a resource (when the URI is set by the client)
POST Insert It can be used to create a   but it should be a child/subordinate  one. Furthermore, it can be used to provide partial update to a resource (i.e. not resulting in a new URI)
OPTIONS ? Get the available ways to continue considering the current state or the resource
HEAD ? Get the headers or metadata about the resource (which you would otherwise GET)

The way I see it,  the HTTP verbs are more document oriented than database oriented (which is why document databases like CouchDB are seamlessly RESTful). In any event, what I tried to show here is that while you can update, delete and create new resources the way you do that is not exactly CRUD in the database sense of the word – at least when it comes to using the HTTP verbs.

However, the main reason CRUD is wrong for REST is an architectural one. One of the base characteristics(*) of REST is using hypermedia to externalize the statemachine of the protocol (a.k.a. HATEOS– Hypertext as the engine of state). The URI to URI transition is what makes the protocol tick (the transaction implementation by Alexandros  discussed in the previous post shows a good example of following this principle). 

Tim Ewald explains this  nicely (in a post from 2007…) :

… Here's what I came to understand. Every communication protocol has a state machine. For some protocols they are very simple, for others they are more complex. When you implement a protocol via RPC, you build methods that modify the state of the communication. That state is maintained as a black box at the endpoint. Because the protocol state is hidden, it is easy to get things wrong. For instance, you might call Process before calling Init. People have been looking for ways to avoid these problems by annotating interface type information for a long time, but I'm not aware of any mainstream solutions. The fact that the state of the protocol is encapsulated behind method invocations that modify that state in non-obvious ways also makes versioning interesting.

The essence of REST is to make the states of the protocol explicit and addressableg by URIs. The current state of the protocol state machine is represented by the URI you just operated on and the state representation you retrieved. You change state by operating on the URI of the state you're moving to, making that your new state. A state's representation includes the links (arcs in the graph) to the other states that you can move to from the current state. This is exactly how browser based apps work, and there is no reason that your app's protocol can't work that way too. (The ATOM Publishing protocol is the canonical example, though its easy to think that its about entities, not a state machine.)

If you are busy with inserting and updating (CRUDing) resources you are not, in fact, thinking about protocols or externalizing a State machine and, in my opinion, miss the whole point about REST.

CRUD services leads and promoted to the database as a service kind of thinking (e.g. ADO.NET data services) which as I explained in another post last year is a bad idea since:

  1. It circumvents the whole idea about "Services" - there's no business logic.
  2. It is exposing internal database structure or data rather than a thought-out contract.
  3. It encourages bypassing real services and going straight to their data.
  4. It creates a blob service (the data source).
  5. It encourages minuscule demi-serices (the multiple "interfaces" of said blob) that disregard few of the fallacies of distributed computing.
  6. It is just client-server in sheep's clothing.

The main theme of this and the previous post is that if we try to drag REST to the same old, same old stuff we always did we wouldn’t really get that many benefits. In fact, the “old” ways of doing that stuff are probably more suitable for the job anyway since they have been in use for a while now. and they are “tried and tested”  (“You can’t win an argument with an idiot, he’ll just drag you down to his level and beat you with experience” …). REST is just  a different paradigm that RPC, ACID transactions and CRUD.


* I know I sound like a broken record on that but our industry has a history diluting terms to a point they almost stop being useful (SOA comes to mind..). The way I see it you can have 3 levels on your way to REST over HTTP:

  • You can be using HTTP and XML/JSON – this is level 1 or “Using standards”.
  • You can be using the HTTP verbs properly and/or applying document oriented communications – this is level 2 or “Rest-like” interface
  • You can conform to all REST constraints and be at level 3 or “RESTful”.

All levels can be useful and bring you merit but only the 3rd is REST


 
Tags: REST | SOA | Software Architecture | Trends

A few weeks ago I blogged about Rich Internet applications (again) and how I think Google sees Chrome as an eventual desktop replacement.
Today I've seen that Good OS (makers of gOS - a Ubuntu based Linux distro) released a version they call gOS-Cloud.
This version doesn't have a desktop -only a browser (which looks like chrome). It also  offers a Mac OS X like dock in the browser.
This isn't the big thing yet, since despite the "g" it isn't a Google OS but it does look interesting.
 
It is also interesting to note in this regard that cloud computing is moving more and more into the mainstream when even Microsoft is joining the party with their recent (PDC) announcement of online versions for Office and the azure platform for cloud based platform

 
Tags: Cloud Computing | RIA | Trends

September 21, 2008
@ 11:50 PM
Back in may Andrew Binstock wondered "is the popularity of unit tests waning?" Andrew lists 5 indications he observed to support his conclusion:
  1. Commercial tools are waning
  2. Few OSS products
  3. Unit testing is not taught by major Java instructors
  4. Few books get published on unit testing
  5. xUnit alternatives are completely invisible.
I am not sure I agree with all these observations, nevertheless,in a followup article in Java World Andrew continued to ask "Is unit testing doomed?".
Andrew says that two issues with unit testing are that they seem to offer little value and that the evangelism of unit testing in general and TDD in particular also causes antagonism (I can say from personal experience with introducing unit testing to long time C and C++ developers that, indeed, the initial responses are rather cold)

Andrew also quotes former CEO of Agitar (Jerry Rudisin) saying that "unit testing hasn't taken off as mainstream practice". A survey ran by Scott Ambler for Dr. Dobb's also found that "The more difficult practices, such as TDD and executable specifications, have lower adoption rates than easier practices such as daily scrum meetings." (although another survey by VisionOne found that within companies where agile practices are used 77% use unit testing and about 49% use TDD)

I recently read another interesting post on the subject, this time by Dan North about the "end of endotesting" explaining why the record-reply idium of most mocking framework is not intuitive and more easy to use mocking frameworks like mockito (his example) or Moq and Mocha (my examples) are better.

Now, yesterday I read Roy Osherov's post "Goodbye mocks, Farewall stubs". Roy makes similar observation on the adoption (or lack therof ) of unit testing practices. Roy believes the number one reason holding back unit testing is the learning curve associated with it and suggests we simplify the tools and terminology (and gives a example similar to Dan's mentioned above)

What we see is that both in the Java and the .NET worlds unit tests adoption hit a few snags. The way I see it there are event  additional barriers to wide adoption of unit test and TDD but I'll talk about that in part II where I'll also try to talk a little about what can/should  be done

Powered by ScribeFire.


 
Tags: .NET | Java | TDD | Trends