ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM
Transcript of ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM
![Page 1: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/1.jpg)
SmalltalkSmalltalkProgrammerProgrammer
Ing. Mariano Martínez Peck Ing. Mariano Martínez Peck [email protected]@gmail.com
![Page 2: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/2.jpg)
SqueakDBXSqueakDBX
The complete and The complete and open-source open-source solutionsolution to to
relational database relational database accessaccessMARKETING
MARKETING
![Page 3: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/3.jpg)
SqueakDBX teamSqueakDBX team Hernán Hernán CassinelliCassinelliGermán Germán
PalaciosPalaciosEsteban LorenzanoEsteban LorenzanoMariano Mariano M. PeckM. Peck
![Page 4: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/4.jpg)
F.A.QF.A.Q
Who are we?Who are we?
How did it begin?How did it begin?
What is actually SqueakDBX?What is actually SqueakDBX?
![Page 5: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/5.jpg)
RDBMS VS. OODBRDBMS VS. OODB
Please, don't fight ;)Please, don't fight ;)
![Page 6: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/6.jpg)
Anyway, we rather program in Anyway, we rather program in objects and use RDBMS than objects and use RDBMS than
using Java with RDBMSusing Java with RDBMS;);)
![Page 7: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/7.jpg)
SurveySurvey 1/21/2
How many times were you forced to use a How many times were you forced to use a particular database?particular database?
![Page 8: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/8.jpg)
SurveySurvey 2/22/2Which databases?Which databases?
![Page 9: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/9.jpg)
Squeak's current situationSqueak's current situation
Only MySQL and PostgreSQL native Only MySQL and PostgreSQL native drivers.drivers.
Limited ODBC driverLimited ODBC driver
Glorp in Squeak Glorp in Squeak
only works withonly works with
PostgreSQLPostgreSQL
![Page 10: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/10.jpg)
We are in trouble...We are in trouble...
Direct SQL queries: 20%Direct SQL queries: 20%
Using GLORP: 8.52%Using GLORP: 8.52%
![Page 11: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/11.jpg)
Our goalOur goal
Direct SQL queries: 100%Direct SQL queries: 100%
Using GLORP: 100%Using GLORP: 100%
![Page 12: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/12.jpg)
Our purposeOur purpose
![Page 13: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/13.jpg)
Oracle uses oci.h and libclntsh.Oracle uses oci.h and libclntsh.It has N functions. It has N functions. Examples: OCIHandleAlloc(), OCIServerAttach(), Examples: OCIHandleAlloc(), OCIServerAttach(), OCISessionEnd(), etc.OCISessionEnd(), etc.
MySQL uses mysql.h and libmysqlclient_r.MySQL uses mysql.h and libmysqlclient_r.It has M functions. It has M functions. Examples: mysql_real_connect(), mysql_server_end(),Examples: mysql_real_connect(), mysql_server_end(),mysql_real_query(), etc.mysql_real_query(), etc.
Oracle Oracle clientclient
librarylibrary
MySQL MySQL clientclient
librarylibrary
PosgreSQL PosgreSQL clientclient
librarylibrary
Sqlite Sqlite clientclient
librarylibrary
SQLServer SQLServer clientclient
librarylibrary
OpenDBX architecture OpenDBX architecture
Common APICommon APIfor all backends!!!for all backends!!!
Oracle Oracle clientclient
librarylibrary
Oracle Oracle clientclient
librarylibrary
MySQL MySQL clientclient
librarylibrary
MySQL MySQL clientclient
librarylibrary
PosgreSQL PosgreSQL clientclient
librarylibrary
PosgreSQL PosgreSQL clientclient
librarylibrary
Sqlite Sqlite clientclient
librarylibrary
Sqlite Sqlite clientclient
librarylibrary
SQLServer SQLServer clientclient
librarylibrary
SQLServer SQLServer clientclient
librarylibrary
![Page 14: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/14.jpg)
Why OpenDBX?Why OpenDBX?
It is fast It is fast
Simple to useSimple to use
FlexibleFlexible
Cross platform Cross platform
AsynchronoAsynchronous queriesus queries
Specific RDBMS featuresSpecific RDBMS features
Good documentationGood documentation
![Page 15: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/15.jpg)
PC2PC2PC1PC1
DatabaseDatabaseSqueak imageSqueak imageSqueak imageSqueak imageSqueak imageSqueak image
OpenDBXOpenDBXOpenDBXOpenDBX
DatabaseDatabaseClient LibraryClient Library
DatabaseDatabaseClient LibraryClient Library
Deployment and infrastructureDeployment and infrastructure
![Page 16: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/16.jpg)
||
#include <stdio.h>#include <stdio.h>static int mysql_odbx_get_option( odbx_t*)static int mysql_odbx_get_option( odbx_t*)
switch( option )switch( option )..........
#include <stdio.h>#include <stdio.h>static int mysql_odbx_get_option( odbx_t*)static int mysql_odbx_get_option( odbx_t*)
switch( option )switch( option )..........
Squeak imageSqueak image
OpenDBXOpenDBX
Smalltalk and CSmalltalk and C
![Page 17: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/17.jpg)
Smalltalk-C ConnectorSmalltalk-C Connector
FFI (Foreign Function Interface)FFI (Foreign Function Interface)
Main problem: Locks the entire VMMain problem: Locks the entire VM
![Page 18: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/18.jpg)
Squeak ODBC driver queriesSqueak ODBC driver queries
VM lockedVM lockedtimetime
![Page 19: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/19.jpg)
OpenDBX ConnectorOpenDBX Connector
FFI (Foreign Function Interface)FFI (Foreign Function Interface)
Main problem: Locks the entire VMMain problem: Locks the entire VM
Our solution: Our solution: ✔ Asynchronous queries✔ “Mini” VM locks✔ Retry schema✔ DBXQuerySettings>>timeout:
![Page 20: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/20.jpg)
SqueakDBX queriesSqueakDBX queries
VM lockedVM lockedtimetime
![Page 21: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/21.jpg)
Database access in SmalltalkDatabase access in Smalltalk
SqueakDBXSqueakDBX✔ One for all databasesOne for all databases
✔ Less time and effortLess time and effort
✔ Good performaceGood performace
✔ OSS and proprietaryOSS and proprietary
✗ Difficult to debugDifficult to debug
✗ Platform dependentPlatform dependent
✗ FFI locks the VMFFI locks the VM
Smalltalk driverSmalltalk driver✗ One for each databaseOne for each database
✗ More time and effortMore time and effort
✗ Performance issues?Performance issues?
✗ Only OSSOnly OSS
✔ Easier to debugEasier to debug
✔ Platform independentPlatform independent
✔ Non-lockingNon-locking
![Page 22: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/22.jpg)
SqueakDBX designSqueakDBX design
SqueakDBX Structure (API)SqueakDBX Structure (API)SqueakDBX Structure (API)SqueakDBX Structure (API)
SqueakDBX PlatformSqueakDBX PlatformSqueakDBX PlatformSqueakDBX Platform
OpenDBX ConnectorOpenDBX ConnectorOpenDBX ConnectorOpenDBX Connector
FFIFFIFFIFFI SqueakDBXPluginSqueakDBXPluginSqueakDBXPluginSqueakDBXPlugin
OpenDBXOpenDBX
{{DBXConnectionDBXConnectionDBXConnectionSettingsDBXConnectionSettingsDBXResultSetDBXResultSetDBXResultDBXResultDBXRowDBXRow......{{DBXPlatformDBXPlatformDBXSpecialOptionsDBXSpecialOptionsDBXErrorSeverityDBXErrorSeverityDBXTimeSpecDBXTimeSpec......
![Page 23: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/23.jpg)
ShowtimeShowtime
![Page 24: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/24.jpg)
Who can use SqueakDBX?Who can use SqueakDBX?
An applicationAn application
GlorpGlorp
Magritte-RDBMagritte-RDB
SqueakSaveSqueakSave
MoeMoe
![Page 25: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/25.jpg)
Current backends and OSCurrent backends and OS
![Page 26: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/26.jpg)
Benchmark for PostgreSQLBenchmark for PostgreSQL
InsertConverted Insert
Select100Select1000
0
200
400
600
800
1000
1200
1400
1600
1800
SqueakDBXNative
tests
ms
![Page 27: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/27.jpg)
Benchmark for MySQLBenchmark for MySQL
InsertConverted Insert
Select100Select1000
0
100
200
300
400
500
600
700
SqueakDBXNative
tests
ms
![Page 28: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/28.jpg)
FeaturesFeatures
Mini VM locksMini VM locks
SqueakDBXPluginSqueakDBXPlugin
Automatic fields conversionAutomatic fields conversion
Configurable logging/traceConfigurable logging/trace
Special RDBMS featuresSpecial RDBMS features
MultistatementsMultistatements
Automatic release of resourcesAutomatic release of resources
![Page 29: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/29.jpg)
What do we have?What do we have?
Enough unit testsEnough unit tests
Acceptable test coverageAcceptable test coverage
SmallLint runsSmallLint runs
Good enough designGood enough design
GLORP integrationGLORP integration
![Page 30: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/30.jpg)
DocumentationDocumentation
WebsiteWebsite
Documented codeDocumented code
Mailing listMailing list
BenchmarksBenchmarks
![Page 31: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/31.jpg)
What will comeWhat will come
Complete Glorp refactor and integrationComplete Glorp refactor and integration
More backends in more OSMore backends in more OS
Large objects supportLarge objects support
Better SPs and functions supportBetter SPs and functions support
Continue with SqueakDBXPluginContinue with SqueakDBXPlugin
Try Alien FFITry Alien FFI
Port to Smalltalk/X ?Port to Smalltalk/X ?
![Page 32: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/32.jpg)
Glorp progress Glorp progress
Port from Squeak to PharoPort from Squeak to Pharo
First refactor to SqueakDatabaseAccesorFirst refactor to SqueakDatabaseAccesor
Driver for native driverDriver for native driver
Driver for SqueakDBX (PostgreSQL)Driver for SqueakDBX (PostgreSQL)
![Page 33: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/33.jpg)
Glorp before SqueakDBXGlorp before SqueakDBX
![Page 34: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/34.jpg)
Glorp after SqueakDBXGlorp after SqueakDBX
![Page 35: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/35.jpg)
Special thanks to...Special thanks to...
Norbert SendetzkyNorbert Sendetzky
GLORPGLORP Alan KnightAlan Knight
Stéphane DucasseStéphane Ducasse
![Page 36: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/36.jpg)
aConnection execute: 'select * from questionsaConnection execute: 'select * from questionswhere has_answer = true'where has_answer = true'
Ing. Mariano Martínez Peck Ing. Mariano Martínez Peck [email protected]@gmail.com
![Page 37: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/37.jpg)
Thank you Thank you very muchvery much
![Page 38: ESUGAuthor Mariano Peck Created Date 9/2/2009 8:33:48 PM](https://reader035.fdocuments.in/reader035/viewer/2022071516/6139ce800051793c8c00b032/html5/thumbnails/38.jpg)