We're excited to announce the release of our newest demo. And no, this time it's not a stock-list demo 😉
We switched things up a bit, and the new demo simulates a very simple departures board with a few rows showing real-time flight information to passengers of a hypothetical airport. The data are simulated in the back-end and retrieved from an Amazon DynamoDB data source. In short, we showcase our cool "virtual airport" where you can pretend to take a flight without ever leaving your home!
DynamoDB is a fully managed NoSQL database service offered by Amazon Web Services (AWS).
Unlike traditional relational database management systems, DynamoDB does not use a fixed schema but supports key-value and document data structures. It offers automatic horizontal scaling; this means that the system can automatically handle an increase in workload and data size without any interruption to the user. DynamoDB also offers low latency for read and write operations, making it suitable for applications that require a high level of performance. In addition, DynamoDB supports geographic replication to ensure high availability of data in case of system failures or connectivity issues.
DynamoDB is used in many applications such as games, social media, e-commerce websites, IoT, and many other business applications. You can access DynamoDB through the AWS web interface, SDKs for various programming languages, or through the programming API.
Overall, DynamoDB is a very flexible and scalable solution for high-performance data management and these features make it a data source perfectly compatible with Lightstreamer's Data Adapter. For example, using the AWS SDK for Java to interact with the DynamoDB and retrieve the data. The adapter can then use this data to update the Lightstreamer server, which will, in turn, push the updates to the connected clients.
The Demo Architecture
- A web page using the Lightstreamer Web Client SDK to connect to the Lightstreamer server and subscribe to the flight information items.
- A Lightstreamer server deployed on an AWS EC2 instance alongside the custom metadata and data adapters.
- The adapters use the Java In-Process Adapter SDK and are developed with Kotlin language; in particular the Data Adapter retrieves data from the DynamoDB data source through the AWS SDK for Java.
- Two DynamoDB tables (DemoCurrentTimeData and DemoDeparturesData).
- A simulator, also built with Kotlin language, pushing data into DynamoDB tables.
Client Details
The demo includes the following client-side functionalities:
- A Subscription containing only 1 item and 1 field, subscribed to in MERGE mode, and updates a DynaGrid displaying the simulated current time (oh yes, in this demo, the time runs a little faster than reality).
- A Subscription with a single item subscribed to in COMMAND mode, which updates a DynaGrid displaying the current list and status of the next departing flights based on the simulated time.
Adapters Details
The source code of the adapters is basically divided into two packages:
- server, which implements the Lightstreamer in-process adapters based on the Java In-Process Adapter API . in particular:
DemoDepartureProvider.kt
implements the DataProvider interface for the simulated flight information;DemoDataProvider.kt
implements the DataProvider interface for the current time of the simulation;DemoMetadataProvider.kt
implements the Metadata Adapter for the demo; it is a basic extension of the MetadataProviderAdapter that is the default implementation available with the Java In-Process Adapter library.- demo, which implements the operations with DynamoDB. In particular, the DynamoData.kt class is responsible for reading information from the DynamoDB table and injecting them into the Lightstreamer server.
DemoDepartureProvider.kt
we have this codeThe Simulator
DemoPublisher.kt
.To Recap
- Here you can see the live demo: https://demos.lightstreamer.com/DynamoDBDemo/
- The client-side full source code can be found in this GitHub project: https://github.com/Lightstreamer/Lightstreamer-example-DynamoDB-client-javascript
- The server-side full source code can be found in this GitHub project: https://github.com/Lightstreamer/Lightstreamer-example-DynamoDB-adapter-kotlin
- Here is the official AWS page for DynamoDB: https://aws.amazon.com/dynamodb
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.