12

I am in the early stages of planning and designing a custom accounting application for my firm. My goal is to utilize an open source relational database for the data storage portion and I'm aware of two solid databases that are widely supported: MySQL and PostgreSQL.

For a system that will require transactions, stored procedures, functions, and security, are there any opinions on which of these two databases would be best suited for an accounting application or is there another database I'm missing?

I'm more familiar with MySQL and MS SQLServer 2005, but I'm trying to move away from the latter due to license costs.

Let me add: This is not an accounting need like Quickbooks or Peachtree. This is basically a system that handles accounting for a specific business service we provide. There are maybe two or three systems that cater to this need, are priced in the six figure range before any customization, and would require my small firm to be married to a vendor for the long-term. Thus, we are building the application in-house.

Also, while I appreciate the Buy vs. Build argument, I'd like to move away from that particular religious question because the Buy road was already taken and the vendor failed miserably. Sometimes you just need to do the job yourself and this particular project and budget warrants it.

Thanks for everyone's replies thus far.

ConcernedOfTunbridgeWells
  • 59,622
  • 15
  • 138
  • 193
Randy Burgess
  • 3,842
  • 5
  • 35
  • 57
  • The second addition ends the argument. If you've already had a vendor in and they've failed, then maybe you should give it a shot. Just be honest with yourself about why they failed and how it'll be different for you. Good luck. Let us know how you make out. – duffymo Jan 05 '09 at 02:39
  • 1
    It's been four years - how did this adventure work out for you? Did you finish the system? Did the features and cost you ended up with satisfy your needs? I'd be curious to know. Your low rep suggests that you aren't active here anymore. – duffymo Dec 08 '12 at 20:25

13 Answers13

22

There are four main open-source relational database management systems of note that might be appropriate to this sort of application: Postgresql, MySQL, Firebird and Ingres. There are other systems such as SQLite, but they do not have this type of architecture and are not really designed for this type of workload. Some other open-source database management systems of this type do exist, but do not appear to be strongly viable for some reason, such as a lack of apparent vendor commitment. An example of a system that has this type of issue is SAP-DB.

Postgresql has the best feature set of any of the open-source databases, and support for XA transactions, which you will probably want if your application is a three-tier system and supports transactions of non-trivial complexity. In particular you will want this if you want to do transactions spanning more than one call to the database.

Several commercial variants of PostgreSQL have been built over the years, such as Illustra, Greenplum and EnterpriseDB. Illustra was a commercial release of PostgreSQL which was subsequently bought by Informix. Greenplum is a mofified version designed for data warehousing applications. EnterpriseDB is a company that provides supported commercial versions of PostgreSQL with some value-added software.

MySQL 5.x has a feature set that supports a reasonable cross section of capabilities, but it is not as feature-rich as PostgreSQL. It has more widespread mainstream acceptance and would be the easiest of the open-source database management systems to recruit skilled developers for. Although older versions did not have robust transaction support, transactional storage engines such as InnoDB have been available for some time. The current politics surrounding the acquisition by Sun have generated code forks and the MySQL landscape is somewhat messy, with controversy about quality issues in the 5.1 release. However, MySQL is by far the most popular and best known of the open-source database management systems and is the only one with significant brand recognition outside of open-source circles.

Firebird is an open-source version of Interbase. Last I looked, it did not have XA support but would be fine if your application was set up as a two-tier client-server system. Update: I can't find a definitive specification on this, but the documentation does indicate that it has support for two-phase commit, but what I could find was not specific on whether it supported the XA protocol. The documentation implies that the JDBC driver does have support for two-phase commits.

An interesting variant on this system is Fyracle, which is designed to offer a degree of compatibility with Oracle. This was originally developed for use as a back-end to Compiere, which was built against Oracle and quite tightly coupled to it.

Ingres is now available with an open-source license, but has been greeted with a bit of a collective yawn by the open-source community. However It is quite feature-rich and very mature - I know people who were doing INGRES apps in 1990, and it dates back to the 1980s.

ConcernedOfTunbridgeWells
  • 59,622
  • 15
  • 138
  • 193
  • I know of a telecoms system that uses postgres in a mission-critical environment (and I mean lives-at-stake type critical!), its not failed us yet. – gbjbaanb Jan 05 '09 at 00:48
  • I suppose it's worth mentioning Derby if in an all-Java environment, as well, but I've not seen a particularly convincing argument for its use. – Calum Jan 05 '09 at 11:30
  • +1 for PostgreSQL. MySQL is a nice Web Database, but it does not really have a good history in terms of data integrity, and the "Oops we did it again" blog post regarding MySQL 5.1 does not help either. It's not bad, but i would not use it for accounting. – Michael Stum Jan 14 '09 at 00:32
  • +1 for Firebird. Firebird 2.1 include many Fyracle enhancement – Hugues Van Landeghem Oct 19 '09 at 16:41
  • We use PostgreSQL in LedgerSMB and have been extremely happy. – Chris Travers Sep 04 '12 at 07:22
16

My advice? Don't. Better to buy one. People who know more about accounting have written good packages that already deal with GAAP. They have a larger user base than you'll ever have, which will uncover defects faster. This is a classic "buy versus build". There's no competitive advantage to your firm by writing their own. If you're doing it because you're worried about license costs, I'd say you haven't accounted for the development time properly. That's the only way you could justify doing this in-house.

With that said, if you are worried about SQL Server licensing costs, I'd recommend PostgreSQL first or MySQL second as your database of choice.

duffymo
  • 293,097
  • 41
  • 348
  • 541
  • This site lists five accounting packages for small businesses, including one from Microsoft. Your website leads me to believe that this might be your business. Buy something and spend the time invoicing billable hours instead. – duffymo Jan 05 '09 at 00:38
  • Thanks for the reply. Usually, I'd agree with this sentiment, but in this case the accounting system need is very atypical. There are only two proprietary accounting systems that relate to this particular need and both are priced in the six figure range for just the install. Hence, our in-house dev. – Randy Burgess Jan 05 '09 at 00:38
  • http://sbinfocanada.about.com/od/accountin1/tp/accountsoft.htm – duffymo Jan 05 '09 at 00:39
  • Then my second recommendation stands - PostgreSQL would be my open source choice. – duffymo Jan 05 '09 at 00:40
  • Thank you, it's my fault for not mentioning that this is basically an accounting+ type of system. – Randy Burgess Jan 05 '09 at 00:43
  • General ledger/accounts payable/accounts receivable/ and what...? – duffymo Jan 05 '09 at 00:48
  • It's a hybrid system that accounts for security management. So, it's a type of portfolio management/accounting system. Portfolio management needs seem fairly easy to build a system upon, but the accounting needs are more strict. Thus, I am looking for the database with the more needy side in mind. – Randy Burgess Jan 05 '09 at 00:52
  • Don't forget that a 6-figure cost is barely more than one year's salaray plus overhead for you. Plus you get someone else to blame, and they deal with all the legal stuff that you'd have to worry about. You will need to be earning a very low salary and be very good at coding to warrant writing it. – Jonathan Leffler Jan 05 '09 at 02:11
  • I'm still not convinced, but that's your management's problem. This link says that there are portfolio management packages out there, too: http://letmegooglethatforyou.com/?q=portfolio+management+software – duffymo Jan 05 '09 at 02:29
  • Well, I don't outsource jobs just to assign blame for problems. Plus, I can't pull money for a solution with none in the budget. I have the business problem, a prototype to use, and an allocation of time from my managers. That's it. I do appreciate the answers to the question about the database. – Randy Burgess Jan 05 '09 at 02:47
6

I agree strongly with answers from duffymo and tuinstoel and others. Reconsider your build vs. buy decision. Let me tell you a story:

While I was working at a mid-sized company (international, >$100M/yr revenue), the CFO decided to replace the financial systems with Oracle Financials. Only that package didn't exactly match the accounting practices used by this company.

So the CFO hired a team of contract programmers, and paid them to customize Oracle Financials to the preferred accounting practices. She sunk 12 months of time, $1 million in programmer wages, plus the initial cost of the software, just to duplicate the accounting system that they had intended to replace.

She said if she had to do it over again, she would buy the commercial package, but adapt the company's accounting habits to the defaults supported by the software. That would be far easier, quicker, and more likely to succeed.

So consider the cost of building your own custom package. Also consider the ongoing cost to your company of maintanance, debugging, and enhancement for that software. Even if buy a six-figure commercial package, that'll probably be less expensive than paying the programmers to develop and maintain such a system.


To answer your stated question more directly, I don't think there's a significant difference between PostgreSQL and MySQL that is relevant to your project. Since you are comfortable with MySQL, you might as well go with that.

I would like to offer an obligatory reminder not to use inexact data types like FLOAT or DOUBLE PRECISION for financial data.

Bill Karwin
  • 462,430
  • 80
  • 609
  • 762
  • "....adapt the company's accounting habits to the defaults supported by the software...." - exactly. Too many companies end up in no man's land by buying and then customizing. You lose all the benefit of buy and incur all the cost of build. – duffymo Jan 05 '09 at 02:14
  • 1
    For the life of me I cannot understand how anybody could have voted this answer down. An excellent point, and well written. – duffymo Jan 05 '09 at 02:15
  • Believe me, I appreciate this stance. I have outsourced almost all of the technical functions of my small firm (20 people) because I usually side with the "Buy" argument, but this particular project is different in terms of needs and budget. – Randy Burgess Jan 05 '09 at 02:38
  • That's the answer, then. Good luck! – duffymo Jan 05 '09 at 02:49
  • Well, I think your candor about Buy vs. Build is warranted. The consideration of that debate should ALWAYS be asked when making application decisions. It just so happens that BvB was already decided upon before I asked the question...a question that sounded pretty amateur in my first posting. – Randy Burgess Jan 05 '09 at 02:55
3

For any application that wants to use an open source database, the hands-down answer is Postgres. It's a LOT more "enterprise-ready" than MySQL, not to mention that it follows the SQL standard a lot better. MySQL has improved a lot with its later versions, but Postgres still beats it in every category.

Wayne Molina
  • 17,811
  • 24
  • 93
  • 156
2

There are open source free accounting systems. Like osFinancials. I really can't understand why you want to build your own system?

tuinstoel
  • 7,224
  • 25
  • 27
  • Obviously, we can Google it, but it is nice to include a URL. – Jonathan Leffler Jan 05 '09 at 02:13
  • Adapting an existing package like osFinancials might make good sense as well. Problem with osFinancials specifically is that it apparently uses old Delphi components that are not available anymore. Seems like the osFinancials guys are not exactly in a hurry to replace these either... – reiniero Jun 26 '12 at 15:27
1

I build accounting software on PostgreSQL. It works very well. I would highly recommend it. In fact (shameless plug), you might consider working with us to improve our project and using it as a jumping off point.

There are a couple reasons in particular:

  1. LISTEN/NOTIFY gives you an ability to hook other programs into your accounting db when something changes without having to check tables every so often.
  2. We've found extremely good performance with most complex queries.

Firebird and Ingres will give you a very rock-solid relational solution. MySQL I wouldn't recommend because you are really tying everything to one app only that can write to the db (sql mode soup means relations are basically a private API instead of the public API they are in PostgreSQL, Firebird, and Ingres), and this means less flexibility down the road.

However, with PostgreSQL, you get a top-notch, extensible development platform in a box. Pace of development is high. It is rock solid. The advanced features are very helpful. You won't be disappointed. We haven't been.

Chris Travers
  • 22,769
  • 6
  • 52
  • 166
1

For your application, it won't really matter. Anything from sqlite to MySQL to Postgres would probably work just fine. Pick the one you're most familiar with.

Ross
  • 8,968
  • 8
  • 33
  • 35
1

Firebird - http://www.firebirdsql.org/

jussij
  • 10,005
  • 1
  • 28
  • 46
1

If you are familiar with MySQL then use it. But select proper database engine instead of default MyISAM

List of Storage Engines

Malx
  • 972
  • 1
  • 8
  • 16
1

Honestly, any of the usual suspects will do the job. Maintaining the chart of accounts and related data tables is the root issue that drove most all of the relational model. In fact, if you think about the general journal view of an accounting system, all you have is the chart-of-accounts and the general journal, composed of transaction number, date, description, debit account and amount, credit account and amount. Everything else you do is a SELECT on those.

That said, though, there are so many perfectly adequate, well-tested and accepted financial packages, including open-source free (as in beer) versions, that unless you mean it for an etude, a study project, I'd put my effort into googling and selecting one.

Saw your update. The thing is, this is an issue that's mostly going to be determined by nonfunctional requirements. Are you going to distribute the database across more than one server? how much load do you expect? Transactions per second or transactions per day? I've built systems around both in the last couple of years, and it's usually reliability and avilability requirements that are the most decisive: PostgreSQL deals with concurrent updates of a single row more effectively, by enforcing row atomicity and serializing concurrent updates. On the other hand, MySQL seems to deal with really large databases better. Yet a third question is backup --- one of them (I don't recall which one right now) more or less requires some down time to backup.

Charlie Martin
  • 103,438
  • 22
  • 180
  • 253
1

For an in-house web-based accounting application, you might be better off with Gemstone as a free but not open source object database and Seaside as the web framework. Otherwise known as GLASS.

For an in-house application, you're going to be limited in developer effort. Gemstone, as a smalltalk image, provides the best developer productivity by far. Its support for migrating objects when changing their definition allows real iterative development. Seaside replaces templates by a well-designed domain-specific language for building web applications.

Stephan Eggermont
  • 15,354
  • 1
  • 33
  • 64
0

If this is a desktop application you might want to look at SQLite. It's very well known, in the public domain, and not terribly difficult to work with.

Scott
  • 10,588
  • 10
  • 47
  • 83
-1

Since you don't need stored procedures, take that off your list.

You'll be a lot happier putting business logic in code, not in the database. If you have the chance to start "clean", then use the database for what makes the most sense -- persistence not processing.

Once you make that decision, the subtle differences between MySQL and PostgreSQL go away. Both are relational engines that handle nearly identical SQL. Focus on the things they do best.

Recommendation: Make your application independent of any database peculiarities.

S.Lott
  • 359,791
  • 75
  • 487
  • 757
  • 1
    -1 This is not really the place to get into religious wars about the merits of stored procedures. – ConcernedOfTunbridgeWells Jan 05 '09 at 00:38
  • 1
    Your comment makes it sound like SPs are lethal even if you're already most comfortable using them. Bad advice. – dkretz Jan 05 '09 at 01:38
  • 2
    SP's are not lethal -- but I've never seen them work out well in the long run. Making them part of the decision process is a mistake. – S.Lott Jan 05 '09 at 02:44
  • 1
    Since there are no merits to stored procedures, it's not religious. It's my experience over the last 20 years of RDBMS usage. Your experience may be different. – S.Lott Jan 05 '09 at 02:45
  • SP's are not evil, but is just another part of a project you have to maintain, debug and fix. I prefer doing this on the code and keep a closer control over it. – Eldelshell Jan 05 '09 at 10:58
  • Since I have to maintain, debug and fix the code in my programming language anyway, why split my maintain, debug and fix time between two languages? Why not skip the SP's and just focus on one language for code? – S.Lott Jan 05 '09 at 11:08
  • Business logic should reside in the database to ensure data integrity. I've never seen a database that didn't use sps that wasn't bloated, inefficent, inaccurate and poorly designed, YMMV. Database people will tell you the last place they want database code is in the application. – HLGEM Jan 06 '09 at 22:29
  • @HLGEM: "Business logic should reside in the database". Cool. Why write applications, then? Why even have an application layer? – S.Lott Jan 06 '09 at 22:31
  • @ S. Lott: Stored procedures can be good or bad. I have seen both. However, when you debug a 500 line sql query in an SP you get to search the tree for bad nodes, while if you debug a 500 line subroutine, you have to traverse it as a linked list. You have to debug the SQL anyway if you are doing the non-trivial stuff the ORM can't handle. Why not keep SQL in .sql files and code in .pl, .java, or the like files? – Chris Travers Sep 04 '12 at 07:14
  • The overall point is, you can put more complex logic in a stored procedure without losing maintainability than you can a program function because the structure of an SQL query is so much more rigorously enforced. Additionally it's a bit easier to unit test SP's on a production system than it is SQL generators on a live system..... – Chris Travers Sep 04 '12 at 07:17
  • BTW, LedgerSMB uses SP's mostly as named queries. It works out very well for us. It has also allowed us to create compatibility classes in PHP for interop with PHP apps (Java up next). Well, as close as PostgreSQL has to SP's (which are set-returning user-defined functions). – Chris Travers Sep 04 '12 at 07:18