• 1 Post
  • 11 Comments
Joined 1 year ago
cake
Cake day: June 24th, 2023

help-circle


  • ‘’’ Note: When I say “top-level” I am talking about the URL that you see in the address bar. So if you load fun-games.example in your URL bar and it makes a request to your-bank.example then fun-games.example is the top-level site. ‘’’ Meaning explicit creds won’t be sent. Even if fun-games knows how to send explicit creds, it can’t because fun-games does not have access to creds which stored for your-bank. Say suppose your-bank creds stored in local store. Since current URL is fun-games it can only access local storage of fun-games, not your-bank.




  • REST calls are same as in 2001. There is no REST 2.0 or REST 2024. Because REST is architecture guideline. It’s just more data sent over it today. HTTP code IS code. Why your system issued it is implementation detail and have nothing to do with resource representation. Examples you provided are not 403. “Too many users active” does not exist in REST because REST is stateless, closest you can get is “too many requests” - 429. Insufficient permissions is 401. I don’t even know what is “blocked by security” but sounds like 401 too. Regardless, you should not provide any details on 401 or 403 to client as it is security concern. No serious app will tell you “password is wrong” or “user does not exist”. Maximum what client should hope for is input validation errors in 400.

    For those with “internal tool, I don’t care” argument - you either do not know what security in depth is or you don’t have 403 or 401 scenario in the system in the first place.

    Now hear me out, you all can do whatever you want or need with your API. Have state, respond with images instead of error codes, whatever, but calling it REST is wrong by definition


  • I don’t think loop vs recursion choice is what significantly impacts performance in most cases. Most of the software I saw, suffer performance because of wrong API design or overall architecture. If app needs to fetch 100 objects from API which can provide only one object at the time no optimization will save that app.

    App team - we need bulk API.

    API team - cannot because of capacity, budget, backward compatibility, DB, 3rd patry API, not a KPI

    Also it’s mostly QAs measuring performance and validating it with product guidelines which set by person who mostly detached from specific product and sometimes reality.




  • I didn’t get do you do integrations besides of your DB.

    To me architecture sounds good anyway. I’m not GO dev but it looks like stack is your main problem not architecture itself. Multiple models is great long term approach which makes sure you are not leaking implementation details of your persistence/3rd party services to your client. You have layer of mappers where you can enrich model in optimal way and at the same time you can accommodate whatever client request/payload quirks you may need. Yes it’s sometimes annoying to add one field and pass it across all layers but it’s the price and software development is all about balance and compromises. I worked in projects that didn’t follow this architecture and any kind of change in DB/3rd party were cascading through entire application so end up changing hundreds of files instead of couple of models and few mappers

    You may have issues with this architecture if you invoke services directly one from another for complex use cases. This can couple things together. If that’s what’s happening think if can apply Facade. Try using/reusing more trivial and focused services in Facade to make sure that for example Order service does not depend on Client service. Leave it to ClientOrderFacade.