How to share one .db file between Sugar ORM and Room library? - sqlite

I have an app that currently uses Sugar ORM version 1.5 to manage the SQL database. Unfortunately, CRUD operations are very slow when you manage more than 4,000 records.
At the moment, Sugar ORM created the .db file. The app already has more than 1,500 CRUD operations, so it is nearly impossible to create some synchronization between Sugar ORM and the Room library. For that reason, I would like to somehow share the .db file created by Sugar ORM with the Room.
My goal here is to point Sugar ORM and Room to the same Database .db file so they both will use the same source of data.

Related

How Couchbase Lite use SQlite for NoSQL data

While SQLite is for relationnal database, how couchbase use it for NoSQL data queryable ?
Couchbase Lite can use different storage engines internally.
In the SQLite case, the main document body is stored as a blob. Most of the data in the tables actually has to do with tracking revisions, views, supporting sync (replication), and so on. (This is as of version 1.4.0.)
So, to answer what I think is the main point of your question, CBL isn't turning documents into tables the way you would if you were trying to store the data directly in SQLite.
These are, of course, implementation details you should not rely on. If you're interested in finding out more, you can look at the source (Couchbase is open source) and use standard SQLite tools to examine the database itself.

Using MySql wit linq

I have 2 questions for which I need help.
1)
I have developed an application where in I store the files(doc,xls,etc) in database. I have used LINQ to perform insert,update and delete. I have used MS SQL. Now, the requirement is that of using MySql. Can I use LINQ wit MySql. I searchd and found that LINQ only supports MS SQL and access. If it is decided that MySql should be usued, I dont want to go back to the traditional 3tier architecture. Can NHibernate can be used with MySql?
2)
How do the blade servers perform when it has to manage a data of 500gb+ data(documents). The RAM is about 12GB. Please nedd sugggestions that if such a huge amount of data is there, is it better not to store the data(documents) in database and store it in drives on the server instead.Because I have seen that if the data is stored in database(binary format) the size does increase.
Ok, here we go
1) It is not possible to communicate with an MySQL-Database via Linq To Sql, like you mentioned it is only build for MSSQL and Access. Prefer using the EntityFramework to communicate with variable databases. It is nearly the same to work with like Linq To Sql. You can easily develop your application using an MSSQL-Database and switch to a MySQL-Database after deployment by just changing your ConnectionString and installing the MySQL-EntityFramework-Connector.
These links may be helpfull to you:
Codeproject.com - An Introduction to Entity Framework for Absolute Beginners
Stackoverflow.com - Using MySQL with Entity Framework
2) I would advise you to store your data on physical drives and set references to the stored file in your database. This is because the heavy amount of data transferred while requesting one of your documents will slow down your database for other querys that normally just would take milliseconds to be executed.

SQLite & Versioning Systems

Foreword: I am not trying to write an alternative either to Subversion or to any other versioning system.
I wonder if SQLite has what it takes to replace the usual repositories of versioning systems by a single-file database file where different versions are stored as BLOBs?
Fossil is a version control system implemented in SQLite. It uses a single database, storing the versions as BLOBs.
Not all version control systems use the filesystem.
In fact, one such distributed version control system, Monotone, already uses SQLite for storage. The FAQ Why an embedded SQL database, instead of Berkeley DB? gives some rational for this choice. The FAQ doesn't address "why not filesystem storage" though.
Even SVN, at least historically, supports an alternate BDB repository data-store. While this is not SQLite it is easy to imagine that SQLite can function as a "super" BDB that supports SQL as an interface. (Actually, BDB can even be used as an SQLite back-end, for a fee :-)
Keep in mind that, no matter where the data (diffs/deltas) is stored it all ends up as some form of "BLOB" -- BDB value, data in a file, or BLOB column in a[n SQLite] database.
Happy coding

Advantages of sqlite3 vs CouchDB for an application like a personal feed reader?

Say I wanted to build a feed reader that downloads RSS and Atom feeds to your local computer and lets you view them locally. What are the respective advantages and disadvantages of using CouchDB or sqlite3 as the datastore for such an application?
SQLite and CouchDB are probably different in every respect but what you consider an advantage or disadvantage is a matter of preference and requirements.
SQLite is an SQL database where you store relations (tables).
CouchDB is a NoSQL database where you store JSON documents (objects of any structure).
SQLite has schemas.
CouchDB is schema-less.
SQLite is a library that you link with your application and use a C API.
CouchDB is a RESTful web service and its API is HTTP and JSON.
SQLite has no concept of a network.
CouchDB basically is a high performance web server.
SQLite is written in C.
CouchDB is written in Erlang.
Which of those are advantages and disadvantages? This is up to you. ;) Good luck.
Good summary from rsp. Without knowing more about your requirements, it's hard to say which one is better suited for your use case. One clear advantage that SQLite provides is that is has simpler installation and administration. As a library, it's linked into your application and installed along with your application. No separate database to install and configure. This is one of the features that makes database libraries, like SQLite and Berkeley DB very attractive, and possibly preferable to database servers.
Just to add to your list of considerations, Berkeley DB and Berkeley DB Java Edition are also database libraries that you may want to consider. Berkeley DB (written in C) offers you the choice of using a schema-free key-value pair API, a POJO-like Java API or a SQLite-compatible SQL API. Berkeley DB Java Edition (100% Java) offers you Java APIs for key-value pairs, Java Collections or POJO-like object persistence. Berkeley DB and SQLite tend to be the products of choice for people who are looking for embedding data management functionality inside of their application.
Disclaimer: I am the Product Manager for Berkeley DB, so I'm a little biased. :-)

Open Source DBMS

I have to create two web applications using:
ASP.NET
JSP
Without using MySQL, I'm looking for a free (open source) DBMS.
I found Firebird and and Postgresql, but I'm not sure about them; Is there any other powerful DBMS you've already used in this case ?
Thanks.
I've used both Firebird and Postgres, and they're fine. You could also look at SQLite3, or one of the "NoSQL" data stores, like MongoDB, CouchDB, or Riak.
Firebird and SQLite have the distinction of being embeddable databases, meaning you can easily ship them as a part of your application without having to require the end user to set up the database separately.

Resources