Databases for Pharo that do not use FFI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Databases for Pharo that do not use FFI

vinref
Hello

I have been tinkering with Pharo long enough now to contemplate writing a "serious" applications with it. An important consideration is databases. I have been looking at SQLite but realise since it works through FFI it probably blocks the VM whilst processing a query. Is this correct?

VoyageMongo looks interesting. PostgreSQL is supported too. Do either of
these work through FFI?

Many thanks in advance.

Reply | Threaded
Open this post in threaded view
|

Re: Databases for Pharo that do not use FFI

Mariano Martinez Peck



On Sat, Aug 10, 2013 at 10:44 AM, <[hidden email]> wrote:
Hello

I have been tinkering with Pharo long enough now to contemplate writing a "serious" applications with it. An important consideration is databases. I have been looking at SQLite but realise since it works through FFI it probably blocks the VM whilst processing a query. Is this correct?

Yes. 
 

VoyageMongo looks interesting. PostgreSQL is supported too. Do either of
these work through FFI?


Both Mongo and PostgreSQL Native Driver (implemented in Smalltalk), end up using sockets (no FFI), so from what I know, they do not lock the whole VM as with FFI. 

OpenDBXDriver uses OpenDBX library (using FFI) but at least OpenDBX supports async queries when the database backend supports them. That means that from Pharo we do a kind of busy waiting allowing other processes to be executed. But if the backend doesn't support async queries, then yes, OpenDBX will lock the Pharo VM while the query is being processed.

I can give more details about this busy waiting in DBXTalk if you want. 

Cheers,   
 
Many thanks in advance.




--
Mariano
http://marianopeck.wordpress.com
Reply | Threaded
Open this post in threaded view
|

Re: Databases for Pharo that do not use FFI

Stéphane Ducasse
In reply to this post by vinref

> Hello
>
> I have been tinkering with Pharo long enough now to contemplate writing a "serious" applications with it. An important consideration is databases.

Esteban will start to work on the threaded vm with eliot for such typical case.

> I have been looking at SQLite but realise since it works through FFI it probably blocks the VM whilst processing a query. Is this correct?
>
> VoyageMongo looks interesting. PostgreSQL is supported too. Do either of
> these work through FFI?
>
> Many thanks in advance.
>


Reply | Threaded
Open this post in threaded view
|

Re: Databases for Pharo that do not use FFI

Mariano Martinez Peck



On Sat, Aug 10, 2013 at 12:46 PM, Stéphane Ducasse <[hidden email]> wrote:

> Hello
>
> I have been tinkering with Pharo long enough now to contemplate writing a "serious" applications with it. An important consideration is databases.

Esteban will start to work on the threaded vm with eliot for such typical case.


That would be great. There are some big players like Oracle whose library does not support async queries :(
 
> I have been looking at SQLite but realise since it works through FFI it probably blocks the VM whilst processing a query. Is this correct?
>
> VoyageMongo looks interesting. PostgreSQL is supported too. Do either of
> these work through FFI?
>
> Many thanks in advance.
>





--
Mariano
http://marianopeck.wordpress.com
Reply | Threaded
Open this post in threaded view
|

Re: Databases for Pharo that do not use FFI

Dale Henrichs-3
In reply to this post by vinref
GemStone's GCI library uses FFI, but the GCI layer has an option to make non-blocking FFI calls (you end up polling for response) so the vm is free to spin away while polling ... unfortunately, the current GCI API is also single threaded (we're planning to change this in an upcoming release) so you can make only one concurrent non-blocking call.

Dale

----- Original Message -----
| From: [hidden email]
| To: [hidden email]
| Sent: Saturday, August 10, 2013 6:44:06 AM
| Subject: [Pharo-users] Databases for Pharo that do not use FFI
|
| Hello
|
| I have been tinkering with Pharo long enough now to contemplate
| writing a "serious" applications with it. An important consideration
| is databases. I have been looking at SQLite but realise since it
| works through FFI it probably blocks the VM whilst processing a
| query. Is this correct?
|
| VoyageMongo looks interesting. PostgreSQL is supported too. Do either
| of
| these work through FFI?
|
| Many thanks in advance.
|
|

Reply | Threaded
Open this post in threaded view
|

Re: Databases for Pharo that do not use FFI

Pierce Ng-3
In reply to this post by vinref
On Sat, Aug 10, 2013 at 11:44:06PM +1000, [hidden email] wrote:
> VoyageMongo looks interesting. PostgreSQL is supported too. Do either of
> these work through FFI?

On SqueakSource, PostgresV2, PostgresV3, MySQL and StdbCore (for MySQL) are
pure Smalltalk implementations of the respective wire protocols.


--
Pierce Ng
http://samadhiweb.com/blog/