Use SQL Server CE with node-webkit - node.js

I need to work on an old application written with WPF and MS SQL Server Compact Edition. As a requirement the app is executed from an USB stick (where also all the data is persisted) and the same should apply for the new system.
In the new application I would like to use NoSQL db to store the data (node-sqlite3 or npm-nosql). However the records currently stored on the SQL CE database must be migrated to the new db or the same SQL CE database used again (even if I prefer to avoid this option). In the latter case, I have seen there is node-mssql as database connector, but SQL Server CE is not among the supported databases.
The current SQL CE schema is extremely simple, only 4 tables and less than 300 records in total. The application is executed locally by a single user.
Is there a way to export the SQL CE database so that I can import it into the new database? Are there better databases to be used with node-webkit other than the ones aforementioned?

The driver you're looking for is:
https://www.npmjs.com/package/ce-mssql
However - I'm afraid you'll need to fork a nodejs process from your webkit application, and feature your queries through web API - this will put you at home with Angular.

Related

Electron Desktop Application communicating with remote NoSql server

I've begun to dive into developing a desktop application with electron. I have been interested in pairing this application with a NoSQL database to create users, display data, and do CRUD operations. I've considered databases such as MongoDB and CouchDB, and I'm curious if creating a desktop application that communicates with a database hosted elsewhere is a feasible goal.
I'm hoping that someone here can help direct me to great resources on creating a desktop application that works with a remote NoSQL database. Any advice here would be greatly appreciated!
I recommend the use of CouchDB, which uses a JSON based document format. CouchDB bundles the server and data storage functionality in a single product, providing a REST-like HTTP interface for document insertion, updates, retrieval and deletion.
Therefore, you'll be able to interact with CouchDB directly from within the Electron desktop application. Apache CouchDB Nano is the official Node.js library for accessing CouchDB.
The following additional factors speach for CouchDB:
It is open source.
It has comprehensive documentation.
It is available for Linux, macOS and Windows.
It's easily installed and quickly set up.
It can be installed on your local computer (for development), on your own servers, or in the cloud.
It supports Mango querying language (inspired from MongoDB).
It is highly scalable.
It is shipped with Fauxton web interface that lets you create, update, delete, view and query documents on the fly.
etc.

Using redis in front of MySQL

We have a mysql database of size 4TB. It has around 3000 tables with few tables having size of 200-300GB.
Sometimes queries takes longer than 60 to 100 seconds on these bigger tables.
A Java application loads data into this database. Another Java spring based web application searches this database..so only select queries are used by this web application.
I am planning to use redis database in between web application and MySQL to improve the select query and in turn web application performance.
Planning to do one time migration to redis initially and then edit Java application to insert data into both MySQL and redis.
Can I use redis for this use case? Please let me know if there are any other ideas.
As per MySQL DBA, it is tuned to maximum extent.
We can't do much changes at database side due to infrastructure challenges. I can try only Software related changes
It depends on which data model in your web application.
you can choose Memcached if it just about just k/v load, otherwise you can choose Redis.

How can I view an Azure CosmosDb using Pycharms or IntelliJ?

I can see loads of drivers, but nothing for DocumentDB.
I did try searching for an appropriate driver, but I found nothing.
My DocumentDb is in Azure, so I have a URL and primary key, but I was unable to see how to connect via Pycharm using the "Data Source from URL" option.
How can I connect my DocumentDb to Pycharm (or IntelliJ) database explorer?
Cosmos DB is not a relational database, and you cannot simply connect to it as such.
It supports several NoSQL protocol variants: DocumentDB (native document store), MongoDB API, Gremlin graph api, and Azure Table API. Not possible to connect via a relational database driver.
If a tool doesn't explicitly support one of the above-mentioned protocols, you simply won't be able to use it, and will need to work with a different tool. And which tool you choose is really up to you (tool recommendation questions are off-topic).
You can connect to CosmosDb from IntelliJ, DataGrip or other JetBrains software using a JDBC driver. JDBC drivers are software components that allow Java applications to interact with dtabases. (I think that JetBrains IDE's are all based on IntelliJ, which is Java software). I think there are probably a few JDBC drivers around that allow connections to a CosmosDb database and run SQL queries.
For a specific connection example you can look at CData who makes a collection of drivers including a JDBC driver that can be used to connect to CosmosDb from any tool that allows their JDBC driver to be used. They have instructions that are located here for using it with IntelliJ. I have been able to use the instructions located there to connect to a CosmosDb instance from JetBrains DataGrip and run queries against the database. I still have some things to work out but it does allow me to create a successful connection and run simple queries.

Attempting to make an existing SQL Server database compatible with the Windows Azure platform using SSDT

I'm attempting to make my existing SQL Server 2008 database compatible with the Windows Azure platform by using SSDT, however I am getting a whole bunch of errors when I build the project due to TVFs and views looking for an external database that sits in the same instance in SSMS.
I've added the database that its looking for into Azure, which wasn't a problem.
I've found that if I load the offending piece of code I can add the Azure server address to the FROM statement which resolves the error (shown below), however I have a huge number that rely on the external db and hoped there may be a quicker way?
FROM [myAzureserver.database.windows.net.ExternalDBName.dbo.TableName] as ALIAS
I understand that this issue would not exist if I merged the databases, however this isn't possible at present.
Thanks a lot for your help.
Why are you trying to make your local SQL Server Azure compliant? Are you planning to move it at some point in the cloud? If so, you won't be able to use linked servers. Your FROM clause will work as long as the database remains on an on-premise SQL Server instance.
Assuming that's what you want to do, you are asking if there is quicker way to change your references to point to the cloud database, right? I am not sure if this will work for you but I had a similar issue on another project and ended up using synonyms. Check our synonyms here: http://msdn.microsoft.com/en-us/library/ms177544.aspx. Although you can't create a synonym for a server, you can create synonyms for tables/views/procs.
Again, this may not work for you, but let's try this...
Assuming you have your primary database called DB1, the secondary database called DB2, and the cloud database of DB2 called AzureDB2, you could create synonyms in DB2 to point to the cloud database without changing any SQL statement from DB1.
So assume you have this statement today in DB1:
SELECT * FROM DB2.MyTable
You could create a synonym in DB2 called MyTable:
CREATE SYNONYM MyTable FOR [myAzureserver.database.windows.net.ExternalDBName.dbo.TableName]
DB2 becomes a bridge basically. You don't need to change any statement in DB1; just create synonyms in DB2 that point to the cloud database.
Hopefully this works for you. :)

SubSonic-based app that connects to multiple databases

I currently developed an app that connects to SQL Server 2005 database, so my DAL objects where generated using information from that DB.
It will also be possible to connect to an Oracle and MySQL db, all with the same table structures (aside from the normal differences in fields, such as varbinary(max) in SQL Server and BLOB in Oracle, and so on). For this purpose, I already defined multiple connection strings and multiple SubSonic providers for the different DB's the app will run on.
My question is, if I generated my objects using a SQL Server database, should the generated objects work transparently with the other DB's or do I need to generate a different DAL for each database engine I use? Should I be aware of any possible bugs I may encounter while performing these operations?
Thanks in advance for any advice on this issue.
I'm using SubSonic 2.2 by the way....
From what I've been able to test so far, I can't see an easy way to achieve what I'm trying to do.
The ideal situation for me would have been to generate SubSonic objects using SQL Server for example, and just be able to switch dynamically to MySQL by just creating at runtime the correct Provider for it along with its connection string. I got to a point where my app would correctly connect from SQL Server to a MySQL DB, but there's a point where the app fails since SubSonic internally generates queries of the form
SELECT * FROM dbo.MyTable
which MySQL doesn't support obviously. I also noticed queries that enclosed table names with brackets ([]), so it seems that there are a number of factors that would limit the use of one Provider along multiple DB engines.
I guess my only other option is to sort it out with multiple generated providers, although I must admit it does not make me comfortable knowing that I'll have N copies of basically the same classes along my project.
I would really love to hear from anyone else if they've had similar experiences. I'll be sure to post my results once I get everything sorted out and working for my project.
Has any of this changed in 3.0? This would definitely be a worthy reason for me to upgrade if life is any easier on this matter...

Resources