This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3948|Reply: 0

[Communication] OData – OData vs GraphQL

[Copy link]
Posted on 5/20/2023 8:28:50 PM | | | |
GraphQL is very popular, very powerful, but it is fundamentally different from OData. So it's not that any one is absolutely better than the other.

GraphQL is not OData:The hyperlink login is visible.


There are a few points that I can get.

OData = SQL in URL


OData was a way to serialize a SQL statement into a URL

It is difficult to limit the query ability of the client side.

OData Standardized


OData's specification is its strength, just like RPC does to RESTful. RESTful has specifications and is easy to understand, but it is not easy to express everything. RPC can express everything, but it is too unstandardized.

Flaws in OData


OData is usually tighter than the database schema state (so it's like SQL Query), and once the schema is changed, it's harder to maintain the old version.

OData prefers unified management, and it is difficult to optimize for special cases.

Best described


OData is like SQL Query, GraphQL is like stored procedure. You taste slowly.

Therefore, these two must coexist and complement each other.


summary

OData is like SQL Query, GraphQL is like stored procedure.

OData is like RESTful, and GraphQL is like RPC

When you want simple unification, you will find RESTFul great, SQL Query is sufficient, OData is good.

But when you have special situations and can't use a simple method, RPC, stored procedure, GraphQL highlights its charm.

Let's look at the usage scenarios of both sides. OData is inclined to be an API for enterprise applications, such as SAP. Usually the simpler, relational database pattern.

GraphQL is an Internet application, an exposed API, and a whatever type of data (such as NoSQL)

So in summary, GraphQL can express more (freer) than OData, OData has rules (more constraints) than GraphQL

Which one is it, or GraphQL for the outside world, or OData for the internal, it really depends on the project to use it.

【OData】(1) Basic knowledge of OData
https://www.itsvse.com/thread-10508-1-1.html





Previous:C# EPPlus Bulk Style Cells
Next:ASP.NET Core (nineteen) uses BackgroundService to run background tasks
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com