Attend this session to learn how to rapidly develop blazingly fast cross-platform big data applications using Sencha and Speedment. Sencha enables developers to leverage the power of modern web technology (for example, HTML5, CSS, and JavaScript) to build universal web applications that can run on desktops, tablets, and smartphones. Speedment, on the other hand, enables developers to rapidly convert their large relational databases into in-memory Java objects (within Java Virtual Machine) that speed up data access by orders of magnitude.
2. 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
3. DEMO
Visualization of stock prices over time as detailed as possible.
Dataset:
•1 chosen stock paper
•8 months of simulated data
•28 800 trades per day
•A total ~4 million SQL rows, indexed on id and date
4. 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.
Databas
e Server Sencha
HTTP
JSON
JDBC
5. FIRST EXAMPLE - SIMPLE SQL
SELECT * FROM `trade`
WHERE `stock` = ?
AND (UNIX_TIMESTAMP(`date`) BETWEEN ? AND ?);
7. 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.
8. SELECT
MIN(`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
9. It takes 20-30 seconds to resolve a single stock
If 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
10. 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());
12. RESULT SPEEDMENT
Really extensive requests are resolved in less than 1 second
Other requests are resolved within milleseconds
The 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.