Does web API without bank access make sense?

Asked

Viewed 106 times

-1

In which cases it makes sense to create a Web API without database access?

  • 2

    When there is no need to persist the data in a database.

  • 1

    @Lucaspera particularly I would say that in all... Never a presentation layer, even a Web Api, should have direct access to the database.

  • In case of dynamic API (algorithm that does not need to save anything or recover anything to handle the received information).

  • Everything depends on your need, for example, you could make only one validator, ie, for security reasons a certain process must go through a given server simply to validate its authenticity, a captcha for example does not need to have a database, but needs to go through the remote server because validating a captcha on the local machine would be a shot in the foot.

2 answers

5


Database and Web API are orthogonal concepts, so it makes sense in all cases that we do not need database.

It’s rare, but it’s possible, either because the data is already in the code, or it just does calculations and processing. Of course, if you do it like this, it’s unlikely it should be the Web, except for business reasons. I actually consider the use of Web API to be an abuse in most cases and this is because most programmers don’t know how to program and then buy something ready and the market decided that this way they could make more money by "renting" the API and avoiding piracy. People don’t even think about it. No wonder the 5 or 6 largest technology companies have exploded their market values in recent years because they created this new market and convinced people that it was cheaper, which is false in most cases.

Actually people don’t understand what API is, and this has already been answered.

In general the doubt arises because people do not learn to program. They just decorate cake recipes, then one day they ask, can I not for condensed milk. And that’s the difference between the cook and the chef. The first thinks he is doing something interesting, but it is trivial and in the end it is only a workforce that one day can be replaced, the second really does important things and is essential. Nor need I say which earns well. It is necessary to learn the basics, understand why things.

  • The doubt arose because I was asked to make an api to integrate the bematec one api to the company’s systems, but by what I read here this api is already quite complete and I think it makes more sense to directly access it. if you have time to read: http://bematechpartners.com.br/wp01/upload-files/downloads/oneapi/DOCUMENTACAO_GERAL02/APIOne_INTRO/APIOne.html me de your opinion please. Thank you!!

  • I don’t understand what that has to do with the question.

  • It would be to make her without access to the bank, that’s where my initial doubt arose.

  • I don’t even think your head understands what you’re talking about, but without describing it right I don’t know what you’re talking about.

  • The company wants to use this bematec api one to generate electronic bills, and for that they asked me to make an api to serve as an intermediary between the company’s systems and the bematec one api. the point is that reading the documentation I see no sense in creating an api to access the bematec api, if you can read it here and tell me your opinion I appreciate: http://bematechpartners.com.br/wp01/upload-files/downloads/oneapi/DOCUMENTACAO_GERAL02/APIOne_INTRO/APIOne.html

  • @Lucaspera although this application already provides an API that can be consumed directly from the browser, it is necessary to send the data, which will probably come from the company’s database, through the authentication API that already exists, what they must have requested is for the user to request the invoice for the API that will do, it will authenticate the user, bring the database data and return, for example, the file ready. Not that I can not do on the frontend two requisitions

  • I just talked to the staff here, the api will only serve to make validations, n will have access to the bank. My api will receive a json, I will validate the fields of this json and if I get an error I will send it back before sending it to the bematec api. to think that is to reinvent the wheel.

Show 2 more comments

1

A Web API allows you to provide any services to an end-user connected to the Internet.

I do not agree 100% with @Maniero, in the case of an online payment API for example, it will be complicated (impossible) for the lambda programmer to create the system from A to Z.

An online payment system (gateway)! This will require a database for managing the different types of cards and API user and of course this database will not be accessible to the end user of the API and will be handled internally on the server.

An API that optimizes the size of an image it only needs the image and a treatment algorithm. Ai you will not need database (only in case you have a paid plan (there you will have to save the customer data and the use of it,...).

But in all cases of professional API you have a database even if and just to remember the Number of access and processing, now and of course you will never open the access of this database to the end user!

  • 2

    Thank you for agreeing 100% to what I said, even if I say I don’t agree :)

  • Opá amigo ! I just don’t agree with this => "In general doubt arises because people don’t learn to program" ! In the sense that a Web API is to simplify some things that would be very difficult or impossible to program. Just ! Otherwise I agree yes ! And you agree ? :)

  • So I guess you didn’t read my entire text. Read it carefully. It has a very specific context. If the person uses a Web API where they should do local they don’t know what they’re doing, it’s not simplification, it’s complication. And it’s usually these Apis that don’t need a database. Taking your example sending an image to be manipulated to a Web API is an end of the stick, and people are doing this.

  • If it is to save only how many times the API has been accessed can be done with a file .txt, for example, adding a new line with the date and time to each request

  • @Maniero also does not agree with "sending an image to be manipulated to a Web API is an end of the bite", often I just want to do a simple edit, such as cut the image, seek to download and install a heavy application, which I will use once there that another is not very interesting. It may also be that I am using an old computer and do not open the application I spent half an hour searching, downloading and installing. In general, a native application is preferable, but not always

  • @Guilhermecostamilam until you make a code, in the notepad, study the API, compile, test, etc. gave to solve the problems in another way. What you have said is what is called a fallacy. You have a valid argument for a hypothetical unrealistic situation with the context of the question. And I would have squeezed Paint and solved the problem quietly. Either open Photoshop Online or something similar, but would not have used API which is for another need. In addition to the described does not compete with API. And if you are using such an old computer, whether you will use API or not is the least of your problems.

  • @Maniero looks like you can do and program everything! So I guess you don’t use google map, that you don’t use any payment API, fine and your point of view ! Now the question wasn’t that ! The Apis make life easier for a lot of people even as a great programmer, so let’s focus on answering the question without doubting how a programmer (or not) has to do to get the desired result ! Everybody doesn’t have time to program everything from A to Z !

  • @Sachadee and I think we need to take a course in interpreting text. And seriously, it’s not sarcasm. Or else understand more on the subject, you think there are only two ways, do everything at hand , or use a web API.

  • Friend I think my interpretation is not wrong when I read : "And I would have tightened the Paint and solved the problem quietly" you claim that your vision is only valid, and only that that disturbs me in your comment ! And to answer your question "you think there are only two ways, do everything by hand , or use a web API", I think the problems of interpretation are not only mine ! And exactly what I want to say has several ways and none and better than the other, depending on the situation and the knowledge of each.

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.