I have written a code in Python that I want to turn into a Ubuntu PPA so that everyone can download it and use it.
For storing data, I used postgresql rather than files as it provides me a structure of the table.
Now if I turn my code into a package, I guess I need to make postgresql as a dependency ( still not sure about it but most probably ). If yes, I don't want to do that because my application is really small and I don't want the person installing my software, installing postgresql which he doesnt use.
So my question is there anyway I can avoid postgresql as a dependency. May be any other db tool which is default for Ubuntu or storing it in system and accessing it.
All the views are welcome. :)
Thank u.
That seems to be a use case for SQLite.
It embeds a little database engine into your application and writes to a file. You might want to read the page Appropriate Uses For SQLite first to be sure if this fits your needs.
For Python2 there is a library sqlite3.
Related
I couldn't find any reference that PostgreSQL db supports PMML using a search engine. I was wondering if anyone had any luck with this. I would like to deploy a Random Forest model that is built in R in PostgreSQL (I'm aware of other work arounds - but want to get an answer for this question before I go down the other route).
From my own reading, PostgreSQL doesn't directly support PMML, however if you use JPMML it integrates seamlessly with PostgreSQL. Its library is opensource and extensive.
https://github.com/jpmml/jpmml-postgresql
There is no built-in support. However with the XML support, the extensible stored procedure language handlers, and such it shouldn't be too hard to implement as an add-on (or perhaps an extension).
I don't foresee PMML support coming built into PostgreSQL in the near to moderate future so you would do best to either implement it yourself or go another route.
Which of Zotero's export format would you recommend regarding
- the portability with similar programs
- possibility of reading and adding new entries with a Perl script?
Much of this depends on what other software you will be working with. Any flexible read/write connection to Zotero should probably use the server API; there are already pretty strong client libraries in Python and PHP that you can explore, and it would be reasonable to write one in Perl.
If you just need read access, or read access in addition to write access, there is a Python library, libzotero, that's provided by the wonderful qnotero tool. It opens a read-only connection to a local Zotero installation's underlying sqlite database. If you need quick read access and searching, that library or its approach will serve you well.
Without using the server API, it's also possible to use the Firefox extension MozRepl with the MozRepl CPAN module to get programmatic access to a running local Zotero instance. This is pretty powerful, but it means that you need to send JavaScript to MozRepl. This approach is used with elisp to implement Zotero access for org-mode, zotero-plain.
If you certainly want export, the most expressive option is Bibliontology RDF, but not much out there understands it. MODS export from Zotero is also pretty solid, and it can be converted into pretty much anything else, using the superb bibutils package.
And the main place for questions like this is the mailing list zotero-dev, where you'll find just about everyone who works on programming in the broader Zotero ecosystem, so it may be worth stopping by there as well.
I made a perl module for my own purposes that tries to improve the reliability of mozrepl communications. Feel free to reuse anything you need. Source is here
I've been struggling through this by looking at the sparse documentation and it's a pretty hard slog to say the least. Has anyone done a simple tutorial that would walk one through creating an OSX application with Mono (presumably Monomac) that binds to a Postgres database?
To use PostgreSQL with Mono you simply need to use Npgsql.
We are doing research right now on whether to switch our postgresql db to an embedded Derby db. Both would be using glassfish 3 for our data layer. Anybody have any opinions or knowledge that could help us decide?
Thanks!
edit: we are writing some performance tests ourselves right now. Looking for answers more based on experience / first hand knowledge
I know I'm late to post an answer here, but I want to make sure nobody makes the mistake of using Derby over any production-quality database in the future. I apologize in advance for how negative this answer is - I'm trying to capture an entire engineering team's ill feelings in a brief Q&A answer.
Our experience using Derby in many small-ish customer deployments has led us to seriously doubt how useful it is for anything but test environments. Some problems we've had:
Deadlocks caused by lock escalations - this is the biggest one and happens to one customer about once every week or two
Interrupted I/Os cause Derby to fail outright on Solaris (may not be an issue on other platforms) - we had to build a shim to protect it from these failures
Can't handle complicated queries which MySQL/PostgreSQL would handle with ease
Buggy transaction log implementation caused a table corruption which required us to export the database and then re-import it (couldn't just drop the corrupted table), and we still lost the table in the process - thank goodness we had a backup
No LIMIT syntax
Low performance for complicated queries
Low performance for large datasets
Due to the fact that it's embedded, Derby is more of a competitor to SQLite than it is to PostgreSQL, which is an extremely mature production-quality database which is used to store multi-petabyte datasets by some of the largest websites in the world. If you want to be ready for growth and don't want to get caught debugging someone else's database code, I would recommend not using Derby. I don't have any experience with SQLite, but I can't imagine it being much less reliable than Derby has been for us and still being as popular as it is.
In fact, we're in the process of porting to PostgreSQL now.
Derby still is relatively slow in performance, but ... where ever your Java application goes your database server goes, completely platform independent. You don't even need to think about installing a DB server where your Java app is being copied to.
I was using MySQL with Java, but having an embedded implementation of your Database server sitting right within my Java App is just stunning and unprecedented productivity, freedom and flexibility.
Always having a DB server included whenever and wherever on any platform for me is just heaven !!!
Have not compared Postgresql to Derby directly. However, having used both in different circumstances, I have found Derby to be highly reliable. However you will need to pay attention to Derby configuration to ensure it suits your application needs.
When looking at the H2 databases stats site, it's worth reading follow up discussion which comes out in favour of Derby compared to the H2 conclusions. http://groups.google.com/group/h2-database/browse_thread/thread/55a7558563248148?pli=1
Some stats from the H2 database site here:
http://www.h2database.com/html/performance.html
There are a number of performance test suites that are included as part of the Derby source code distribution itself; they are used by Derby developers to conduct their own performance testing of Derby. So if you need examples of performance tests, or want additional ones, you could consider using those. Look in the subdirectory named java/testing/org/apache/derbyTesting/perf in the Derby source distribution.
I'm not sure what you mean that Derby is embedded. Certainly that is an option, but you can also install it as a separate server.
Hi guys we are on the way to start developing a big web platform. For db server we choosen postgresql. Would you suggest an OS for the postgresql server (we are looking for the maximum performance)?
Thanks
P.S. sorry for the bad english
I would suggest a platform that you feel comfortable with. As Jeff suggested, it is usually easier to throw faster hardware at a problem than human time.
This reasoning is based on theses main ideas :
Usually the database is only marginally faster given different OS.
The high order optimisations are usually in tuning the database or the requests. Not really in switching OS.
If you have more knowledge on a OS, you can take usually more juice out from it. Whereas if you take an OS that you are not really familiar with, but that is supposed to be faster, it might kick your back in unexpected ways.
That said, as answered before an *NIX-based OS would be better right now, since PostgreSQL has still deep roots in a *NIX world. But this is becoming less and less an issue with the 8.x line.
I would suggest *nix based, Linux would be great if it is possible because you can get the package easier with the built-in package manager (e.g apt for debian, yum for fedora, etc). Because Postgres is originally made for *nix based OS. The port to windows is only recently and as you can see on several threads here on Stackoverflow, Postgres does not perform as good on Windows as it is on *nix based OS.