Code Monkey home page Code Monkey logo

microservices-basics's Introduction

Microservices-basics

what is a microservice?

In a monolithic server, contains routing middlewares,business logic and database access to implement all features of our app. Eg: req-> authmiddleware->router->all feature controllers -> database

In a Micro server, contains routing middlewares,business logic and database access to implement ONE features of our app. Eg: req-> authmiddleware->router->one feature controller -> its own database

challenges

1 Data management between services

with microservices, we store and access data in sort of starnge way

  • how we store data
  • how we access it rules:-
  • each service gets its own database
  • services will never ever reach into another services database

why database-per-service

  • we want each service to run independently of other services
  • Database schema/structure might change unexpectedly
  • some services might function more efficiently with different types of DB's(SQL vs noSQL)

communication between services

Sync - services communicate with each other using direct requests Async - services communicate with each other using events

create an example Blogs Project

  181  cd Documents/CODEBASE/Microservices/
  182  mkdir blog
  183  cd blog
  184  npx create-react-app client
  185  mkdir posts
  186  cd posts/
  187  npm init -y
  188  npm i express cors axios nodemon
  189  cd ..
  190  ls
  191  mkdir comments
  192. cd comments
  192  npm init -y
  193  npm i axios cors express nodemon

microservices-basics's People

Contributors

venkatachadalawada avatar

Watchers

James Cloos avatar  avatar

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.