Dart - Enterprise Use Case (heavy database access and data processing)

490 views
Skip to first unread message

Niranjan Ravulapalli

unread,
Oct 27, 2014, 10:56:22 AM10/27/14
to mi...@dartlang.org
would like to learn more if Dart is good fit for Enterprise Backoffice applications with heavy database access and data processing and manipulation.

Thanks,
Niranjan

Петър Събев

unread,
Oct 27, 2014, 12:50:49 PM10/27/14
to mi...@dartlang.org
I think more than ready. We provide an ERP like app (both server and client with Dart) which has heavy use of PostgreSQL database. Here is a demo link - https://demo.centryl.com/centryl/. The performance is really impresive. Previously we used MySQL (MyISAM engine, no constraints etc.) and PHP. Now as we've ported the app the results are even better event the heavy work we've put to the database - contraints, checks, transactions, triggers and so on. The one thing that might be hard to work with is the future nature of the queries - they can get quite messy if you don't use some convention. We use a custom DataMapper package which abstract some of the hassle. Now as await/async is comming this won't be relevant i think. The huge win here is - proper language and code reuse (client and server). Now we have control of the app better than ever.

--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Greg Lowe

unread,
Oct 27, 2014, 5:20:10 PM10/27/14
to mi...@dartlang.org
Are you using the postgresql pub package?

If you are, I'm very curious to hear from your experience. Especially if there are things that you think should be improved.

Петър Събев

unread,
Oct 27, 2014, 6:13:33 PM10/27/14
to mi...@dartlang.org
Hi Greg,
yes, I'm using the postgresql pub package and I can say that I have a deep understanding of the lib now(I have made some minor contribution my nick is pisabev on github). For me the package is very good - it's simple and fast (i think this is the fastest we can get). I think it should stay the way it is now, maybe some type additions but when we have the proper support from dart mainly speaking of Decimal/Bignum here. JSON support - I think there is no obstacle for adding it now. One problem, although it's not the package fault is what I call it - "connection leak" - my app is relatively heavy on db connections comming from many different locations - > http request, from server alone ... and if the app hit an exception and I "forget" to close the connection eventualy the pool will froze -> next time pool.connect will hang... I tried with Future.timeout and it's working but it's hard to choose the right timeout, maybe some solution to sanitaze this problem will be fine, but I have no proposal for now.

Greg Lowe

unread,
Oct 27, 2014, 6:46:55 PM10/27/14
to mi...@dartlang.org
Niranjan sorry for the thread hijack - last comment I promise ;)

> Pisabev

Ah right - sorry didn't recognise your name ;)

Thanks for the feedback. Glad it's working well for you.

> JSON support

Tom Yeh has implemented this in his fork. I haven't merged this yet. But it seems like a good idea.


i think this is the fastest we can get

I'm pretty sure that there is plenty of room for improvement. However it's probably not ever going to be bottleneck unless you're storing huge blobs in the db (which isn't recommended anyway).

> and if the app hit an exception and I "forget" to close the connection eventually the pool will froze

I wonder what the typical solution to this is in other mature database libraries? i.e. JDBC drivers. Probably some sort of inactivity timeout on a connection. Perhaps a first step would be just to log warnings for unclosed connections after a minute or two, so that it's possible to diagnose this before running out of connections in production.

Петър Събев

unread,
Oct 27, 2014, 7:18:31 PM10/27/14
to mi...@dartlang.org
I wonder what the typical solution to this is in other mature database libraries? i.e. JDBC drivers. Probably some sort of inactivity timeout on a connection. Perhaps a first step would be just to log warnings for unclosed connections after a minute or two, so that it's possible to diagnose this before running out of connections in production.

There is a huge pressure on me to fix this, so these days I'll work on it heavily and if I come up with a solution will let you know. Here is an interesting post on stackoverflow -> http://stackoverflow.com/questions/13236160/is-there-a-timeout-for-idle-postgresql-connections. It seems that JDBC drivers can leak connections too, so it should be managed in the app i guess.

Greg Lowe

unread,
Oct 27, 2014, 9:52:27 PM10/27/14
to mi...@dartlang.org

Tom Yeh

unread,
Oct 28, 2014, 12:46:00 AM10/28/14
to mi...@dartlang.org
We developed Quire in Dart for both client and server side. The backend sever is PostgreSQL. If you're interested, you can take a look at Quire: Building a Large Application with Dart.

Hans - Jürgen Alps

unread,
Oct 28, 2014, 5:09:17 AM10/28/14
to mi...@dartlang.org

Fact is that there are currently only a few db drivers available for Dart compared to node.js for example.

--

Greg Lowe

unread,
Oct 28, 2014, 5:32:25 AM10/28/14
to mi...@dartlang.org
Reply all
Reply to author
Forward
0 new messages