Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Microservices Data Management (Databases / Query / Commands)

Pragya Keshap answered on March 1, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • How to choose a database for MIcroservices
  • Data per microservice
  • Microservices Data Management Patterns
  • Microservices Data Management - Choosing Right Database
  • Microservices Data Management - Main Topics
  • How to Choose a Database for Microservices ? (Question Set) - 2
  • Scale Database in Microservices
  • Microservices Data Query Pattern and Best Practices
  • What are some potential problems with using relational databases in microservices ?
  • When to use Relational Databases in microservices ?
  • Microservices Data Management (Databases / Query / Commands / Distributed Transactions)
  • How to handle service communication and data sharing in a Microservices architecture?
  • Database per Microservice Pattern
  • Other Database services
  • We can Design our Ordering microservices databases

  • Microservices Data Management (Databases / Query / Commands)

    0

    Keep each microservice’s persistent data private to that service and accessible only via its API. A service’s transactions only involve its database.

    The following diagram shows the structure of this pattern.

    The service’s database is effectively part of the implementation of that service. It cannot be accessed directly by other services.

    There are a few different ways to keep a service’s persistent data private. You do not need to provision a database server for each service. For example, if you are using a relational database then the options are:

    Private-tables-per-service – each service owns a set of tables that must only be accessed by that service

    Schema-per-service – each service has a database schema that’s private to that service

    Database-server-per-service – each service has it’s own database server.

    Private-tables-per-service and schema-per-service have the lowest overhead. Using a schema per service is appealing since it makes ownership clearer. Some high throughput services might need their own database server.

    It is a good idea to create barriers that enforce this modularity. You could, for example, assign a different database user id to each service and use a database access control mechanism such as grants. Without some kind of barrier to enforce encapsulation, developers will always be tempted to bypass a service’s API and access it’s data directly.

    Example

    The FTGO application is an example of an application that uses this approach. Each service has database credentials that only grant it access its own (logical) database on a shared MySQL server. For more information, see this blog post.

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Mar 01 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.