Discussion on best way to create a "backend" for my apps

Darren Rose 311 Reputation points
2021-04-20T21:44:30.053+00:00

Hi

Over the years I have written many apps for myself and for customers using VB.NET, most of these were standalone apps which worked on workstations and servers and didn't involve much if anything to do with networking, client/server or a backend.

I want to evolve and learn more, and specifically am interested in creating a "backend" for some of my apps so that the data from the client app, whether it be error information or custom data for a client can be sent from the "client" to whatever is the best option for the "backend". I would then store the received data in a database I assume and then have ability to view it, and parse the data to show specific results etc

This is a new area to me but one I want to learn more about, so I am hoping that others who have this knowledge / experience can give me some pointers as to the best route to take etc, especially covering the points below and anything else you think I need to know but have missed

1) What to use for the "backend"? I prefer to have it in the cloud rather than having my own server, so do I use something like Azure? if so what? or do I sign up for hosting with a company which provided ASP and .NET Core hosting and create something there? if so what would I use?

2) What are the best methods for sending data from a to b - I notice most services I currently use for my apps e.g. for sending mail or error reports etc often use JSON? is that best option?

3) How do I send the data, any built in or suggested frameworks or API's to use to "post / send" information from my client to my backend / remote endpoint?

Hope this all make sense, please ask if not, all comments appreciated, as I say I want to use this both as a way to create / modernize some of my existing apps, but also as a learning exercise to learn areas I don't know and hopefully also make user of newer / evolving technologies and solutions.

Thanks

Developer technologies | VB
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Duane Arnold 3,216 Reputation points
    2021-04-24T00:13:30.55+00:00

    The best way IMHO is to host an ASP.NET WebAPI, a restful Web service, that has a data access layer DAL sitting behind it using the DAO and DTO patterns.

    https://gunnarpeipman.com/aspnet-core2-vbnet-weather-api/

    https://en.wikipedia.org/wiki/Data_access_object

    https://javarevisited.blogspot.com/2013/01/data-access-object-dao-design-pattern-java-tutorial-example.html

    DTO(s) travel between layers, tiers and client/service programs.

    https://www.codeguru.com/vb/gen/vb_misc/oop/article.php/c7063/Data-Transfer-Object-Pattern-Goes-VBNET.htm

    https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/procedures/auto-implemented-properties

    The WebAPI client can be any type of client like Windows desktop, WPF console program etc., and etc.

    The DAL using DAO can be using any type of technology, becuase it's using the DTO pattern and the client-side only sees or knows about the DTO(s)

    Here is a Github VB.net MVC client using a WebAPI for CRUD with the database you can examine, which is using WebAPI 2.

    https://github.com/darnold924/ProgMgmntVB

    2 people found this answer helpful.

  2. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2021-04-23T19:56:15.027+00:00

    Hi @Darren Rose ,

    You have certainly asked a loaded question 😊. I would review https://learn.microsoft.com/en-us/azure/architecture/guide/architecture-styles/n-tier, https://learn.microsoft.com/en-us/azure/architecture/patterns/backends-for-frontends as well as other various guides and blog posts related to this architecting style.

    1) What to use for the "backend"? I prefer to have it in the cloud rather than having my own server, so do I use something like Azure? if so what? or do I sign up for hosting with a company which provided ASP and .NET Core hosting and create something there? if so what would I use?

    Sure, there are many database offerings; see https://azure.microsoft.com/en-us/product-categories/databases/ are available. You just decide which one from a performance and cost standpoint, best meets your needs.

    2) What are the best methods for sending data from a to b - I notice most services I currently use for my apps e.g. for sending mail or error reports etc. often use JSON? is that best option?

    The easiest way is to use JSON because of its popularity and simplicity. Moreover, most major frameworks send objects over HTTP as JSON by default.

    3) How do I send the data, any built in or suggested frameworks or API's to use to "post / send" information from my client to my backend / remote endpoint?

    This will be up to you and what you're most comfortable with learning and using. If you're use to Visual Basic, C# would probably be the easiest transition. Python might be another easy transition, but I wouldn't limit yourself; just do what's comfortable and cool to you.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.