Delphi and NoSQL - database

Have anyone ever used Delphi with NoSQL databases like Mongo, CouchDB or others? Which one would you recommend?

For Mongo, theres TMongoWire and pebongo (early stages). For couchDB, I believe one would interact mainly through HTTP/JSON
For Cassandra, I believe the best bet would be to somehow incorporate a supported language inside your Delphi app and use that to interact with Cassandra, or else implement a web service in a supported language and make it accessible to your Delphi application.
Hope it helps.

There is a new full featured driver for MongoDB "mongo-delphi-driver" which can be found (with examples) here: https://github.com/gerald-lindsly/mongo-delphi-driver.

Delphi has few native NoSQL database solutions right-out-of-the-box:
BDE & Paradox & dBase through the TDatabase & TTable API;
TClientDataSet.
Not that I suggest them, but you have not listed your requirements.

Related

Any Persistent NoSQL datastore for Flutter?

I'm looking for a Flutter NoSQL persistence DB with basic query system.
I found sembast
I would like to know alternatives or better solutions
Sembast would be my top recommendation. It's maintained by tekartik who also maintains the excellent SQFLite package. Sembast is also the most popular embedded NoSQL database on Pub right now (other than Firebase options).
I've trusted tekartik many times in the past with SQFLite among others, he's prompt, polite and incredibly helpful, even with new coders.
Have you tried objectdb? "Persistent embedded document-oriented NoSQL database for Dart and Flutter".
I have worked with ObjectBox in Android development before and they also have APIs for Flutter. It was pretty fast and reliable. Also, have a look at Hive.
I use Hive. It's fast, easy to use and has code generation facilities that work fine with json_serializable and freezed.

Embedded (pure Java) database for Clojure

I'm in need for an embedded database for a Clojure application. Maybe it's the same criteria as for any other Java application but I rather get some other people's opinion anyway. I'm not picking SQLite because that's not pure Java so distribution of a standalone application gets much more complex. It seems the way to go is Apache Derby. Anything else I should consider?
Without a doubt, H2
Here are the settings,
(def demo-settings
{
:classname "org.h2.Driver"
:subprotocol "h2:file"
:subname (str (System/getProperty "user.dir") "/" "demo")
:user "sa"
:password ""
}
)
And then the usual Clojure SQL code:
(with-connection demo-settings
(create-table :DEMO_TABLE
[:M_LABEL "varchar(120)"]
[:M_DATE "varchar(120)"]
[:M_COMMENT "varchar(32)"]))
Have you looked at FleetDB? It's a Clojure database with a JSON protocol and clients in several languages. I suspect you could probably run it embedded without working too hard at it.
h2
oracle Berkley DB
I used an embedded database, H2 within clojure and used clojureQL to access it. Be warned though that since the database is in process you should not use this for large amounts of records (> than 10,000s in a single table) as you will get huge performance problems as the database and your code will both be sharing the same JVM
I think Derby makes an excellent 100% Java embedded database, and it's useful for a wide variety of applications, well-maintained by an active community, and very well documented.
If you don't mind NOSQL, neo4j is an embeddable graph db with transactions, licensed under the GPL. The most up to date bindings I've found are https://github.com/hgavin/borneo
There is also an interesting graph db project in clojure with pluggable backends: https://github.com/flatland/jiraph
The still quite young but promising looking OrientDB might be worth a look: http://www.orientechnologies.com/orient-db.htm
http://github.com/eduardoejp/clj-orient
Then there's http://jdbm.sourceforge.net/
I am using https://github.com/clojurewerkz/archimedes which allows you to specify a backend later.
Another option to consider is a key-value store Chronicle Map, because it's pure Java and provides a vanilla Java Map interface, so working with it should be very simple using Clojure.

Simplest way to develop an app that can use multiple types of databases?

I have a project for a class which requires that if a database is used, options exist for the user to pick a database to use which could be of a different type. So while I can use e.g. MySQL for development, in the final version of the project, the user must be able to choose a database (Oracle, MySQL, SQLite, etc.) upon installation. What's the easiest way to go about this, if there is an easy way?
The language used is up to me as long as it's supported by the department's Linux machines, so it could be Java, PHP, Perl, etc. I've been researching and found info on ODBC, JDBC, and SQLJ (such as this) but I'm quite new to databases so I'm having a hard time figuring out what would be best for my needs. It's also possible there may not be a simple enough way to do this; the professor admitted he's not a database guy either and he seemed to think it would be easy without having a clear idea of what it would take.
This is for a web app, but it ought to be fairly straight forward, using for example HTML and Javascript on the client side and Java with a MySQL database on the server side. No mention has been made of frameworks so I think they're too much. I have the option of using Tomcat or Apache if necessary but the overall idea is to keep things simple, and everything used should be able to be installed/changed/configured with just user level access. So something like having to recompile PHP to use ODBC would be out, I think.
Within these limitations, what would be the best way (if any) to be able to interact with an arbitrary database?
The issue I think you will have here is that SQL is not truely standard. What I mean is that vendors (Oracle, MySQL etc) have included types and features that are not SQL standard in order to "tie you in" to their DB, such as Oracle's VARCHAR2 and so on.
When I was at university, my final year project was to create an application that allowed users to create relational databases using JDBC with a Java front-end.
The use of JDBC was very simple but the issue was finding enough SQL features/types that all the vendors have in common. So they could switch between them without any issues. A way round this is to implement modules to deal with vendor specific issues and write ways to translate between them. So for example you may develop a database for MySQL with lots of MySQL specific code in that, but then you may want to use Oracle and then there are issues, which you would need to resolve.
I would spend some time looking at what core SQL standard all the vendors implement and then code for these features. But I think the technology you use wouldn't be the issue but rather the SQL you create.
Hope this helps, apologies if its not helpful!
Well, you can go two ways (in Java):
You can develop your own classes to work with different databases and load their drivers in JDBC. This way you will create a data access layer for yourself, which takes some time.
You can use Hibernate (or other ORMs). This way Hibernate will take care of things for you and you only have to know how to use Hibernate. Learning Hibernate may take some time, but when you get used to it, it can be very useful for your future projects.
If you want to stick Java there Hibernate (which wouldn't require a framework). Hibernate is fairly easy to use. You write HQL which gets translated to the SQL needed for the database you're using.
Maybe use an object relational mapper (ORM) or database abstraction layer (DAL). They are designed to provide a standard API to multiple database backends, making it possible to switch between different backends with minimal or no changes to your code. In Python, for example, a popular ORM is SQLAlchemy, and an excellent DAL is the web2py DAL (it's part of the web2py framework but can be used as a standalone DAL outside the framework as well). There are many other options in other languages as well.
use a framework with database abstraction layer and orm . try symfony or rails
There are a lot of Object relational database frameworks, unless you prefer jdbc. For simple/small applications this should work fine.

How Smalltalk deals with DataBases?

I'm using Squeak4.1. How does it handle Database connections? Does it provides something similar to ODBC/ADO in .NET or the J2EE stuff?
Which packages deal with database operations?
Can anybody give me some hints?
Few links that might be of use to you:
Squeak Smalltalk and Databases
SqueakDBX
Persistence in Seaside (Also see Chapter 8 in the Seaside tutorial)
Magma
Databases and Persistence
Squeak PostreSQL
If you want something that's truly an analog to ODBC/JDBC or ADO.NET, then the closest analog would be SqueakDBX, a generic, FFI-based connector to a wide variety of databases. While it uses FFI, the developers have gone to great lengths to ensure that long operations do not block the VM. While I can't honestly say I've used it in production, reviews have been positive, it supports a very wide variety of databases (MySQL, Microsoft SQL Server, PostgreSQL, SQLite3, and more), and it's being actively developed, so it's probably a good bet.
Historically, the downside of SqueakDBX is that you didn't get GLORP, the major ORM used in the Smalltalk world these days. The good news is that's no longer true: SqueakDBX now has GlorpDBX, which brings GLORP to SqueakDBX. Drivers are currently available for PostgreSQL, MS SQL, and MySQL, among others. If you need to connect to a traditional database, this is probably your best bet.
Benjamin: We have already started to modify Glorp, we call it GlorpDBX and now Glorp works with a generic database driver, included a GlorpSqueakDBX driver. Right now we have GlorpDBX working with SqueakDBX for Postgres, MSSQL and Oracle.
Cheers
You might not need to. If your smalltalk code runs in Gemstone, there is no need to worry about database connections and queries before you have a lot of data/a lot of transactions.
And if the number of objects is very small, SandstoneDB is much easier to use. On the Persistence in Seaside page you can find the links.

Using Haskell with a database backend for "business applications"

I would like to know if there is any possibility that I can use Haskell with small database like sql server compact so that client wont have to install any server on his desktop.
Is there any api providing sql statements and so on ...
What is the best solution to achieve small database application using haskell.
thanks for help
SQLite is a great option for a small, lightweight database you can embed in your application. See HackageDB for a Haskell binding.
There are 57 database libraries and tools for Haskell on Hackage. The most popular is HDBC, an order of magnitude more popular than anything else, and has the HDBC-sqlite backend.
I would definitely recommend SQLite. If you are looking for a library to help keep the type safety of Haskell with a concise syntax, I would recommend checking out Persistent, which has a SQLite backend.

Resources