Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I'm trying to find the best way creating a mobile application, and connected with a cloud database(or server).
So my first question is: Is it good practice to communicate directly into a database from a mobile app?
If yes, which is the best database for this work? Azure? Oracle? Firebase...?
If no, which is the best service to communicate first? And which protocol?
What is the most recommended way? Does it matter what os(windows?mac?) my server will use?
The best approach if to build a REST API to communicate with your server. But if you don't want to do that, you should look for Firebase. Firebase is one of the best platform to build mobile and web application really fast. It provide you with Authentication, Real-Time Database, Storage, hosting crash reports and many more. Using firebase, you can set security rules on who can write to you database thus it eliminate the risk of unauthorized access to the database.
Also keep in mind that, if you use firebase, you should structure your db in such a way that the number of read and write requests are as minimal as possible, as firebase could be a bit expensive if not used properly.
Its better to build a api in between. Doing queries in your app is kinda risky.
You could use a nodejs framework for this e.g. Sails.js or Express.js
For a cloud database, Firebase is a very easy to implement and work with Database. There are plenty of information resources about the setup and work process.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Im developing this desktop app for study reasons
but im using SQL Server for database management so reading around the web i find some articles on this and why it is bad practice, i cannot move my entire project to another PC without installing SQL Server. then i find this:
Save and load inventory
So i don't know what method of saving and loading information I need for this project, I think in SQL Lite or maybe I can use a simple file to save all the information like the mentioned post.
Im using a DB with relationships and i dont know if i can made it with a data persistence file. What should I do? what is the best practice?
PD: Sorry for my bad english
Usually your SQL Server would be hosted on a remote computer when used outside development, but it depends on exactly what your application is supposed to do.
If it's a requirement for you to be able to switch computers, and not host your database on a remote server, I'd say using SQLite is a good choice.
Alternatively, you could have 1 big file that has all your data instead of a relational database, although I wouldn't really recommend it. It's good for quick prototyping of things, but all your data would be denormalized, which can end up being more effort to work with than SQL. This is what the inventory example you linked does.
If you are planing to move your application on different computers and don't want to install any database management system there then SQLite is the best option.
All of your data will be stored in one file and you can freely move your application an other PC without installing any database management system there.
Here is good article explaining that in which scenarios SQLite is good choice.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
please tell me how to retrieve a data from online database(table)?. I just created a table in enter link description here
And I made a SQL database. And can anyone tell me how to retrieve a data from that?
It is strongly advised for you to not directly connect to a database straight from Xamarin for (at the very least) 2 distinctive reasons:
1. Your credentials for the database will be in your app code, meaning anyone can just decompile your app and read your login info - huge security risk.
2. By connecting to a online database straight from Xamarin you'll most probably overload the database server (they allow only a small number of connections).
Usually when you need data from a database you work with an API that you build yourself. For example A php site, or an ASP.NET web api.
Xamarin communicates with your web site (e.g. www.yoursite.com/api/getinformation). This way your credentials are safe in the website, and your app connects only to your site, which is better because you can cache information there, preventing an overload on your site.
Reading material that will help you:
Xamarin forum link to php+mysql+Xamarin
Consuming REST-API's with
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I need to develop a standalone windows application that will work offline. I have decided to implement it using C# and WPF.
However because the application database should be able to run without having to install Sql Server on the client's desktop, am not sure what's the best approach.
The concept is that i will develop the application give the executable to the client, install and run the application without any complexity of connecting database.
So far i am considering to use SQLite.
My question is what's the best solution to connect a database within the application.
SqlLite is the best option to go so as to have both the sql features
and also a offline db.
If the data is very, very simple, and you need
it to be readable by other applications or users (with appropriate
permissions), I would probably choose to store it in an XML file or
even a plain-text file inside the user's Application Data folder,
which would be obtained via Environment.GetFolderPath.
If you want to store files such as images,etc then you should go for
IsolatedStorage.
Use EntityFramework to connect to SQLite, my preference is always to use the code-first database so everythings managed from your C# code, I believe EF can be modified to implement INotifyPropertyChanged on your behalf which will help setting up your bindings in WPF.
XML shouldn't be used for anything except for configuration IMHO, it will soon be deprecated in favour of JSON, I'm sure of it, not that that really affects you.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I currently have an MVC 4 app running on a Windows Azure website. Some of the users need to use the app, but may be at a location without internet access. The goal is to have an iPad app with offline capability, and will push the changes to the Windows Azure database when an internet connection is established. I am in the planning process, and I have questions about how both apps can use the same database concurrently. When I create a Windows Azure Mobile Service and use the same database the Azure dashboard does not show the existing tables used by the MVC app. Is it possible for both the iOS app and MVC 4 app to use the same tables, or am I going to have to go a different way? Thanks.
You would have to write web api against your database,its very easy to Write Web Api 2 that can easily communicate with any sort of device or application because it is HTTP based.I personally have done this. Web api returns xml or JSON based data you can use this to populate your local database in your iOS Application.
You can also implement some logic to save data back to the database when you got connected to the internet.
The iOS app should absolutely not connect directly to your database. I actually don't think it's possible through the iOS SDK to do that if you wanted to, anyways, but just in case: don't.
Instead, your iOS app should connect to an API that you will need to build. The API, alone, will interact with the database. You can also retrofit your existing website to use the API as well, removing database concurrency issues entirely.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to create a simple multiplayer game. As I understand the main principle is to make clients communicate ether directly to each other or to the server. Since I want some game data to be available online on my website, I'm inclined to create database that users will be connected to.
Is this valid?
Is SQL/MySQL good idea to use in such scenario?
Would windows azure be any help?
Please help me. I really need some guidance here.
If you want to store game data for use on a web site, you will definitely want to store it in some sort of database. Just so you know, SQL is a querying language for databases, MySQL is a DBMS (Database Management system) that you use SQL to "talk" to.
However, you certainly don't want to store ALL of your game interaction in a database, as database operations tend to take a long time (at least as far as a computer is concerned). Your server should have some sort of socket (probably TCP) that is talking to all the clients, passing messages and so forth.
The class reading from this socket would raise events or otherwise update the database for the information you want to be displayed on your website. Windows Azure would be a perfectly valid hosting platform for the website/server app, and so would pretty much any other web hosting solution. Some of the socket code could be easier going through Azure, so that may give it an advantage when choosing your host.
Please let me know if I can provide any more information.