1

As the title says, simple question... When to use pyodbc and when to use jaydebeapi in Python 2/3?

Let me elaborate with a couple of example scenarios...

  1. If I were a solution architect and am looking at a Pyramid Web Server looking to access multiple RDBMS types (HSQLDB, Maria, Oracle, etc) with the expectation of heavy to massive concurrency and need for performance in latency in a monolithic web server, which paradigm would be chosen? And why?

  2. If I were to implement an Enterprise Microservice solution (a.k.a. the new SOA) with each microservice accessing specific targeted RDBMS but with heavy load and perfomance latency requirements each, which paradigm would be chosen? And why?

Traditionally JDBCs performed significantly better in large Enterprise solutions requiring good concurrency. Are the same idiosyncracies prevalent in Python ? Is there another way besides the two mentioned above?

I am new to Python so please be patient if my question doesn't make sense and I'll attempt to elaborate further. It is best to think about my question from a high-level solution design then going from the ground up as a developer. What would you mandate as the paradigm if you were the sol-architect?

DanglingPointer
  • 891
  • 1
  • 5
  • 12
  • This question could profit from more detail, to harvest more specific answers. Cf. my answer if it already suits your problem at hand, else please comment on the answer or if the question needs more amending, edit your question. Ok? – Dilettant Jun 13 '16 at 15:03
  • Well I've edited the question 2 days ago... – DanglingPointer Jun 22 '16 at 12:24

1 Answers1

2

Simple answer - until more details given in question:

In case you want to speak ODBC with the database: Go with pyodbc or for a pure python solution with pypyodbc

Else if you want to talk JDBC with the database try jaydebeapi

This should depend mor on the channel you want to use between python and the database and less on the version of python you are using.

Dilettant
  • 3,267
  • 3
  • 29
  • 29
  • I have never used both. I'm new to both of them. Do both have the same idiosyncracies of ODBC vs JDBC? For example, will pyodbc work outside of Windows? What about thread safety? How about scaling with load? Which one performs better when scaling from small to lets say queries of hundreds of thousands and massive concurrency? – DanglingPointer Jun 13 '16 at 15:12
  • 1
    ODBC - Open Data Base Connectivity has nothing to do with a specific platform. It may be wide spread in Windows, but I for one use it every day on OS X and misc. Linux distributions to talk from my python codes to databases - and they answer ;-) As the name states py*odbc implement the ODBC interface in python - pyodbc reyling on a system library and pypyodbc as pure python solution. The jaydebeapi supports a completely different interface and does so very differently (I think it builds on JPype as there is no jdbc system library) ... I usually build my own python db api v2 to jdbc bridge ;-) – Dilettant Jun 13 '16 at 15:19
  • How about when it comes to concurrency? Scaling with load? – DanglingPointer Jun 14 '16 at 09:04