Thuan Do
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Student Name: Đỗ Hoàng Thuấn Student ID: 20176883 # Distributed system - Chapter 1: Introduction and Architecturesof Distributed Systems ## Question 1: What is the roles of middleware in a distributed system? In a distributed system, the middleware has the role is make application development easier. It provides common programming abstractions, masking the heterogeneity and the distribution of the underlying hardware and OS, hide the low-level programming details. ## Question 2: Explain what is meant by (distribution) transparency, and give examples of different types of transparency Distributed system is the work of hiding some aspects of the system, that make the users think they are using a single system. Appear as single computer system -> transparent Types of transparency - Access: Hide differences in data representation and how a resource asscessed eg. hide the database - Location: Hide where a resouce is located eg. hide the server location, database location - Migration: Hide that a resouce may move to another location eg. hide the migration of server, or hide migration process from one database to another - Relocation: Hide the a resouce may be move to another location while in use - Replication: Hide the a resource is replicated eg. hide the database replication - Concurrency: Hide that a resource may be shared by competitive users - Failure: Hide the failure and recovery of a resource eg. hide the server die, data lost and use backupped data to restore the data. - Persistence: Hide how the persistence work eg. read data from cache instead of database ## Question 3: Why is it sometimes so hard to hide the occurrence and recovery from failures in a distributed system?Question? Because we cannot detect whether a server is acctually down or that it is simply slow in respondind. In reality, it’s impossible to distinguish between a node that has failed, and a very slow network or some other pause (JVM garbage collection pause, or hanging on writing a log file to a slow disk to give two common problems). This means that in practice we have to set some sort of timeout or threshold for non-responsiveness that signals a node is down, whether or not it actually is. Once we get a time-to-wait, we have a user perceivable artifact from a failure. ## Question 4: Why is it not always a good idea to aim at implementing the highest degree of transparency possible? Aiming at the highest degree of transparency may lead to a considerableloss of performance that users are not willing to accept. ## Question 5: What is an open distributed system and what benefits does openness provide? Open distributed system is the distributed system that is design so that it is easy to expand. We can add, place and integrate new components in open system. Benifits: - Expand the system will not interupt the users because of the well designed interfaces in the systems - Quick adapt with requirement change ## Question 6: Describe precisely what is meant by a scalable system. Scalable system is the system that has ability to cope with increased load. The term `load` in this situation means the traffic of server, the size of payload for each requests, eg. ## Question 7: Scalability can be achieved by applying different techniques. What arethese techniques? Some techniques that can be applied to scalable system. - Add more resouce for server - vertical scale - Add more server (microservices) - horizontal scale - Optimize server source code ## Question 8: If a client and a server are placed far apart, we may see network latency dominating overall performance. How can we tackle this problem? Some ways to tackle this problem: - Caching data on the client - i.e. avoiding to make request again if possible. - Segment: Client will combine several request into one, this help reduce the number of requests to server - Compress: Compress the request before it sent, help reduce size of request - Use other protocol (UDP for faster packet sending) - Use CDN (Content delivery networks) for static data ## Question 9: What is a three-tiered client-server architecture? Three-tier architecture is a well-established software application architecture that organizes applications into three logical and physical computing tiers: - Presentation tier or user interface where user interact with the application by mobile app, website or destop app - Application tier, where data is processed - Data tier, where the data associated with the application is stored and managed. Refs: - https://www.ibm.com/cloud/learn/three-tier-architecture ## Question 10: What is the difference between a vertical distribution and a horizontal distribution? - Vertical distribution refers to the distribution of the different layers in a multitiered architecture across multiple machines. - Horizontal distribution deals with the distribution of a single layer across multiple machines, such as distributing a single database. Refs: - https://stackoverflow.com/questions/5845459/what-is-the-vertical-and-horizontal-distribution#:~:text=Vertical%20distribution%20refers%20to%20the,as%20distributing%20a%20single%20database. ## Question 11: In a structured overlay network, messages are routed according to the topology of the overlay. What is an important disadvantage of this approach? When a message is routed, we need to file the shortest path of logical service, but this path may be not the best shortest path in physical. If the topology pre-process the message before it sent, it may create an incompatible between the pre-processing algorithm of the overlay layer and the message ## Question 12: Consider a chain of processes P1 , P2 , ..., P n implementing a multitiered client-server architecture. Process Pi is client of process Pi+1, and Pi will return a reply to Pi−1onlyafter receiving a reply from Pi+1. What are the main problems with this organization when taking a look at the request-reply performance at process P1? - The P1 client need to wait `n - 1` clients, this will cause big latency for P1. - Because of sequetial of dependencies, so if `Pj` clints fail, `P1` will not recive the reply ## Question 13: Considering that a node in CAN knows the coordinates of its immediate neighbors, a reasonable routing policy would be to forward a message to the closest node toward the destination. How good is this policy? ![](https://i.imgur.com/q77fgFt.png) In our example from the given figure. If node (0.2,0.3) follows this policy for the message destined for node (0.9,0.6), it would send it off to node (0.7,0.2). It not the best route because the route (0.2, 0.3) -> (0.7, 0.6) -> (0.9, 0.6) has shorter Euclidean distance. This policy is help to reduce the time of estimating distance. ## Question 14: What are the benefits of Microservices architecture compared to monolithic architecture? Benifits of Microservices architecture compared to monothonic architecture: - **Independent components**: Firstly, all the services can be deployed and updated independently, which gives more flexibility. Secondly, a bug in one microservice has an impact only on a particular service and does not influence the entire application. Also, it is much easier to add new features to a microservice application than a monolithic one. - **Easier understanding**: Split up into smaller and simpler components, a microservice application is easier to understand and manage. You just concentrate on a specific service that is related to a business goal you have. - **Better**: Another advantage of the microservices approach is that each element can be scaled independently. So the entire process is more cost- and time-effective than with monoliths when the whole application has to be scaled even if there is no need in it. In addition, every monolith has limits in terms of scalability, so the more users you acquire, the more problems you have with your monolith. Therefore, many companies, end up rebuilding their monolithic architectures ## Question 15: Design yourself an e-commerce system using Microservices architecture? My e-commerce system architecture contains *4* services: - Product Service: This service provide product's information such as name, price, categories, eg. - Order Service: This service takes care the purchase process including add a product to cart, create an order, create a product delivery. - Product Recommendation Service: This service uses Deep Learning to give most related products for a product. - User Service: Authen user, handle user action such as comment, review a product.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully