![]() The reasons to choose a SQL store for storing the Users table are the following: The reasons for choosing NoSQL for storing the URL table are the following:Ī SQL database such as Postgres or MySQL is used to store the Users table. Figure 9: URL shortener database schema URL table Figure 10: URL shortener Schema of URL table Sample data of URL table Figure 11: URL shortener Sample data of URL table Users table Figure 12: URL shortener Schema of Users table Sample data of Users table Figure 13: URL shortener Sample data of Users table Type of data storeĪ NoSQL data store such as DynamoDB or MongoDB is used to store the URL table. A user might generate multiple short URLs but a short URL is generated only by a single user. The relationship between the Users and the URL tables is 1-to-many. The major entities of the database (data store) are the Users table and the URL table. In other words, the dominant usage pattern is the redirection from short URLs to long URLs. The HTTP PUT method is used because the PUT is idempotent and the idempotency quality resonates with the given requirement of 1-to-1 mapping between the long and short URL. The client executes an HTTP PUT request to the server to shorten a URL. The tradeoffs of RPC are tight coupling and difficulty to debug 4. Once the services have hardened and performance should be tuned further, switch to RPC for internal communications between services. The best practice to expose public APIs is through REST because of loose coupling and easiness to debug 2, 3. The components in the system expose the Application Programming Interface ( API) endpoints through Representational State Transfer ( REST) or Remote Procedure Call ( RPC).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |