Archive for the 'database' Category
mobifs eifs fmfs

I wrote to the fuse mailing list, about the eifs/fmfs/mobifs. I am still not sure which name fits better, for simplicity I will refer to it as mobifs. Based on the feedback from the mailing list, it became clear for me, that mobifs can be implemented with help of fuse. However implementing it in kernel will avoid double context switch, copying buffers, etc. One of the powerful features of fuse is that you may develop proof of concepts for any kind of filesystem, and the if performance is an issue, recode a part to fit into the kernel. The user space solution for mobifs will be straightforward to implement, at a later stage a kernel module may come into being.

As summary, the goal of mobifs (everything is filesystem) is to allow transparent (read/write) access to the tree structure of files that have such a tree structure under the form of traditional directory tree structure and to present the leaves in form of text, that can be edited without compromising the format expected by the original tools that handle these files.

The driving motivation behind is also to avoid to learn hundreds of command line parameters of hundreds of tools that access such files and to be able to access the data that hides behind with traditional viewers, editors or other tools.

For example an sqllite database file has such a directory structure. instead of issuing sql statements, one would be able to acces such a file like:

#>vi blogs.sqllite@sqllite/tables/blogs/rows/by/uniqueid/mobifs-eifs-story/content

in this example “blogs” is the table containing the blog entries, “by” means that I want to access data by column name, “mobifs-eifs-story” is the unique id of the blog entry, and “content” is the field containing the content.

if your blog database would be on a mysql database on a remote server, you would do sthg. similar:

#>vi blogs.db.id@mysql/tables/blogs/wors/by/uniqueid/mobifs-eifs-story/content

in this case blogs.db.id would contain necessary info how to access the database (server ip, db name, username, password)

database access within wt applications

wt rocks…:).

It has the standalone http server engine, it has also fcgi implementation.

It’s value would probably be significantly increased if some generic database access would be provided (some crazily fancy templates, or polymorfic DAO classes, that could be inelligently connected to widgets. (Yes, the way microsoft does with ocx controls). Another obvious requirement would be to support differet database backends. 

There are some libraries out there, everyone with pluses and minuses. Myself I was spending some time to understand what would fit the best. After studying these libraries I found that on boost’s mailinglist there was already a discussion about the topic. I will write my conclusions soon, but I wanted to ask the wt commmunity what each one uses, and if it would make sense to invent a something and eventually integrate into wt.

the following libraries can be found on internet:

So, can we use or learn something from these libraries?

 

database access for c++

Relational database access is a key component of most of the software applications we use, and this is particularly true for web based applications. Unfortunately as C++ lost a lot of popularity and as Java and scripting languages gained the most of the web applications field, we cannot say that there are lot of open-source C++ frameworks for web development out there. And a good framework for web development means clever sub framework/library for database access.

For one of my projects I was desperately looking for such a framework/library. For the presentation layer I will probably go for Wt, but for database I am a little confused. I will try to compare some of the libraries I found; maybe I will get some valuable feedback from the readers. By writing this it helps me to even better clarify my criteria.

The libraries I found interesting to deeper look at would be:

Relational database access is a key component of most of the software applications we use, and this is particularly true for web based applications. Unfortunately as C++ lost a lot of popularity and as Java and scripting languages gained the most of the web applications field, we cannot say that there are lot of open-source C++ frameworks for web development out there. And a good framework for web development means clever sub framework/library for database access.

For one of my projects I was desperately looking for such a framework/library. For the presentation layer I will probably go for Wt, but for database I am a little confused. I will try to compare some of the libraries I found; maybe I will get some valuable feedback from the readers. By writing this it helps me to even better clarify my criteria.

The libraries I found interesting to deeper look at would be:

… to be continued…

soci c++ on ubuntu 8.10

If you try to build soci-3.0.0 on ubuntu 8.10 you might get some annoying error. I list below the errors and their fixes:

common.h:24: error: ‘std::tm’ has not been declared

fix: add to common.h:

#include <ctime>

errors in file session.cpp:

session.cpp:134: error: ‘strtol’ is not a member of ‘std’

error: ‘INT_MAX’ was not declared in this scope

fix: add to session.cpp

#include <cstdlib>

#include <climits>

in file standard-into-type.cpp:

standard-into-type.cpp:84: error: ‘strncpy’ is not a member of ‘std’

fix:add to standard-into-type.cpp

#include <cstring>

Links related to the soci library:

  • http://soci.sourceforge.net/
  • http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Relational_Database_Access
  • http://www.ddj.com/cpp/188700800?pgno=3
  • http://erdani.org/publications/traits.html
fuse everywhere, even on openmoko

I did not check if by default the fuse is built in the openmoko kernel, but I came today to the conclusion that I missed a lot of oportunities by not using fuse. I think on an embedded device this could create some interesting opportunities. Even more I was investigation dbus performance, and came to the conclusion that a lot was dbus does, could be done by fuse in a more efficient way…

Something like http://www.runtimeaccess.com/projects/rta/index.html could help programs to publish there data in a filesystem… etc…

Anyway the idea to map databases you use in everyday life to the filesystem, and do things like find/grep index etc on them, is really powerful!!!

I will do all this from now on…

even more… I will mount even things like wikipedia… dictionaries etc. :)

I hope it will not mean security issues:)

Anyway, the most exciting are:

Fuse is a way the prolongation of the ideas like reiserfs…

 

 

 

 

json makes it fast…

Another ingredient for fast programs is JSON. The JSON format is a concurrent of XML and YAML. The later stays closer to JSON. I found so far two libraries for C++ that can parse and write JSON structures:

  • http://jsoncpp.sourceforge.net/
  • http://blog.beef.de/projects/tinyjson

… there are even further few listed on the homepage json.org

… There is even a query language jaql