Using SQL Server with Dart

4,216

"The best way": there is no silverbullet, you'll have to decide what frameworks and tools to use. But i'll give a simple example how a client application typically connects to a database. Most basic example:

General mobile app architecture

Client application

The client application can be any application the user typically uses. Some examples:

  • Mobile app (written in native, Dart, Xamarin, ...)
  • Desktop app (Electron, WPF, ...)
  • Website app (Angular, React, Vue, ...)
  • ...

API

The API is there to retrieve data, and change data. But It will also handle authentication, authorization, logging, doing business logic, ...

The API can be any technology you want. In your example .net core. Whats important is that your client application can communicate with your api. Using GraphQL, REST (JSON, XML, ...), ...

Dart has packages for GraphQL and REST

Database

Your API will then execute queries, inserts, updates, deletes, execute stored procedures on the Database of your choice. In your example SQL Server.

There are many possibilities on how to set this up, depending on your skills, knowledge of frameworks, how you want to deploy things.

How you want to deploy this will limit your choices as well. For your API:

  • Serverless API (Via Azure Functions, AWS Lambda, ...)
  • Cloud Website (Azure Web Apps, ...)
  • Website hosted on premise
  • Docker container
  • ...

In real life scenarios this often gets more complex with Firewalls, Application Gateways, Virtual networks, clusters, ...

Share:
4,216
Benjamin Furlani
Author by

Benjamin Furlani

Updated on December 22, 2022

Comments

  • Benjamin Furlani
    Benjamin Furlani over 1 year

    I haven't found a great answer this so I wanted to try my hand at getting an answer. What is the best way to use Microsoft SQL Server with Dart? I need it to be able to use it from essentially any OS Web and Mobile. I feel the best way may be GraphQL but I am unexperienced in it. I have seen plenty of things saying a .NET API but I am unsure as to how to use the .NET API with Dart. Thank you in advance.