Couchbase lite gateway server another database in server - sql

If I choose to work with Couchbase lite (in a Ionic 2 app), can I make a gateway with another database in server (SQL database) using private synchronisation APIs?

The replication protocol used by Couchbase Lite (and the Couchbase Mobile stack) is related (and currently compatible with) the CouchDB replication protocol.
Going from NoSQL to SQL requires work to map between the two. I know of no current SQL database that you can sync with automatically. This wouldn't apply to just Couchbase Lite.

Related

How to connect SQL server beta (Google Cloud) to Google API engine (Node.js)

I have a node.js API that is using SQL server beta from Google Cloud SQL. Works fine when testing locally and connecting directly via IP.
I deployed the API on Google APP Engine and works fine less the connection to the database. Now, what will be the server connection string to connect directly from the project API to Google cloud - SQL server beta. How I can make use of instance connection name? (Note: Cloud SQL Admin API is enabled for this project)
I found many examples to connect for mySQL instances, but none to an SQL beta.
How to connect SQL server beta (Google Cloud) to Google API engine (Node.js) ?
As Eugen point out, Cloud SQL instance that are using SQL server are still in beta and therefore, many features are not yet available.
As stated here there's still no option to connect to a Cloud SQL SQL server instance from App Engine. Neither it seems to exist options to connect from external application such as Kubernetes or Compute Engine, as seen here.
Nonetheless, you could try to connect to your SQL server instance by using the Cloud SQL proxy to do local testing, as shown here.
Then, you could try to use some node.js library that can act as a node.js library, as this one for example, but I can not confirm that I will work within App Engine.
Nonetheless, if you have the option, I highly recommend you to use Cloud SQL instance using MySQL or PostgreSQL since they support connection from App Engine apps, as seen here.
I hope this helps.

ZF2 DB based session management vs Redis

I am not sure if this is the right place to post this.
I am writing a PHP and ZF2 based website that needs to be scalable. So, I am looking into Database based sessions. I understand ZF2 supports DB Session management, so I can create a MySQL DB, and use it. But DB session management could be slow. So, I have looked into redis as a cache management solution.
My question is will using redis as a standalone server work for both server side session management and a cache solution (as it seems to have it's own in memory DB) or do I need to combine it with ZF2 DB Session management?

Online SQL Server database accessed from my software

I have been working on the software using a SQL Server database. Now I am in the phase when I would like to provide this software for other people, but I don't know how to manage the database. The thing is that it is really inconvenient when installing my software to also install SQL Server at the users computer (many unexpected thing could happen).
Therefore I thought that I would pay for web hosting with SQL Server, but it is:
Expensive (just for database with few tables).
Most of the web hosting don't offer remote access to the SQL Server database (so I can't connect there from my software).
So there is my question, what would you do? My own virtual server? (even more expensive), or would you install SQL Server on users computer? Or do you know where to get only SQL Server hosting for low costs?
I don't advice using a remote SQL Server. SQL Connections strongly depend on network connection and the Internet is not "stable" enough for that. There are also performance issues that will make your application completely useless.
One important thing you didn't mention is whether different users will share the same data or will have their own. If each user will use their own data you can install a "local" SQL Server Edition (SQL Compact Edition, here is the reference)
http://msdn.microsoft.com/en-us/library/aa983341(v=vs.110).aspx
In case several users will share the same data, you shouldn't rely on the database solely. One possible approach is having an Application server that implements business logic whereas your desktop application stays actiong as a "dumb" client. This is a lot better for performance and reduce data transfer problems. You can implement webservices for you application server. This is a good solution as the data is transfered from he application server to the clients through HTTP/HTTPS and this relieves you from dealing with ports and other communication issues. An alternative is using Microsoft Communication Framework (WCF)
Good luck!

django iis6 with pyisapie and sqlite3 on production server

I am using Django on Windows 2003 Server SP2 and IIS 6 with pyisapi.
Do you recommend using sqlite3 on this production server?
What are the advantages and disadvantages of using sqlite3 on a production server in general and especially on Windows 2003 Server.
Our application is an order management tool which will have 5 clients accessing it (not necessarily concurrently). It is only used on an intranet. For this purpose we have adjusted the admin interface to our needs.
SQLite is an excellent product. It's very simple to use and deploy, is very fast, highly reliable and doesn't typically require any external administration. It uses very few operating system resources, allowing you do better utilize the operating system and hardware resources that are available. SQLite is used by many projects.
You may also want to look into Berkeley DB's SQL API. It's completely SQLite compatible. In addition, it offers concurrency (multiple readers and writers active in the database), scalability (BDB manages databases in the 100's of GB to TB range today) and HA (High Availability either for load balancing or for hot standby with automatic failover) above and beyond what's currently available with SQLite.

Windows CE - Database

I need to setup an application to scan a barcode from a packing slip and the associated fulfillment items on a windows CE 5.0 device and update the inventory on the server. I'm using VB.NET. However, what is the best way to interact with the database? Integration Services, ADO.NET, RDA... etc... it's a bit overwhelming trying to figure out what I should use to interact with the database. It's currently an Access database, but I imagine I'm probably going to need to migrate it to SQL Server or SQL Server Express.
I'd also need to print the packing slip to a network printer from the device. Is there any way to do this?
Sql CE is an excellent choice if your devices have to function for stretches in a disconnected state (i.e. not connected to the server). If you do use Sql CE, however, I strongly recommend not using RDA to persist local changes back to the server database (see this answer). In any event, RDA merge replication would require your server database to be Sql Server.
If your devices are always connected to the server through a wireless network, then you do not need a local database on the devices at all. Your devices can upload and download data through ASP.Net web services running on the server. Using DataSets for this communication is a good choice, since they are essentially database-agnostic (and thus your PDA code won't particularly care what database you're using on the server).
The web service approach will also let you handle the printing requirement. The PDA would send the relevant information to a web service method, which would then handle printing to the network printer.
My recommendation is to use SQL Server Compact edition (http://www.microsoft.com/Sqlserver/2008/en/us/compact.aspx) for storage engine, and ADO.net implementation of SqlCe in System.Data.SqlServerCe namespace (http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.aspx) for code interaction. They are very well integrated with Visual Studio 2008, including designer support of strong-type dataset and run-time examination of data content on device etc.
No idea about the printing.
In all today scenarios, I would recommend using SQLite. It is the most used database today. Don't bind yourself to an database ecosystem. Just go here and search for "Precompiled Binaries for Windows CE (.NET Compact Framework)". Then you have a SQLite.Interop.*.dll and the System.Data.SQLite.dll. The SQLite.Interop.*.dll has to be placed and deployed besides your EXE file. The System.Data.SQLite.dll is the managed wrapper, that you have to reference in your project. Example: Create SQLite Database and table
SQL Server Compact is not compatible to most mobile platforms like iOS, Android and so on. Microsofts support for old target platforms is poor, leaving Windows CE with only SQL Server Compact 3.5 SP2 where you don't have some essential SQL functions like "LIMIT". Databases generated on the Desktop OS (> Windows XP) will also need to be converted on the device (long delay, when you first open the database), because MS is using different code pages on desktop and Windows CE.
This is Microsofts statement about RDA:
Because of design limitations, remote data access (RDA) will be removed in a future release. If you are currently using RDA, you should consider transitioning to Microsoft Synchronization Services for ADO.NET. If you were planning to use RDA in a new application, you should instead consider merge replication or Sync Services. Note that Sync Services is currently available only for the Windows Desktop Operating System.
Best way to interact with the database is just build the database on the server, compress it als deflate (available under both Desktop and Compact via System.IO.Compression) and send it to the device in whole. Plain and stupid. Most devices have poor import performance, so doing the import locally may take too much time, even if you have a fancy sync framework.
To transfer the database you can use a WCF service or just any web server using a HTTPS GET. Like so:
// ppp_peer is in most cases the active sync connected pc
string url = #"https://ppp_peer/export/database.db.gz";
string html = string.Empty;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (FileStream fs = new FileStream(stream))
{
// Decompress your database here
}
To ORM your POCO objects just use something like https://bitbucket.org/twincoders/sqlite-net-extensions
However, if you have WLAN access everywhere, I would consider writing a browser application and using the mobile browser together with a web server for your needs. Just keep in mind, that Windows CE 5 based devices don't come with HTML 5 support out of the box. If you have a choice consider switching to a Android based device.