using libdrizzle as an async mysql connector - c++

I'm interested in using libdrizzle as a generic asynchronous-capable connector for mysql db for a c++ application (actually as a backend for hiberlite). Since early this year libdrizzle is no longer a separate project and its merged in the same drizzle project, so installing as a separate dependency (unrelated to the rest of drizzle) might have become slightly more complex.
I'm wondering if people has used this library for interfacing to MySql or MariaDB, probably make some mickey mouse benchmarks to have a rough idea how it stands relative to the synchronous default driver.
Also, comments on difficulties to install, setup, pitfalls (the documentation is essentially nonexistent) would be greatly appreciated.

You might want to take a look at ngx_drizzle (drizzle-nginx-module) at github.
From module description:
This is an nginx upstream module integrating libdrizzle into Nginx in a non-blocking and streamming way.
Essentially it provides a very efficient and flexible way for nginx internals to access MySQL, Drizzle, as well as other RDBMS's that support the Drizzle or MySQL wired protocol. Also it can serve as a direct REST interface to those RDBMS backends.
If you're using MySQL, then MySQL 5.0 ~ 5.5 is required. We're not sure if MySQL 5.6+ work; reports welcome!

Related

Django communicating with another python application?

Is it possible to have django running on the server and one application from django inter communicating with another python process say that I developed and fetching a response from it or even make it just do a particular action?
It can be synchronous or asynchronous; I have some idea of being asynchronous where some package like hendrix, crossbar.io or even celery can be used. But I don't understand what would be the name for this inter-communication and how should I plan the architecture for this.
Going around my head I have the two following situations I'm seeking a plan to be developed:
1.
Say I have django and an e-mail sender with the python package smtp. A user making a request to a view would make django execute my python module I developed for sending an email to a particular user (with a smpt server from google/gmail). It could be synchronous or asynchronous.
OR
2
I have django (some application) and I want it to communicate with some server I maintain; say for making this server execute some code or just fetch a file (if it is an ftp server). Is this an appropriate situation to point to the term 'microservices'? Or there is another term or workaround here?
Your first solution would be called an installable python module, just like any package you install with pip. You can have this as a separate module if you need your code to be re-usable across multiple or just future projects.
Your second solution would be a microservice. This will require setting your small module as a service that could have a REST API to communicate with and make it do whatever you intend it to do.
If your question is "what is the right approach" then I would tell you it depends on your use case. If this is just some re-usable code that you don't want to repeat over and over through our project then just make it into a separate module. While if this is a service that you expect other built services will use and rely on, then just make it into a microservice. You can use a microframework such as Flask for easier and faster setup of your service. Otherwise, if it's just some code that you will use once and serves a single functionality on your application then just write it and keep it there.
There are no rules or standards on which approach should be taken. I personally judge things depending on the use-case.
Hope this helps!

getting database connectivity in c++

How can I create a database using SQL in c++?
I tried going according to the steps I found on a website(which required all this to be on codeblocks) by downloading the SQLAPI++ library for c++.
Next it instructed to download oracle c++ call interface, which I downloaded but didn't understand, how to integrate the library with my Codeblocks project.
If you know any other method it would be much appreciated.
In general:
Standard c++ doesn't support SQL database/server connections out of the box. You need to have a 3rd party product to achieve this.
Many SQL standard compliant DB systems support C or C++ APIs you can use for that.
To name a few:
SQLite
PostgreSQL
MariaDB
MySQL
... a by no means complete list ...
Another alternative is to use a generic ODBC interface implementation, which might also support specific database servers, and SQL standard versions.
In particular:
Codeblocks is ypur IDE, it manages projects and their dependencies on libraries.
You seem to have a solution at hand, which uses the sqlapi++ framework library
You need to integrate the underlying SQL server system in turn of configuring that above mentioned API
You may need to link the native support for that specific SQL API of the server system
To do these steps mentioned above you'll need to install (maybe development versions) of the above mentioned APIs, SDKs, ... (whatever they'll call it) and integrate those with your IDE project (related Q&A link regarding this).

Using Neo4j database from C++

my problem is I want to use Neo4j database from a C++ program and I read a lot, but still don't know, how can I start.
First I would like to make a connection between Neo4j and C++, and I would like to create nodes from the C++ program.
Anyone have an example code, or can somebody help, how can I start?
For the upcoming binary remoting protocol there's already a driver written in C, see:
page: http://cleishm.github.io/libneo4j-client/
source: https://github.com/cleishm/libneo4j-client
Please note that this will only work on Neo4j 3.0 builds. As of today, milestone-2 is the most current one. Be sure to read the release notes when working with milestones.
There are no current C/C++ Neo4j drivers targeting Neo4j 2.x that I'm aware of. (See Stefan's answer for a C driver targeting the upcoming Neo4j 3.0 release)
However, using the transactional Cypher API endpoint you should be able to use any C++ http client / JSON parser to interact with Neo4j using Cypher.

Python Database Connection String with Derby Database

Just to let you know about the problem i am facing, I will give a short introduction about what I have been doing.
I am working on a project, where the WEB interface is constructed in Java.
There is a parser built in python, which parses data and stores it into the database.
We were using a MySQL server, but were later asked to change it into DERBY. The java code now works perfectly connecting with the database.
But the python part of the code has problems with connection. I learnt how the derby database works, but find it hard to find articles about connecting to a derby database.
I have the following details:
uname : root
pwd : root
driver class : org.apache.derby.jdbc.EmbeddedDriver
DRIVER LOCATIONS : C:\Users\esusank\AppData\Roaming\RazorSQL\derby\derby10.10.jar
JDBC URL : jdbc:derby:C:\Derby\databases\MyDbTest;create=true
I am finding it hard to find syntax for writing a connection string for DERBY.
I have installed mxODBC driver.
Can someone help me out on this? If you can post some links or some suitable syntax, it will be very much helpful.
To communicate with Derby, you will need to use a JDBC driver. ODBC drivers can't talk directly to Derby; it is a Java-only database.
I believe there are some ODBC-JDBC bridge providers that provide such connection mechanisms, but I'm not sure if they are still in active use.
Another possibility is to use Jython, which is a Java implementation of Python, which may help: see this related question: Derby Database ODBC Connection

Packing C++ application with MySql database

I've a c++ application with connects to mysql database, creates table and adds some data into it using the mysql connector library.
The question is following :
I would like pack my application so for using the the installation of mysql were not required.
Is it possible to do at all ? If yet any hints, references are welcomed.
The application is managed c++ based.
Yes, MySQL provides an embedded, in-process version that doesn't require you to install a separate MySQL server and yet provides pretty much the same functionality.
Note however that this is subject to license restrictions: you can either use it under a GPL license (and thus you must publish your application's source code if you ever redistribute it to a third-party) or under a commercial license (which you have to pay for, if you want to redistribute your application but not license it under GPL).
I think there is a way. Have a look at one of my SO questions - How can I explore mysql database files (*.frm, *.myd and *.myi) without MySQL? I am also the one who answered it.
It gives you a hint on how you can carry the MySQL DB engine with you, provided you have successfully dealt with the licensing.