DEV Community

SPL Open Source Community
SPL Open Source Community

Posted on

The Open-source SPL Boosts MongoDB Computing Ability

MongoDB is a typical NoSQL database. Its document-oriented structure makes both storage and access convenient and efficient. But the database has rather weak computing ability. Computations on MongoDB data, particularly complex ones, are hard to handle. A data computing engine having powerful computing capability is needed to work with MongoDB to achieve relevant computing tasks.

The open-source esProc SPL is a specialized structured data computation engine. It supplies rich class libraries and all-around, database-independent computational capabilities. SPL has an independent procedural syntax that is particularly good at handling complex computations. It can help MongoDB increase its ability to compute, accomplish grouping & aggregation, joins, subqueries, and all the other computing tasks effortlessly.

Regular queries
It is easy to achieve JOINs MongoDB finds it difficult to handle in SPL:


SPL can reuse the result of handling data of a table that is repeatedly involved in computations:


Perform IN conditional query in SPL:


SPL’s technique to turn foreign key values to objects – the object-referencing foreign key – creates efficient foreign key pointers:

SPL achieves APPLY algorithm in a simple way:


SPL’s way of performing set-oriented calculations – intersection, union, difference and concatenation:


Get sequence number of a member in a sequence in SPL:


Perform intersection of multi-member collections in SPL:

Complex queries
Getting TopN in SPL:


Summarize a nested-structure collection in SPL:


Combine subdocuments made up of multiple attributes in SPL:


Query nested List subdocument in SPL:


SPL Cross-sector aggregation:


SPL segment-based grouping:


Data writing
Export data as CSV in SPL:


SPL database update (from MongoDB to MySQL):


SPL database update (from MySQL to MongoDB):


Mixed computations
SPL enables convenient mixed computation between MongoDB and another data source:


SQL support
Besides the native syntax, SPL offers support of SQL92 standard. You can use SQL to query MongoDB. To achieve the above join operation, for instance:


Integration into application
SPL provides standard JDBC/ODBC drivers through which SPL can be conveniently integrated into an application or invoked by it. To invoke SPL code through JDBC, for instance:

…
Class.forName("com.esproc.jdbc.InternalDriver");

Connection conn = DriverManager.getConnection("jdbc:esproc:local://");

PrepareStatement st=con.prepareStatement("call splScript(?)"); // splScript is the name of SPL script file

st.setObject(1,"California");

st.execute();

ResultSet rs = st.getResultSet();
…

Enter fullscreen mode Exit fullscreen mode

With all those functionalities, you’ll sure to be impressed by MongoDB’s strikingly boosted computing ability. Try your hand now.

SPL source code

Top comments (0)