-
Notifications
You must be signed in to change notification settings - Fork 1
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
Initialize this backend #1
Comments
Sounds like fun. I'll have to brush up on activerecord. Where or how to you plan to have the result data stored? Do you have a host for the server once we get it setup? |
probably, this will be run on https://heroku.com (probably some other host later) and results will be store in any postgresql database, actually I've choose https://www.elephantsql.com/ |
Okay, I'll look at active record in association with elephantsql. Do you plan on serving historical data as well or just the current data? |
elephansql is just a postgresql ;-) the main idea is to have a non-local database actually, due to some limitations, only the last data need to be displayed |
If it is the last set of data only, is there really a need for an SQL database or is that just to be able to play with the database? |
I understand you. A flat |
Fair enough. |
Hi, after tinkering a bit on gridsome, I think the graphql on the server-side is redundant since gridsome has another layer of graphql for itself. So it's just a matter of taste if you guys wanted to use graphql on the server-side, I'll rather not use gridsome on the client-side. |
I think having GraphQL on the client side negates some of the espoused benefits of GraphQL. If GraphQL is going to be used it seems like the server side is the place for it. At least thats my opinion. |
@doanguyen honestly, this can be done with a REST API, but there is two things to consider :
@doanguyen Anything could be acceptable, however, I truly think |
Yes, I fully support Graphql as well since I also wanted to know more about it. As consequence, there is no need to use gridsome at the frontend (it brings a lot of overhead), and I will start with a bare-bone react/vuejs project. |
ok, feel free to choose (I prefer |
I was about to get started on this but noticed there are no files in the repo yet. Any reason I shouldn't get it started? |
This is linked with the-benchmarker/web-frameworks#1774. I am about to finish this issue, so I can push some database models here. I do not know about |
No worries. I can work with what you have once you push it. |
I've pushed some code, you need thus to have one postgresql benchmark name
|
I assume you mean one table named benchmark. Any particular structure to the table? Before that though, I haven't spend much time with postgres. Do you have a conf file to use or some hints on how to get set up from scratch? |
I'd like to change the default branch to |
Feel free to change 😛 (even without asking, I'll adapt) BTW, it's a good idea to use 2 branches git workflow for apps |
also |
Exactly. |
Added a Agoo GraphQL hookup. Dummy data not hooked up to the database. Should let you see what the GraphQL would look like. Feel free change the attributes. I'd suggest named metrics in the framework instead of a generic Metric class. The frontend will be happier to have named attributes and not an array of key value pairs. |
Having name metrics could lead to more maintenance. The idea is to have NO devs to do here, when adding any metric in https://github.com/the-benchmarker/web-frameworks. |
There are tradeoffs with generic metrics vs metric attributes. If you prefer generic I'll work with that. I was disappointed to see that request rates are no longer shown on the web-frameworks landing page. Why did you get rid of that? Seems like that is the best indicator of how much load a framework can handle. |
what do you mean ? I have kept I have change the layout just for presentation, but data are collected |
Odd, it's back now. I do see Agoo-c dropped. I'll have to see what happened. |
|
I liked having the req/s sort for obvious reasons. :-) |
Yes, some want to sort by some values, and other for somes ... Having a separated frontend is the solution for this kind of problem 😛 |
Just pushed backend that has GraphQL access to one class, Language. Just a start but pretty confident I know how to take it further. Anyway, I think we need to discuss the models at some point. I don't think the proposed model is going to be very easy for the frontend to work with and it kind of defeats some of the benefits of using GraphQL by using the generic metric and values. I'd be very glad to explain my reasoning if you are interested. |
Hi @ohler55, I think that you are saying will had more complexity, but feel free to write the code. I have no time (in short term) to do this. So I let you do it 😛 No matter what, I'll met you at some point (I mean modifying https://github.com/the-benchmarker/web-frameworks to fit this project requirements is not a big deal). Regards, |
fell free to play with fake data |
Will do. I could implement both approaches and we can then compare. I am also strapped for time so it will be a slow process initially. |
no matter of time 😛 I prefer to be it could be very good to implement both, up to you, but will be ❤️ |
@ohler55 I think having a specific backend I think of using https://hasura.io as the back end layer. What do you think ? |
Funny I was talking to a fellow yesterday about this application, the benchmarked that is. He does a lot of front end work but also deals with backends. His suggestion was go simple with just JSON data file. I see you are leaning in the other direction and adopting a fairly substantial backend infrastructure. I'm probably biased as I would like to exercise Agoo GraphQL so that would be my preference since the object model is pretty trivial but I know you had mentioned that this was more of a change to use different technologies. I't had for me to recommend as I'm not sure what your requirements or desires are. I had planned to ping you later tonight to see if we could get this moving again and maybe take a step back and identify the requirements and then look at the desired architecture. So good timing. 😄 If you can list out the requirements, including the obvious of wanted to display the benchmark data I can do my best to remain unbiased and help you decide. |
The purpose is to have the simplest way to query results of https://github.com/the-benchmarker/web-frameworks The thing is that results is store in a database, and, in my opinion, the more efficient way to get them (in this context) is to have a So, there is :
The hard point If you think you have enough time to create this app, I be please ❤️ |
I do have the time. We had some differences on the use of the SQL database. If you are up for it lets discuss that or is that not up for discussion? It is something that would be applicable even if using a different backend. |
Let me jot down some thoughts on architecture. See if we are in sync. There are three components in the system; the benchmarker, a results server, and a presentation component. Ideally there would be just two API to deal with. One between the benchmarker and the server and another between the server and the UX. Adding a third between the benchmarker and UX would not be ideal and should be avoided. Benchmarker - Server API The API is from benchmarker to server and the data is static. Among the options for providing the data to the server are:
Of the outlined options the SQL database was chosen. Next the table definitions are needed. Typically tables are normalized to reflect the concerns of the data being stored. In this case benchmark results and the frameworks associated with each result so a single table would be sufficient with one row per result and multiple columns with each type of result value. The API between the server and the UX should be based on an object model that matches the user's conception of the system or in this case benchmarks. That will make building the UX more straight forward. Ideally the model should be fairly close to the way the data is presented in the benchmarker to server API. In this case that is possible although in some more complex systems there may be some variations. For benchmark results a model can be defined that can be used for both the server to UX API as well as the benchmarker to server API (database). The APIs can be defined with an annotated table definition and a GraphQL schema file. Comments? Agree or disagree? |
How can it be done ? This feature could reduce complexity, and allow either backend and benchmarker to grow separately |
Using GraphQL syntax the results might look like this assuming we decide type Result {
language: String! # better to make Language but this gets the point across more simply
framework: String!
rate: Float
medianLatency: Float
averageLatency: Float
latency90: Float
latency99: Float
} A change in the schema would have to be reflected in both the database schema and in the GraphQL. Following that the Ruby classes would be updated but the Ruby classes just pass along data from the ActiveRecord wrappers so there would not be a lot of code to say add a new metric to the benchmarks. Of course I can't speak for what changes would be needed in the UX. I hadn't looked at the results in a while. I noticed significant changes so the suggestion above might need reworking depending on what you have in mind. |
Ok. I see. The idea is to share this code so as results production and UX could be totally isolated. I like the idea, but I'm not capable of doing such a thing. I propose to create a usable Regards, PS : I think having this shared part of code could be avoided using https://jsonapi.org/ thus |
Happy to fill out a GraphQL schema. Personally I'd skip the addition of another format for API definitions and translations to GraphQL and table definitions and just go straight from GraphQL to table definition. GraphQL is meant to be a description of an API so ideally it should be sufficient for that. Of course that would mean we need a tool to go from GraphQL to table definition. That might be a useful addition to Agoo so glad to provide that either as part of Agoo or separate. |
I created a PR with the GraphQL schema. Please take a look and comment. |
@ohler55 will it be convenient for you if I create a gem that contains the whole database structure (models, migrations ...)? |
and of course an up-to-date GraphQL schema |
I can get started on that next week. This week is packing for a move. |
I mean, that I can create a will it be helpful @ohler55 ? |
That would be extremely helpful. |
Ok, will do BTW, I will switch to |
You mentioned creating a gem. Is that needed or just put the Ruby code in this project. |
I will create this |
I forgot about that. Yes, multiple project. Great. |
Hi @ohler55,
We need a backend to get some results. The best (I think) is GraphQL since it allow end-user to create custom queries.
Would you mind to initialize a project (using
agoo
) that is a GraphQL API to discover our results.I don't know how to code with
agooo
, could you please initialize this project withactiverecord
, I'll create migration ... to define the model so as @doanguyen could work on frontend part.I ❤️ collaboration
The text was updated successfully, but these errors were encountered: