Can i connect my reactive app with Mysql database - react-native

I've searched all over the internet. I'm very new to reactnative and react. So i'm wondering how to connect my app with Mysql and perform CRUD operations.

If you're referring to an on-board database, your best options are probably Realm, which as per their gitHub page is "faster than even raw SQLite on common operations, while maintaining an extremely rich feature set," react-native-sqlite-storage, or react-native-local-mongodb.
For off-device, what has worked for me--though it was a long road to get there--is using react-native-meteor (at this repository) which does CRUD operations with MongoDB. I used MySQL when I was working exclusively in Android, but Meteor and MongoDB is a nice marriage to RN for cross-platform deployment. Otherwise you can just use Fetch in React Native, use a REST API server interaction that gives you a JSON response (which can use any server language you're comfortable with), and go from there. Good luck!

Related

Nativescript Offline Data

I'm quite new to NativeScript so I'm after some advice.
I've been looking at different back-end database solutions for the data. I've looked at firebase and while it does what it says on the tin I've come from am SQL relationship database background historically.
I've had a look and see that kinvey can connect to azure database (haven't tested this as yet)
I've looked at the azure database plugin but at present that doesn't support offline data.
Just wondering what other people have tried and recommend/stay away from.
Your use plugin nativescript-sqlite.

Sencha Mysql Queries

I'm about to port an Android-Travellog App to other Plattforms using Sencha Touch.
The Problem is, that Sencha only has a Store System to store Data, but doesnt appear to have a possibilty to acctually make MySql queries.
And since most of the Mysql code in my previous app is already there, id would be quite a pain to redo everything with Senchas new System.
Is there a possibilty to use mysql (or any other sql) queries with Sencha to Store Data on the Phone?
Sencha stores and proxies abstract away the need to write raw query code. A store can use one of a number of different proxies for interfacing with different back-end data stores, one of which is the SQL proxy, which as you can see in the source code provides an API for basic data querying WebSQL databases.
If you want to gain the full benefit of the framework and do things the "Sencha way" you'll probably want to start from scratch and architect your app to use the stores API.

What's the easiest/cheapest way to create a cloud-based SQL database?

I have a website that I've built (hosted on Amazon S3) and it works great. The only problem is that all of the data is static. I'd like to create a SQL database in the cloud that would allow me to store basic text data from users after they submit forms. I'm still a novice web-developer but I've used sqlite3 for several of my Java desktop apps and I'd like to use that SQL knowledge to create this online database. I guess what i'm asking (in my ignorance) is: how can I create a sqlite-type database that is stored in the cloud and that I can query against using javascript?
Where do I get started? Is there a service like Amazon AWS or Azure or something where I can create this database and then use some sort of jQuery/Javascript API to query data from it? I don't need a ton of storage space and my queries would be very basic SQL type stuff.
Any help would be greatly appreciated. Thanks in advance.
For more flexibility, less service lock-in, and cheaper scalability: I would suggest CouchDB (though you would likely still use a hosting service like Cloudant). CouchDB can host your website, and provides a HTTP API for storing data, to which your client-side JavaScript can make REST calls.
StackMob has a free package that you can use. You can use the JS SDK to write your HTML5 app and save stuff to the StackMob DB. You can host your HTML5 on StackMob for free and point your own domain to it as well. There is also S3 integration.
Some references:
JS SDK
JS SDK Tutorial
Hosting your HTML5
Custom Domains
Create a Postgres database on Heroku for free.
https://devcenter.heroku.com/articles/heroku-postgres-plans#hobby-tier
As you mentioned your website is hosted on Amazon S3 I am sure it is a static website with lots of JavaScript embedded HTML files. Due to having a static website, I can understand your requirement to use a database which can be connected from your static site and to be very honest there are not a lot options you have. Static website are considered to have no dependency on database so honestly you have very limited choice because what you are looking for is "A Database which is accessible over HTTP which you can call from scripting language withing HTML"
If you have ability to write back to S3 directly from your JavaScript code you can create a JavaScript based database within your static site which is complex but consider a choice.
In my thinking you are better off to have an extra-small instance in Windows Azure (or your choice of cloud service) and connect with a cloud based database which will be comparative cheaper and fit for your requirement.
Or unless Amazon can come up with a DB accessible from status content as S3, you really have no great choices here.
Since you are already familiar some of AWS's offerings, you should check out:
Amazon RDS - Managed Relational Database Service for MySQL or Oracle
Amazon DynamoDB - Fast, Predictable, Highly-scalable NoSQL data store
But to do what you are asking (access data via JavaScript), check out www.stackmob.com. You can host an HTML5 application with data access via backbone (javascript based framework) on StackMob.
Create a Virtual Private Server on Vultr.com. It's not the easiest way, but it's the best way for you to learn about Database Security, and it will be significantly cheaper than the other solutions, should your server begin to require more storage.
[vitrobridgedb] is free for hobby applications and pretty straight-forward to use
SQLite isn't really a good choice for web facing applications due to its scaling issues.
Both AWS and Azure support SQL databases. They also each support alternatives like MongoDB and Redis. For something as basic as you describe the only real difference is cost.

Using offline storage

I am trying to make a website which will store all the contacts of the user on the server database. The user can add, edit, delete or update a contact. I want the user to be able to do all these functionality even when he is offline. What should I use to achieve this. I came across web sql database which can be use to store database offline. But I dont know how to synchronise the online and offline database. I am using Ruby on Rails
According to Web SQL's W3C page, the specification is no longer in active maintenance and the Web Applications Working Group does not intend to maintain it further (http://www.w3.org/TR/webdatabase/).
Why don't you give HTML5's persistent storage a try instead? There's a great tutorial here that also features a chapter on local storage hacks before HTML5, so you may read it if you're not planning to dive into HTML5 just yet.
You may also try Google Gears, as it features an interface to a local sqlite3 database in which you may store your offline data.
As for the synchronization mechanism try persistanceJS. It should help you with both HTML5 and Google Gears options.
EDIT
Apparently persistanceJS has no support for rails just yet, but there's a tutorial on how to use local HTML5 storage with rails here, and there's a rails plugin to easily enable gears on rails apps here. Those should get you started.
You can use Ruby on Rails to do it as well. Check out the Railscast series of video tutorials. Specifically episode 247 to get started with ROR and offline storage

Design Advice for an HTA based Crud App

I am developing a framework for various in-house CRUD apps. I've considered several MS technologies (WPF, Access, WinForms, ASP.NET) and have settled on ASP.NET MVC with HTA+Jquery for the client. My reason for doing so is that I need a way to write and deploy quick one-off GUI apps as well as maintaining more robust apps that are expected to have a long life time.
Firstly, I would appreciate some thoughts on the relative merits of using ADODB on the client side versus ADO.NET on the server side. I'm leaning towards ADODB since I'll have client side access to the SQL Server (I've already written a js library that handles interacting with ADODB). However, I can see how developing a RESTful service may eventually be useful.
Secondly, I need to incorporate reporting capability into the system. I can use SQL Server reporting services or crystal reports but the users have grown accustomed to some older applications that use VBA to write reports in Word; so I'm considering using WordML to write the reports.
Thanks.
Database Access
If you need a thin client, then it's probably better to stay away from directly accessing the database from within the client.
The main issue is that you will introduce a high dependency on a specific network architecture and both your ASP.Net application and the HTA will be highly dependent on the database.
Instead I would prefer to sever the dependency on direct line of sight to the DB and have the data to be handled by the server.
This has a few advantages:
for many small changes to the db, you're probably only going to have to update the ASP app.
if you ever need your client app to be functional over the internet (say because some users are going to an outside meeting, need to work from work or your company open a new branch) then you won't have to rewrite your thin client.
you keep better control over access to the resources: only let the ASP app talk to the database and filter what comes in/out of it.
This will saves you having to implement all security on the client: the ASP app becomes the guardian of the database. It's a much better way to secure information and it gives you a lot more control.
Reporting
For reporting I'd use the server again rather than implement complex reporting capabilities in the client itself.
The problem is that you'll always going to get limited on the client if you're using an HTA and don't want to start having to install dependencies on each user's machine.
You'll end-up building a thick client in no time...
If you're using ASP.Net there are plenty of really good reporting tools that will make your life much easier and allow your users to get nice reports in Excel, Word, PDF, etc without you having to code these features yourself.
Crystal Reports is ok, but there are better and simpler alternatives, for example the Developer Express Report engine is pretty easy to use.