How to access a Cassandra distributed database from Delphi

跟風遠走 提交于 2020-01-04 09:15:08

问题


I am looking at whether Cassandra might be an option for a distributed database store for our server software.

The server software is written in Delphi, but I'm having difficulty locating descriptions of how to access a Cassandra database from Delphi.


回答1:


One suggestion elsewhere on SO is to write your own Delphi generator for the Thrift framework.




回答2:


I see two options, either write your own native Delphi driver or use available drivers somehow.

One solution could be to use Python4Delphi to host Python inside Delphi application and use Python code to interface the Cassandra. A little bit clumsy and performance isn't probably the best possible.


Edit: Option #3: Write a proxy server with supported language, which offers interface for your Delphi application.




回答3:


Cassandra was written in Java, and is usually deployed on Linux systems (the term LAMP, refers to the stack of usual suspects; linux-apache-mysql-php). In this case, Cassandra would be a No-SQL bigtable alternative to something like MySql, and would be used by java-centric developers, so no PhP there. But you're still talking about the Unix/Linux world, whereas Delphi exists in the Windows world.

So, with Cassandra running on a Linux (web-server) box, how to access it from a Delphi app running windows box? The APIs are part of the facebook "Thrift" API. You could use a Python-Delphi integration module to load up the Python thrift APIs. Or you could write your own native pascal Thrift integration. I see problems with both approaches. For one thing, you would be on your own here, either way.

Looks like Cassandra can run on Windows (it is written in Java, so it better!), and a bat file is included to start it up on Windows, but the file layout is "more designed for Unix use", and it is used in deployment almost exclusively on Linux or Unix systems.




回答4:


Just to update on this question, as this was one of the few returns from Google on this subject, there is now a Delphi implementation of Thrift on apache.org .




回答5:


Another update: Just working on PasCassa, an Cassandra client for Delphi, based on the Thrift interface mentioned here.



来源:https://stackoverflow.com/questions/2459290/how-to-access-a-cassandra-distributed-database-from-delphi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!