All Questions
42
questions
11
votes
5
answers
3k
views
Why split up data retrieved from a database into multiple endpoints, if we need ALL the data anyway?
I have a "Games" API which retrieves video game data from a large database.
The /games endpoint returns some very basic information about the game, such as the title, description, etc.
More ...
1
vote
3
answers
3k
views
Designing APIs that don't expose database primary keys
People say "don't expose primary keys from the database in your API" because its a major security leak, so I'm trying to come up with a way for:
RESTful HTTP requests to reference server-...
1
vote
2
answers
2k
views
When updating a model on a RESTful API, should there be an update endpoint per field? or one endpoint for the model?
For a RESTful API, consider a model schema as follows:
MyCoolObject {
field_a
field_b
field_c
}
Is it better to create one update endpoint to update one or many fields on the model? Or create ...
0
votes
1
answer
593
views
Using databases to store temporary results between the backend and frontend of a webservice
I have a multithreaded backend application. It is inputted x, and outputs y, and this makes up a "job". A job can take up to several seconds to complete. The application is fed input via ...
2
votes
3
answers
2k
views
In a micro service architecture, how should two services communicate with each other? Shared database? REST calls?
I've read a number of conflicting articles as to whether microservices should share a database. How and when should microservices communicate?
Someone posed the example of 2 microservices:
Employee
...
0
votes
2
answers
245
views
Check if can delete before save
I am designing an application that works with REST API requests for dealing with information stored in a database.
The user will add, edit, delete information in this client and after SAVE the ...
2
votes
1
answer
464
views
How to handle db password change in a live service
Suppose I have a REST application running on a remote server which connects to a mysql database. Now let's say the password of the db has to be changed. What are the right methods and practices that ...
-1
votes
1
answer
1k
views
Android Chat Application Architecture with websocket
I'm trying to build chat application in Android (future maybe webapp also) using websockets. The purpose of this project is to familiar with websockets, get know websockets and real time applications. ...
1
vote
3
answers
252
views
REST action as part of request body - action not stored alongside entity
I am working on an API that allows a client document to updated under the endpoint of PUT /client/{documentId}. As part of this document, I need to include an extra field 'ReplicateInManager' that ...
0
votes
1
answer
98
views
How to keep user inputs consistent with assumed inputs to slow computations at the backend?
Background:
I'm writing a clinical trials simulator. The user defines future trial options, eg a trial with 100 placebo patients, 200 treatment patients, "optimistic" outcome scenario, etc. There can ...
3
votes
3
answers
161
views
Delete user data or replace it with empty resource?
Say, we have a public facing REST API which lets user manipulate data using POST, GET and DELETE. The API is exposed via Service A which at the backend calls Service B where most of the business logic ...
-2
votes
1
answer
395
views
Generate HTTP RESTful server from database schema
Today the job of most Java-based servers is to translate HTTP requests into SQL commands/queries and send a JSON-ed response back to the client. That's a pretty generic (and honestly boring) job.
I ...
1
vote
2
answers
1k
views
Real Time Web Sockets Architecture
I am confused here on how real time analytics is accomplished with web sockets when data is inserted into the system via a REST API. In my (admitted immature) understanding of web sockets, you have ...
3
votes
1
answer
2k
views
Check if object exists before updating/deleting
In an application that doesn't use an ORM, is it good practice to check whether an object exists before attempting to update/delete it?
For example:
@Route(method="DELETE", path="/posts/\d+")
...
0
votes
1
answer
798
views
Multiple sessions accessing localhost database
I do not how to ask the question, but I am confused by how to manage sessions when the server is at local host.
Accessing the database direct
Without a middleware (REST), sessions are created as ...