locked
basic questions about Data Services ? plz guide RRS feed

  • Question

  • thanks for your attention and time.

    I am new to data services and want to use Data Services in a web based project. I have some small questions in this regard; kindly guide me on these.

    1. Can we only use Data services with Entiity frame work ? It was what I saw on all videos and examples.

    2. What is difference in getting data with ordinary web services and with Data Services ?

    3. I need to use Data Servces with asp.net and ajax, gettign data with web services will faster or with Data Services ?

    4. Is Ado.net data services and WCF Data Service same ?

    Thanks

     

    Wednesday, June 30, 2010 1:27 PM

Answers

  • Hi,

    1. WCF Data Services in theory works with any data source. Using EF is the easiest one (Since the support for it is built into WCF Data Services). The next best thing is Reflection provider (which assumes you have all your data ready in memory). You can write your own provider as well, but it's a bit complex. There are some solutions "in the middle", but to be able to suggest those, we would need a bit more information about what you want to expose through OData.

    2. Very short reply: Ordinary Web Services are about operations (the main thing you use is operation/function/method), Data Services are about data (the main thing you use is resource/entity/object). So if you need to expose operations mainly (And want a very strict handle on what the client can do), then go with WCF Services, if you primarily want to expose data (And allow certain freedom of what the client does with it) then use WCF Data Services.

    3. Perf depends... on so many things. The ultimate answer is always "Measure it". This question can't be answered without a deep knowledge of the operations your application will perform. If it's about speed of development, then it's actually about #2 above.

    4. Yes, WCF Data Services is the new name for what use to be ADO.NET Data Services (and previously code name Astoria)

    Thanks,


    Vitek Karas [MSFT]
    • Marked as answer by Haansi Thursday, July 1, 2010 1:45 AM
    Wednesday, June 30, 2010 2:43 PM
    Moderator
  • few more points

     

    1. It works with many other than EF

    2. You have t write lot more code with you own service and rewrite when model changes to replicate what oData does

    3. your own service is faster if you have lot of data. otherwise not a big  difference

    4.Its same

    • Marked as answer by Haansi Thursday, July 1, 2010 1:45 AM
    Wednesday, June 30, 2010 5:50 PM

All replies

  • Hi,

    1. WCF Data Services in theory works with any data source. Using EF is the easiest one (Since the support for it is built into WCF Data Services). The next best thing is Reflection provider (which assumes you have all your data ready in memory). You can write your own provider as well, but it's a bit complex. There are some solutions "in the middle", but to be able to suggest those, we would need a bit more information about what you want to expose through OData.

    2. Very short reply: Ordinary Web Services are about operations (the main thing you use is operation/function/method), Data Services are about data (the main thing you use is resource/entity/object). So if you need to expose operations mainly (And want a very strict handle on what the client can do), then go with WCF Services, if you primarily want to expose data (And allow certain freedom of what the client does with it) then use WCF Data Services.

    3. Perf depends... on so many things. The ultimate answer is always "Measure it". This question can't be answered without a deep knowledge of the operations your application will perform. If it's about speed of development, then it's actually about #2 above.

    4. Yes, WCF Data Services is the new name for what use to be ADO.NET Data Services (and previously code name Astoria)

    Thanks,


    Vitek Karas [MSFT]
    • Marked as answer by Haansi Thursday, July 1, 2010 1:45 AM
    Wednesday, June 30, 2010 2:43 PM
    Moderator
  • few more points

     

    1. It works with many other than EF

    2. You have t write lot more code with you own service and rewrite when model changes to replicate what oData does

    3. your own service is faster if you have lot of data. otherwise not a big  difference

    4.Its same

    • Marked as answer by Haansi Thursday, July 1, 2010 1:45 AM
    Wednesday, June 30, 2010 5:50 PM
  • Thanks for replying Vitek Karas,
    3. Perf depends... on so many things. The ultimate answer is always "Measure it". This question can't be answered without a deep knowledge of the operations your application will perform. If it's about speed of development, then it's actually about #2 above.

    I meant to ask about application performance in term of data traveling speed. What I want to do is immplement WCF web services in a web application which will work with ajax. I have to show filled grid with data, search data and client can get data in a particular category. It is like stack exchange application which give updates of data and client can also search or see all data. I will than fill data in grid (table) using javascript or jquery.

    Please advice should I use WCF data services or web services for efficiency ? What about development time considration ?

    thanks

     

    Thursday, July 1, 2010 1:44 AM
  • Thanks Bineesh AV,

    A little more help please.

     

    "It works with many other than EF"

    1. What can be other data sources please ?

    " You have t write lot more code with you own service and rewrite when model changes to replicate what oData does"

    2. Please can you explain it a little more

    "your own service is faster if you have lot of data. otherwise not a big  difference"

    3. Sorry I cant get it clearly. Do you mean ordinary web services for transfering data are faster than Data Services ? are Data services not specially designed for data transfer ?

    4. Does WCF has many type of services like data services ?

    thanks again

    Thursday, July 1, 2010 1:54 AM
  • Hi,

    about data size on the wire (seems to be what you're asking about), if your client is JScript then you probably need JSON anyway. In which case both WCF Data Services and WCF Services (assuming they support JSON, which I'm not sure) should be similar, it's about the data. The advantage of WCF Data Services is that the client can ask for exactly the information it needs through custom queries in the URL (for example using $select), where WCF Services will always send the entire response. On the other hand you can design the service to return exactly what the client needs in both cases, it's just that you need to modify the server as well.

    About development time, it depends on the application. If the application is data heavy (client does lot of different queries over data and then typical data operation like updating entities) then WCF Data Services should be easier to develop with since data is first class. If the application is operation heavy (lot of different actions to be executed on the server), then WCF Services will probably be easier. One thing about WCF Data Services is that it understands JSON natively (so if your client is JScript it's really easy to talk to the service) and there are client libraries specifically for jquery. See this page for all the client libraries we have (or know about): http://www.odata.org/developers/odata-sdk

    Thanks,


    Vitek Karas [MSFT]
    Thursday, July 1, 2010 1:36 PM
    Moderator
  • If the data format u are using is JSON then wcf DS of custom WS performance wont differ.

    The pain starts if you want to read lot of data and want to try something outside ATOM or JSON format.

    These are the only two supported in WCF DS and they are heavy in size and not many data size optimization available in WCF DS.

     

    >Bineesh

    Thursday, July 1, 2010 8:50 PM