Design and implement a a simple ephemeral text message service. You can think of it a little like Snapchat

User Generated

grpxtrrx

Programming

Description

Design and implement a production-grade horizontally scalable service that implements a

simple ephemeral text message service. You can think of it a little like Snapchat. Note that we have

some tests we would like to run against your service so it’s important that the endpoints and

json attributes are named according to spec.

Please include a readme with

  • Instructions on how to compile your service
  • Instructions on how to run your service locally
  • The decisions you made
  • The limitations of your implementation
  • What you would do if you had more time
  • How you would scale it in the future

  • The service has three endpoints for accessing data:


    Unformatted Attachment Preview

    Design and implement a production-grade horizontally scalable service that implements a simple ephemeral text message service. You can think of it a little like Snapchat. , and storage solution you wish. Note that we have some tests we would like to run against your service so it’s important that the endpoints and json attributes are named according to spec. Please include a readme with Instructions on how to compile your service Instructions on how to run your service locally The decisions you made The limitations of your implementation What you would do if you had more time How you would scale it in the future The service has three endpoints for accessing data: POST /chat Creates a new text message for passed in username. Request body properties Name Type Description Required username String The recipient of the message Y n/a text String The content of the message Default Value Y n/a timeout Integer The number of seconds the message should live before expiring Example request body { { "username": "paulrad", "text": "This is a message", "timeout": 60 } } N 60 Response A success response will include: ● a status code of 201 Created ● a body with a JSON object containing the id of the newly-created message, for example: { "id": 5488 } GET /chat/:id Returns the message object for the given id. This service can return both expired and unexpired messages. You can think of this as an admin endpoint. Response A success response will include: ● a JSON response which contains the username, text, and expiration date. Example response body { "username": "paulrad", "text": "This is a message" "expiration_date": "2015-0812 06:22:52" } GET /chats/:username Returns a list of all unexpired texts for the user with the given username. Any texts that are received are then expired and will not show up in subsequent calls to this endpoint. Response A success response will include: ● a JSON array of messages, each of which contains the message's ID and text. Example response body [ { "id": 345, "text": "This is a message" }, { "id": 95958, "text": "This is also a message" } ]
    Purchase answer to see full attachment
    User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

    Explanation & Answer

    Here is the solution, thank you for giving me that opportunity to ...


    Anonymous
    Just what I needed. Studypool is a lifesaver!

    Studypool
    4.7
    Trustpilot
    4.5
    Sitejabber
    4.4

    Related Tags