local database for adobe air for JSON on Android [closed] - actionscript-3

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 9 years ago.
Improve this question
I am building an app that will have local database. I plan to implement local database that will be used for offline work, and when app connects with internet it should sync with the server data.
What is currently the best way to do it?
I prefer JSON type databases over SQL databases so I would like to use MongoDB for web, but then for local database there is only one solution that is not yet available for android.
https://github.com/thejustinwalsh/airejdb
How do you do it?
Do you save key:value inside of SQLite database, do you use plain text saved somewhere or do you have some other implementation of mongoDB for local Adobe Air?
Thankx

Depends on project, if I have sensitive data then putting it in encrypted SQLite might be necessary, also if JSON data is not so small it might be good idea to just compress it as a string and put as a byteArray->BLOB in SQLite, can save lot of space which in case of mobile project might be useful, otherwise you can do same with some text file without using SQLite at all, just save and load data, IMHO impelementing something like MongoDB is much more harder work then given examples.

Related

Where should I store images for my website? [closed]

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 months ago.
Improve this question
I've built a simple website with authorization and registration system.
So I have user accounts and I wonder where to store profile pictures for every user.
I tried to store them in MYSQL in BLOB, but I don't think it is the best way to do this.
Most people have the opinion that files should reside on the filesystem, outside the database. But there are exceptions to every rule. There are some good reasons to keep large binaries inside the database, depending on your project requirements.
See some of my past answers on this topic:
Should I use MySQL blob field type?
What is difference between storing data in a blob, vs. storing a pointer to a file?
VARCHAR(MAX) vs TEXT vs .txt file for use in MySQL database
I also cover this in the chapter "Phantom Files" in my book, SQL Antipatterns Volume 1: Avoiding the Pitfalls of Database Programming.
The short answer is in most cases a file system (eg. the server where your code is hosted, if that's an option).
Read this short article:
Storing images in a database table is not recommended. There are too many disadvantages to this approach. Storing the image data in the table requires the database server to process and traffic huge amounts of data that could be better spent on processing it is best suited to. A file server can process such image files much better. Source: Store Images in the Database
If you do not have access to storing images on your server or enough space, you could take a look into hosting you images on an image server.

How can I use the website open library to store information into a database [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am trying to make a web page that gets information about books using HTML and to place the information about books into a database to use it. Any idea of how to take the information from the website open library and store it into a database?
here is the link to the API if needed:
https://openlibrary.org/developers/api
thanks in advance.
If postgreSQL and python is a viable option, LibrariesHacked has a ready-made solution on GitHub for importing and searching Open Library data.
GitHub: LibrariesHacked / openlibrary-search
Using a postgreSQL database it should be possible to import the data directly into tables and then do complex searches with SQL.
Unfortunately the downloads provided are a bit messy. The open library file always errors as the number of columns provided seem to vary. Cleaning it up is difficult as just the text file for editions is 25GB.
That means another python script to clean up the data. The file openlibrary-data-process.py simply reads in the CSV (python is a little more forgiving about dodgy data) and writes it out again, but only if there are 5 columns.

Make portable Mysql and NodeJS [closed]

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 2 years ago.
Improve this question
I'm needing to make a stand-alone application with NodeJS for Windows, Mac, and Linux
My first option for the database was SQLite but it's very small for my big data
My reason for using MySQL is that support many data and it's quickly
But the big problem is installing MySQL that it's hard to install it with end-user
And the important note is I packaging the NodeJS project and convert to exe file
Also, I use mosquito broker in this project and still no problem in the run this application.
Can I use MySQL like SQLite (stand-alone)?
Thanks
It's bad if you think Sqlite is weak
Because it's the best choice for your needing
It's simple, high performance, stand-alone and many features
My suggestion is using SQLite
Finally, I decide to use the same Sqlite because :
"SQLite supports databases up to 140 terabytes in size"
Also, I assign database file for each device and I think that is the best solution without Mysql database

What engine type would be better in this scenario? [closed]

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 7 years ago.
Improve this question
I’m writing an android app that will sync with a MySQL db on my webserver (there will also be a website reading from/writing to the same dB). The android app will store a copy of the data locally in a sqlite db to provide access while offline. If the user creates a row while offline, that record will be uploaded to the server the next time a data connection is available. I’m designing the app and website myself so I have the ability to set it up as I see fit (meaning it doesn’t have to conform to someone else’s server).
The sqlite db will have a column for id (which will represent the id as stored on the server) and a localID column. When the server receives the data, it will acknowledge the new data by returning an array (in json format) of the id numbers as stored on the server.
What would be better for this type of scenario: a transaction-safe engine or non-transaction-safe (such as isam)? It’s my understanding that isam would be faster and take less space to store but I can’t deal with losing data. I’m thinking that if the android app doesn’t receive the confirmation, it would resubmit the data. It seems like that would prevent data loss but I need a second (more-experienced) opinion. If you would go with a transaction-safe db, which would you recommend as I’ve never worked with one?
TIA!
A real database should be your default choice until you've seen that it's not fast enough.
Consider using UUIDs to generate IDs on the client that are guaranteed to be unique on the server.
Have you thought about how you would handle updates from multiple devices that both had off-line changes? You should consider some known patterns for dealing with this kind of synchronization.
Stack Overflow question
Data Replication book

Local client data Storage with Angular JS? [closed]

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 9 years ago.
Improve this question
I'm working on a quick prototype, and i would like to persist data locally for not having to write Server Side Code.
My application, store data on the $scope, and i have a form on my pages wich add more data on my $scope. But when i'm navigating on the application, i'm loosing my data.
Is it possible to store the data on the session ? and how ?
Is it easier to store data on Google chrome local datastore ?
In advance thanks.
You can store data in javascript using either cookies or the local storage feature introduced in HTML5.
Cookies aren't very intuitive: they have a very tight space limitation, and in order to store any possible javascript type you'll have to do some serializing.
Local storage is much easier to use, but will only be available to users running a HTML5 compliant web browser.
If you can afford to get your users to use HTML5, then check out this page:
http://diveintohtml5.info/storage.html
If not, you'll have to use cookies:
http://www.w3schools.com/js/js_cookies.asp
I haven't been able to find my own works on that field, however I just found this:
https://github.com/marcuswestin/store.js
If your users are mostly IE or modern web browser users, this lib seems to be perfect for you.