samedi 10 juillet 2021

Web Apps and API: what terminology to use and any available resources?

Meta information

My question may come as a bit vague but I am a new developer and new to stack overflow. I am working on a web project and I have some design scenarios that I need help with.


Introduction

The purpose of the web application is to log data into a database (from a device), and display that data to users and allow them to interact with it (based on their account privileges).

Scenario 1

Use PHP. Set up ONE tightly coupled application (PHP used with front-end logic) that runs on ONE server and in SAME application. It receives the data from the device and logs it (into a database). It has access control capabilities and allows users to send commands to the device and also visualize the data.

Scenario 2

Develop a high quality (RESTful) API for logging data from device and user input (possibly even separate APIs for each) which also handles authentication as a separate application.

Use JavaScript to handle to create an application intended for users which runs separately and extends the API to be user-friendly

(Possible use CORS for security in the API)

Possibly also make a different application (or set up the device in a way that it can use the api) to log the data and receive commands.

Assume each application runs on different system. Database is used here as well.


Note: Assume best practices are used in each scenario for development and each scenario is developed in the best way possible in the real world (with regards to security, quality, etc.

Question and Commentary

In my opinion, the first option seems more reasonable for a coffee shop and the second option is for sensitive business logic and information

I wanted to know is it right to assume that:

  1. Scenario 1 has a single point of failure (and maybe scenario 2 isn't).

  2. Scenario 2 is more secure than scenario 1.

  3. Scenario 2 is more flexible (i.e: can be easily developed into a website, PWA, desktop app etc.)

  4. Scenario 2 is more future proof???

  5. Scenario 2 is loosely coupled and better separation of concerns.


This is all I have come up with for now. But if there is more that I should know, please let me know.

Second part of my question

I am unsure of the terminology to use for this as I haven't been able to find resources on this.

Are the differences in these scenarios, differences in architecture or differences in design pattern. Is this called a backend pattern? Microservices?

I am not sure what to call it.

Also, I would love if someone could share resources on this topic too because I am keen on learning more.

P.S: if there is any other mistake in terminology, please correct me :)

Aucun commentaire:

Enregistrer un commentaire