Dynamic Remote Queries (e.g. serializable LINQ)
I'm looking for possible solutions for the following scenario:
- I have a service that holds a large amount of data in memory and also updates the data at very high frequency
- I want to make that data query-able for clients over the internet
Ideally, I'd like the client to write a LINQ query on the client side against a proxy object model, serialize the expression tree, send the serialized query over the wire, make sure the client only executes "read" operations and then return a dynamic result set.
Unfortunately, it doesn't seem that easy to serialize/deserialize the expression tree and also ensuring read-only operations (prohibiting malicious queries).
One idea was to use the LINQ to SQL provider to serialize the query and then use Entity SQL on the server side to deserialize the query and run it againt my object model.
Anyways, I was wondering, what other elegant options I have in building this service.
Thanks,
Tom
.net service
add a comment |
I'm looking for possible solutions for the following scenario:
- I have a service that holds a large amount of data in memory and also updates the data at very high frequency
- I want to make that data query-able for clients over the internet
Ideally, I'd like the client to write a LINQ query on the client side against a proxy object model, serialize the expression tree, send the serialized query over the wire, make sure the client only executes "read" operations and then return a dynamic result set.
Unfortunately, it doesn't seem that easy to serialize/deserialize the expression tree and also ensuring read-only operations (prohibiting malicious queries).
One idea was to use the LINQ to SQL provider to serialize the query and then use Entity SQL on the server side to deserialize the query and run it againt my object model.
Anyways, I was wondering, what other elegant options I have in building this service.
Thanks,
Tom
.net service
add a comment |
I'm looking for possible solutions for the following scenario:
- I have a service that holds a large amount of data in memory and also updates the data at very high frequency
- I want to make that data query-able for clients over the internet
Ideally, I'd like the client to write a LINQ query on the client side against a proxy object model, serialize the expression tree, send the serialized query over the wire, make sure the client only executes "read" operations and then return a dynamic result set.
Unfortunately, it doesn't seem that easy to serialize/deserialize the expression tree and also ensuring read-only operations (prohibiting malicious queries).
One idea was to use the LINQ to SQL provider to serialize the query and then use Entity SQL on the server side to deserialize the query and run it againt my object model.
Anyways, I was wondering, what other elegant options I have in building this service.
Thanks,
Tom
.net service
I'm looking for possible solutions for the following scenario:
- I have a service that holds a large amount of data in memory and also updates the data at very high frequency
- I want to make that data query-able for clients over the internet
Ideally, I'd like the client to write a LINQ query on the client side against a proxy object model, serialize the expression tree, send the serialized query over the wire, make sure the client only executes "read" operations and then return a dynamic result set.
Unfortunately, it doesn't seem that easy to serialize/deserialize the expression tree and also ensuring read-only operations (prohibiting malicious queries).
One idea was to use the LINQ to SQL provider to serialize the query and then use Entity SQL on the server side to deserialize the query and run it againt my object model.
Anyways, I was wondering, what other elegant options I have in building this service.
Thanks,
Tom
.net service
.net service
asked Aug 23 '10 at 20:08
TJF
1,49632237
1,49632237
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
You might consider implementing an OData end point for your client to access. Server and client libraries already exist to provide the following functionality:
- Ability to set read-only access to your data
- Data queryable by client via LINQ
Now, I'm not sure if this solution will neatly provide for serializing/deserializing the expression tree; you might have to do some manual work to get that to happen since you're dealing with in-memory objects.
Most examples I've seen of using OData have been with using databases as the backend. However, you could build a custom OData provider for your in-memory data and then still take advantage of the common protocol and rich client library support against that protocol. If the entire purpose of the serialization/deserialization is to be able to transfer data via HTTP, OData already solves this for you.
For a quick example of an OData endpoint in action, visit Stack Overflow's implementation of OData. They've implemented a solution that allows you to write a straight-up SQL query to get data from StackOverflow. While I wasn't able to find the exact query string that they use against their OData Service for a test query, I did notice the results came back serialized as JSON when I inspected the response via Fiddler. It's a good example to see the power of OData.
add a comment |
You may look at WCF Data Services, for building an OData service.
add a comment |
I recently used Remote.Linq in a project and so far it's been stellar.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3551258%2fdynamic-remote-queries-e-g-serializable-linq%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You might consider implementing an OData end point for your client to access. Server and client libraries already exist to provide the following functionality:
- Ability to set read-only access to your data
- Data queryable by client via LINQ
Now, I'm not sure if this solution will neatly provide for serializing/deserializing the expression tree; you might have to do some manual work to get that to happen since you're dealing with in-memory objects.
Most examples I've seen of using OData have been with using databases as the backend. However, you could build a custom OData provider for your in-memory data and then still take advantage of the common protocol and rich client library support against that protocol. If the entire purpose of the serialization/deserialization is to be able to transfer data via HTTP, OData already solves this for you.
For a quick example of an OData endpoint in action, visit Stack Overflow's implementation of OData. They've implemented a solution that allows you to write a straight-up SQL query to get data from StackOverflow. While I wasn't able to find the exact query string that they use against their OData Service for a test query, I did notice the results came back serialized as JSON when I inspected the response via Fiddler. It's a good example to see the power of OData.
add a comment |
You might consider implementing an OData end point for your client to access. Server and client libraries already exist to provide the following functionality:
- Ability to set read-only access to your data
- Data queryable by client via LINQ
Now, I'm not sure if this solution will neatly provide for serializing/deserializing the expression tree; you might have to do some manual work to get that to happen since you're dealing with in-memory objects.
Most examples I've seen of using OData have been with using databases as the backend. However, you could build a custom OData provider for your in-memory data and then still take advantage of the common protocol and rich client library support against that protocol. If the entire purpose of the serialization/deserialization is to be able to transfer data via HTTP, OData already solves this for you.
For a quick example of an OData endpoint in action, visit Stack Overflow's implementation of OData. They've implemented a solution that allows you to write a straight-up SQL query to get data from StackOverflow. While I wasn't able to find the exact query string that they use against their OData Service for a test query, I did notice the results came back serialized as JSON when I inspected the response via Fiddler. It's a good example to see the power of OData.
add a comment |
You might consider implementing an OData end point for your client to access. Server and client libraries already exist to provide the following functionality:
- Ability to set read-only access to your data
- Data queryable by client via LINQ
Now, I'm not sure if this solution will neatly provide for serializing/deserializing the expression tree; you might have to do some manual work to get that to happen since you're dealing with in-memory objects.
Most examples I've seen of using OData have been with using databases as the backend. However, you could build a custom OData provider for your in-memory data and then still take advantage of the common protocol and rich client library support against that protocol. If the entire purpose of the serialization/deserialization is to be able to transfer data via HTTP, OData already solves this for you.
For a quick example of an OData endpoint in action, visit Stack Overflow's implementation of OData. They've implemented a solution that allows you to write a straight-up SQL query to get data from StackOverflow. While I wasn't able to find the exact query string that they use against their OData Service for a test query, I did notice the results came back serialized as JSON when I inspected the response via Fiddler. It's a good example to see the power of OData.
You might consider implementing an OData end point for your client to access. Server and client libraries already exist to provide the following functionality:
- Ability to set read-only access to your data
- Data queryable by client via LINQ
Now, I'm not sure if this solution will neatly provide for serializing/deserializing the expression tree; you might have to do some manual work to get that to happen since you're dealing with in-memory objects.
Most examples I've seen of using OData have been with using databases as the backend. However, you could build a custom OData provider for your in-memory data and then still take advantage of the common protocol and rich client library support against that protocol. If the entire purpose of the serialization/deserialization is to be able to transfer data via HTTP, OData already solves this for you.
For a quick example of an OData endpoint in action, visit Stack Overflow's implementation of OData. They've implemented a solution that allows you to write a straight-up SQL query to get data from StackOverflow. While I wasn't able to find the exact query string that they use against their OData Service for a test query, I did notice the results came back serialized as JSON when I inspected the response via Fiddler. It's a good example to see the power of OData.
edited Aug 29 '17 at 13:55
Cœur
17.4k9103145
17.4k9103145
answered Aug 23 '10 at 20:27
Ben McCormack
18.7k44120201
18.7k44120201
add a comment |
add a comment |
You may look at WCF Data Services, for building an OData service.
add a comment |
You may look at WCF Data Services, for building an OData service.
add a comment |
You may look at WCF Data Services, for building an OData service.
You may look at WCF Data Services, for building an OData service.
answered Aug 23 '10 at 20:27
Albin Sunnanbo
40.9k65596
40.9k65596
add a comment |
add a comment |
I recently used Remote.Linq in a project and so far it's been stellar.
add a comment |
I recently used Remote.Linq in a project and so far it's been stellar.
add a comment |
I recently used Remote.Linq in a project and so far it's been stellar.
I recently used Remote.Linq in a project and so far it's been stellar.
answered Nov 19 '18 at 16:21
fartwhif
846
846
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3551258%2fdynamic-remote-queries-e-g-serializable-linq%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown