SQL Ledger REST API Design

by vreinok, Tuesday, December 20, 2022, 14:31 (493 days ago)

Hi Armaghan!

I was wondering how the REST API is designed in Perl.

How SQL Ledger was structured (according to my non complete understanding):

Upon request an SQL query was formed and executed, then the result set was mapped to the HTML and rendered in the browser.


What design I imagine:
We would expect to have now the REST API between the View and controller layer

So, Upon request SQL Ledger REST API is called, then the repose of the API is mapped to the HTML and rendered in the browser.
FYI SQL query is executed inside the REST API call.

Following would provide following advantages:
- Business logic not duplicated
- Validation are not duplicated
- cleaner design

Cons:
- More work


Why that very question:
We are currently consuming the SQL Ledger resources trough HTML calls. We map the x-form request and send them. In case we would have an SQL Ledger REST API that is build on top of SQL Ledger UI (HTML) some business logic and validation would get duplicated and we could face more bugs and higher effort of maintenance.
So, it would be challenging for us to apply further changes.


Looking forward for further discussion,
Viktor


Complete thread:

 RSS Feed of thread