Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGWT and Couchbase as Database

    Hi All,

    I have a license for SmartGWT 5.1p Power.

    I need some recommendation for best practice. My database is couchbase and I cant use all the nice sql features SmartGWT Power provides. However I dont have a clear idea what is the best way to go. CustomDatasource or maybe RestDataSource. Couchbase talks Json and N1sql which is a kind of sql. I tried REST but got some obstacles. I dont know what is the best way so i can use the features like databinding, criteria and so on.

    Maybe someone can give me any advice so I can decide for the best way. I really stuck.

    Thx

    #2
    If you still have an opportunity to rethink your database choice, we would recommend doing so. The grid components you have purchased have the capability to instantly provide a huge range of powerful features against SQL databases, with no coding effort on your part. "NoSQL" databases like Couchbase, since they don't support basics like joins and have various restrictions on filtering, can't support the UI functions that our advanced grids provide to users - at least not without a lot of extra effort, and terrible efficiency.

    And if you have chosen SmartGWT because our samples look like something you want to build, then the strengths of Couchbase probably won't come up..

    If you're forced to continue with Couchbase, you definitely want to pursue server-side Data Integration. Start with the QuickStart Guide chapter on the Server Framework, and pay extra attention to Custom DataSources.

    Comment


      #3
      Well, I created a small web app with SmartGWT and mysql and it was nice to use the data binding and filtering in Grids. Couchbase provide with N1sql a language which is very similar to sql. But as far as I understood your message even I use Custom DataSources I would loose all the powerful features of UI components. I won't mind to create a Custom DataSource for the CRUD methods in Couchbase but I am afraid that at the end I can't user the power of SmartGWT components. But your framework provides Custom DataSources and RestDataSource. So I can't get the same behaviour for components when I choose these DataSources?

      So I have to rethink about the database now which is a little disappointing. Unfortunately to change the GUI framework is not an option.

      Thx

      Comment


        #4
        Another question to the professional smartgwt guys: When a custom datasource is created for Couchbase and the methods fetch, updates, add ,... are written with the given criteria then the gui components should work as expected with all features, right? It would be a bunch a work to analyze the criteria parameter and to translate for couchbase. For sure the connectivity is another part however this is not difficult.

        Thx

        Comment


          #5
          If you create a Custom DataSource and implement all the CRUD operations including support for Advanced Criteria, multi-level sort, etc, then all the GUI features will work.

          The problem is that you will find this difficult to do with Couchbase because it lacks a lot of functionality. To fully support all the powerful features offered by our grid, you'll have to do things like send only some of the filtering and sorting options to the database (the ones it can support) and do the rest in Java code in your Custom DataSource. We've had to do this before for other underpowered databases (eg LDAP) and it's tricky.

          Switching GUI frameworks doesn't help with this problem. Any GUI framework that offered the same range of grid functionality would put you in the same situation, because the underlying problem is that it's difficult to implement this functionality in Couchbase.

          Note that our grids allow you to turn off some of the more powerful features (for example you can set listGrid.canMultiSort to false), but of course, that's dumbing down the GUI to fit the database.

          Note also that the very powerful dataSourceField.includeFrom feature, normally implemented by a SQL join, will instead be implemented by an in-memory join done in Java - far, far less efficient, but then Couchbase doesn't support joins so there's no other choice.

          Comment


            #6
            Thank you very much for the details. At least I know now which way to go to use couchbase. At the moment I could add mysql because I have no time. But I will try to create a custom datasource for couchbase when i got more time.

            Comment


              #7
              Hmmmm, well, when you have time, bear in mind that setting up MySQL is going to be a *lot* faster than trying to implement these features on Couchbase :)

              Also, for completeness - if your data volume is low, you can just set listGrid.dataFetchMode:"local" and all filtering and sorting is implemented client-side, with no effort required.

              Comment

              Working...
              X