Git Product home page Git Product logo

myretailapp's Introduction

MyRetailApp

Technical stack used:

  1. Java
  2. Cassandra
  3. Spring-boot
  4. Kafka
prerequisites:

Cassandra should be installed in the machine, listed with the below configuration.

CREATE KEYSPACE myretailapp
  WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };
  
CREATE TABLE myretailapp.price (
productid text,
price text,
currency text,
PRIMARY KEY (productid)
);  

insert into myretailapp.price(productid, price, currency) values ('13860428', '50', 'USD');

cqlsh:myretailapp> select * from myretailapp.price;

productid | currency | price
-----------+----------+-------
 13860428 |      USD |   50

(1 rows)

cqlsh:myretailapp> select * from myretailapp.price;

Recommendations

  1. Use of Spring cloud, Eureka server will provide load balancing which decreases the latency and improves fault-tolerance.
    1. To implement this Start a Eureka Server instance.
    2. Register multiple instances of the redsky.
    3. Enable Eureka client discovery in client application (MyRetailApp), based on the availability zone client application will contact one of the instances of redsky application.
  2. Use Kafka for storing updates for price. So that the downstream application will be notified. This encourages the event driven architecture.

Event drived version of the existing services.

Enhance the application with the event based architecture

Ex: Once an update is made on the product price, the series of events should be triggered and store the messages to KAFKA. And the downstream applications such as inventory or stock services will get this update by listening to kafka. With this design, microservices will be better communicated independently in a decouple way.

More Enhanced Version.

Post Request

Post request on updating the price. Updating the price to 53

UpdateRequest.

Post request Successfully updated the price to 53.

UpdateRequest_SuccessFul.

Price update is sent to Kafka.

UpdateRequestStoredToKafka.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.