Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I have a service A, Service B, and Service C. A database is attached to service B. My requirement is to send data from service A every second. Service B processes the received data and store it in the database. Service C fetched processed data from the database ( by interacting with Service B ) every 5 seconds.
My question is, In the interaction between A to B, Would POST request be more efficient than PUT request considering performance constraints ( RAM and CPU usage ). Note that the request from A to B is using the same URI. Additionally, while fetching data from the database ( which is also using a single URI ) will the PUT method give me additional performance efficiency over the POST method?
There are no performance benefits between POST, PUT, DELETE. It's more a question of what your backend will do. Create a new entity? You might want to use POST. Update it? Use PUT. A more detailed answer between the two can be found here.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
This post was edited and submitted for review 1 year ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
I'm new to Java.
Say I want to make a simple game with Swing or whatever. How and where do I store variables like the player's score or progress, for example, so that I can access it from different classes (during the game and before persistence in the database). I like how we use useContext in React. I also used global variables in PHP's sessions.
I highly advice to not use a "global state". I would rather recommend to implement a domain object or service that fetches high scores. This service can then be injected and called where needed.
Using a domain object or a service to access and modify domain data has the benefit that ownership is clearly defined: the business object/service owns the data, and the data is only accessed and modified through the business object/service.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a school application. Where the teacher can send mail to each parent. Parent has to check email and confirm (reply) back in 2 days .
If the parent does not respond back we automatically need to send out second followup email.
Parent response will be parsed in Lambda and same will be updated in database. so that we should not send followup email .
I am using Amazon SES for sending the email.
How can implement wait for 2 days logic ? should I use lambda function or JScheduler ?
How can implement wait for 2 days logic ?
You may use AWS Step functions which is statefull state-machine workflow. The service implements a wait task you may use to way for 2 days
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm new to using a database, specifically MySQL. I'm creating a web application for class in which you can look up the name of a book and it'll display the summary of the book. My question is should I send a query to the database that collects all of the books' data on initialization and put them into a HashMap inside a manager class for lookup or should I use a query each time to lookup a specific book information?
It depends on the data transport time I would say. If your average query time times the number of request goes faster than a script to put everything into a HashMap, use queries. Otherwise, use a script that collects everything and puts it into a HashMap.
But if you have thousands of rows, you should use queries, because otherwise you will use too much RAM.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am writing Pagination for a set of records in Java. Here i am talking to a service which fetches a result set of 500 per time. I interact with that service to display at most 50 records at a time with page markers.
Is it a really efficient model or if there is any other way to improve the suggested pagination model ?
Depends on your data.
If your data is rapidly changing, this definitely isn't a suitable method. I would suggest tweaking the service to return only as much requested records that are needed by the page.
If data is static and need not be time dependent, this should work fine. Just fetch the 500 records, put it in a local array and display from there. Once this is exhausted, replenish the same.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Please help me to understand how to expose service in REST.
Is it depends on RESOURCE or depends on the size of data ?
Example:
Let we take 2 resources (STUDENT & DEPARTMENT). Now I have an requirement of exposing "Total number of Students" and "Total number of Departments".
How should I expose a service now ?
Is it like exposing 2 different resource(api/student/total & api/department/total) ?
Or can it be do like this(api/total/student,department) since the response data will be very minimal ?
Should we consider the response size when deciding about Resources ?
It depends.
If you want a very clean interface, that sticks as strict as possible to the REST-rules, than use solution 1. I would recommend this if you expose your API to the internet for a broad audience.
If you want to optimize performance use solution 2. This would especially make sense if you know all the appications that use your API and sticking to official rules is less important.