Hi Harshan, if you only want an indicator whether or not a table exists, the API you specify is the right way to go :-)
And it's a nice RESTful API... Best regards, Frank 2015-02-17 6:08 GMT+01:00 Harshan Liyanage <[email protected]>: > Hi Gimantha, > > I think Frank has explained everything about the usage of *GET > /analytics/tables/{tableName}*. Anyway what my point is that if we have > used *GET* */analytics/tables/{tableName} *to check the existence of the > table it would work nice if the table does not exist. But if the table > exists, all the table data will be retrieved from the database & sent over > the network instead of a simple Boolean "*TRUE*" result. This will > introduce unnecessary performance drawback in your backend server & > unnecessary network traffic. > > So I'm +1 on using below API for that purpose. > > *GET /analytics/table_exists?tableName=<table-name>* > > Thanks, > > Lakshitha Harshan > Software Engineer > Mobile: *+94724423048* > Email: [email protected] > Blog : http://harshanliyanage.blogspot.com/ > *WSO2, Inc. :** wso2.com <http://wso2.com/>* > lean.enterprise.middleware. > > On Mon, Feb 16, 2015 at 1:21 PM, Gimantha Bandara <[email protected]> > wrote: > >> Hi Frank, >> >> Thanks you for your explanation!. What we currently do is, using *GET >> /analytics/tables/{tableName} *get the whole table, if the table does >> not exist, HTTP status will be 404 and the response body will have a >> message saying that the table does not exist. >> >> On Sun, Feb 15, 2015 at 9:03 PM, Frank Leymann <[email protected]> wrote: >> >>> Hi Gimantha, >>> >>> it depends on the scenario: if you want to check existence of resource >>> it's fine to use a GET on this resource and receive a "404 Not Found". >>> >>> But the subtlety is that "Not Found" according to HTTP is statement in >>> time: you cannot infer that the resource "does not exist", all that 404 >>> says is that it cannot be found at this point in time, i.e. it maybe found >>> later. If your scenario doesn't care about that you are fine. >>> >>> Furthermore, in case the resource in fact is found, the GET on this >>> resource will return the complete table. This might not be acceptable if >>> you only want to get an indicator that the exists. The signal for existence >>> shouldn't the possibly huge table itself. >>> >>> Thus, depending on your scenario you may consider a corresponding >>> function. By the way, this is completely compliant to the REST style that >>> foresees such "processing function resources". >>> >>> >>> Best regards, >>> Frank >>> >>> 2015-02-14 15:01 GMT+01:00 Gimantha Bandara <[email protected]>: >>> >>>> Hi Manuranga, >>>> >>>> Already *GET /analytics/tables/{tableName} *returns 404 if the >>>> table doesn't exists. So we will not need a separate API. Thanks for your >>>> feedback. >>>> >>>> On Sat, Feb 14, 2015 at 12:22 PM, Manuranga Perera <[email protected]> >>>> wrote: >>>> >>>>> there shouldn't be a separate end point for "is-exists" >>>>> >>>>> *GET /analytics/tables/{tableName}* - Will return table informing if >>>>> it exists and if not it should return 404 >>>>> >>>>> _______________________________________________ >>>>> Architecture mailing list >>>>> [email protected] >>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >>>>> >>>>> >>>> >>>> >>>> -- >>>> Gimantha Bandara >>>> Software Engineer >>>> WSO2. Inc : http://wso2.com >>>> Mobile : +94714961919 >>>> >>>> _______________________________________________ >>>> Architecture mailing list >>>> [email protected] >>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >>>> >>>> >>> >>> _______________________________________________ >>> Architecture mailing list >>> [email protected] >>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >>> >>> >> >> >> -- >> Gimantha Bandara >> Software Engineer >> WSO2. Inc : http://wso2.com >> Mobile : +94714961919 >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> >
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
