-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion around the project #8
Comments
Hello, Thanks for the great question! About replacement of
You are right that it can provide a replacement for The basic idea about There are also other reasons why I've started this project which include topics like reflection, circular reference handling, custom property types, DI, etc. so I don't have to create a frankenstein from set of libraries to make it work in one project. :D |
Hello, Thanks for the explanations! If I understand well, you plan to use this library in client side applications only right? In order to be able to fetch remote data from APIs? How are architectured your projects? On my side I'm looking for a data library (packaged as an API library) that I can use on both client AND server side. To give you an example:
Do you see where I want to go? The ultimate goal is to have one data library handling REMOTE (JSON APIs) AND LOCAL (SQL) data fetching and unifying everything together. |
Hello,
No, it is planned for both client and server. By answering yes/no I meant in the first round the plan was to focus on API's as there are not too much good alternatives in my opinion.
Are you asking about libraries or projects where they used?
The same way as I do. :D
The answer is yes there are plans to do that. I wanted to proceed with What slice of functionality are you looking for when talking about |
Do you have a tasks board where I can see what you plan to do, the time it needs to be done then we can iterate from there? On my side I'm interested to have at least one remote connector (JSON API) and one local connector (DB) full functional ASAP in order to be able to use this library both from client side and server side. It's not my priority to have You have your roadmap/I have mine and from what I see, if I give a hand I will handle the |
There are no any board as for now. I don't have to create a board for my self due to time management. I keep ideas as a simple list. The nearest tasks I plan to work on is to enable source maps for all projects and provide response validation for
Yeah we can proceed almost immediately. I have not started other providers yet so it is ok. We can create a repo + board. Identify the issues to solve. From what I see we need query, filtering, saving and pagination part. The same functionality which is present for |
Hello,
Exactly, we have to do the same in SQL syntax terms: SELECT, INSERT, UPDATE, DELETE ; filtering: WHERE ; paginating: LIMIT/OFFSET. No need for migration, I'm going to challenge you on this: What's the value added by I'm going to be a lot challenging on every parts of this project to be sure that you/we are not re-inventing the wheel. The complexity of the project is not on connectors/drivers I think, it's on the merge of multiple drivers output to make a response, i.e: filtering a set by relationships :) If I have Which model/service is hosting the data related to the relationship between |
Hello,
Well first of all it is not decorator library. I promote it mainly as serialization / deserialization library as it solves many issues of existing serialization libraries, e.g. TypedJSON, class-transformer which stay open for months. Decorators are simplification for several basic functions provided by library and that's it. You can decorate 3rd party classes pretty easy if you would like or use different decorator configurations for the same entities within one application. The main purpose of
And this is only a top of the list for which Unfortunately ~ 60% of use cases provided by So in general it is not anyhow related to And here we come to
To solve this issue
Many to many relationship filtering is currently not implemented. I'm still thinking about best way to handle it in the API. But based on your example if consider that many-to-many relationship filtering is implemented as I see it now here will be a request to fetch data. e.g. SELECT statement which
Or it may be an UPDATE statement.
The first one results in BulkQueryCommand and the second one in BatchUpdateCommand. This commands should be handled by To build a SELECT part you have to use
The relations between entities, e.g. one-to-one, one-to-many, many-to-many can be identified using If you mean by
We are actually reinventing a wheel in some manner. :) Each similar project is about reinventing a wheel. Lets say I have some vision of how such software should behave. Open source is always about finding the people which have the same vision on similar problems. For example TypeORM may be perfect for one and bad for others. The same is applied to |
Thanks for the detailed explanation. About the many to many relationship example (Posts, Tags and Author), I think you didn't get what I was implying because you gave me a SELECT with a WHERE clause in it. Posts, Tags and Author are not in the same database nor in the same service so you cannot do it in a single SQL request statement to handle that. And that's why I asked where do you store the relationships data :) In a micro-services app, by having every model splitted into isolated services, you lose the ability to do a The "joining" must be done by the library you are developing ;) there is a post request processing to do |
Thanks for details! Looks like I've finally got your idea. :)
I gave a SELECT statement as an example which can be sent to a database by a plugin. You can build and send any requests including case with multiple databases and then filter, sort and paginate data in memory like it is done in
This are details of underlying
I don't know your project architecture but looks like you over engineering. Of course you know better what you are doing but the concept of merging and filtering you described will result in poor performance because of network requests and in memory filtering. Besides if one service goes down then ORM become broken. This is not how microservices intended to work based on my experience. Such cases like merging data from several microservices in realtime makes them depend. This is a critical point of failure. What you can do instead is setup messaging brokers and create readonly view in a special separate microservice which updated using events from underlying services when there are related changes. Such service will work for the end users even if all other services go down. You can use regular ORM like I've build event sourced systems and regular one. In both cases There are also complex scenarios like distributed transactions e.g. transactions which span multiple services. But note that this is a little bit different from what you described. It is about that you cannot change data until there will be some required state. For example in market aplication you cannot send product to customer (ShippingMicroservice) until you withdraw the money from local account (AccountingMicroservice) and you cannot withdraw the money until bank system (ExternalService) tells you that there is required amount. If there are no event sourcing concept involved people usually use saga pattern. Just connect their favourite ORM per bounded context (microservice) and call propper API's with proper entities which are defined per each context. In this case However there are exist libraries at least for C# which allow you do thing which you are going to do. For example HotChocolate GraphQL stitching module. Maybe similar libraries exist for TypeScript which allows to create a schema from several different services / databases / rest API's but as I described this is not a best approach in case of microservices in my opinion. Sorry for a long post. I tried to be as short as possible with my thoughts as I see that there is no need for us to invent something. At least this is not an area where I plan to go with a library. :) |
Hello,
From what I understand of this library, it replaces others ORM like TypeORM (you have entities, stores, drivers, etc) in order to be able to fetch data from a JSON API and I was thinking: why not developing a JSON API driver for TypeORM for example?
Because in the end, you have developed a JsonApiEntityProvider but you will have to do one for SQL Database, isn't it?
The text was updated successfully, but these errors were encountered: