Speedment & Sencha at Oracle Open World 2015

16
SENCHA AND SPEEDMENT DEMO

Transcript of Speedment & Sencha at Oracle Open World 2015

PowerPoint-presentation

Sencha and Speedment demo

1

problem Core Enterprise Applications need modernisation The amount of data is increasing every day Enterprise databases are growing big Long response times is the most common IT problem at work

DEMOVisualization of stock prices over time as detailed as possible.

Dataset: 1 chosen stock paper8 months of simulated data28 800 trades per dayA total ~4 million SQL rows, indexed on id and date

First example - Simple SQL

A basic java http server receives a request from the Sencha app. The java program formulates an SQL query to download all matching rows from the database and parses the data into a JSON response.

DatabaseServerSencha

HTTPJSON

JDBC

First example - Simple SQL

SELECT * FROM `trade` WHERE `stock` = ? AND (UNIX_TIMESTAMP(`date`) BETWEEN ? AND ?);

Result- Simple SQL

java.lang.OutOfMemoryError since parsing 4 million rows into a string requires far too much memory

Second example - Advanced SQL

The java http server receives a request from the Sencha app. The java program formulates a more distinct query that calculates a series of average prices for a particular timespan. The result is then parsed into a JSON response.

SELECTMIN(`date`) AS `start`,MAX(`date`) AS `end`,ROUND(AVG(`value`)) AS `average`,MAX(`value`) AS `high`,MIN(`value`) AS `low`FROM `trade`WHERE `stock` = ?AND (UNIX_TIMESTAMP(`date`) BETWEEN ? AND ?)GROUP BY (CASE ?

WHEN '1' THEN YEAR(`date`)WHEN '2' THEN CONCAT(YEAR(`date`), MONTH(`date`))WHEN '3' THEN CONCAT(YEAR(`date`), MONTH(`date`), DAY(`date`))WHEN '4' THEN CONCAT(YEAR(`date`), MONTH(`date`), DAY(`date`), HOUR(`date`))WHEN '5' THEN CONCAT(YEAR(`date`), MONTH(`date`), DAY(`date`), HOUR(`date`), MINUTE(`date`))WHEN '6' THEN CONCAT(YEAR(`date`), MONTH(`date`), DAY(`date`), HOUR(`date`), MINUTE(`date`), SECOND(`date`))END) ORDER BY `date`;

Second example - Advanced SQL

It takes 20-30 seconds to resolve a single stockIf there were more than one stock, the request would be even slower.

Capacity: Is sometimes limited by I/O and a single request may virtually block the entire database during a call.

Result- Advanced SQL

Third example Speedment

The dataset is kept in-memory with all relations intact. When the server receives a request, a subset of the data is picked and transformed into a JSON response.

return TradeMgr.getInstance().interval(stock, from, to).groupBy(lod.grouper()).mapValue(list -> StockPrices.from(list, layer)).sorted().values().collect(toList());

Third example Speedment

Result SpeedmentReally extensive requests are resolved in less than 1 secondOther requests are resolved within millesecondsThe number of stocks available is irrelevant as long as the server has enough memory. The solution is Type-Safe and easy to debug.

Capacity: Scales linearly with the number of threads on the server. The more CPU:s the more capacity.

True Example

JVMUnique technology

Copy

Relational DatabasePatent Pending

THANK YOU!

Carina Dreifeldt CEOPer Minborg CTO