Pony ORM and a micro-service architecture

Viewed 291

We have a monolithic application built with a Flask/Pony framework. It works great right now.

However, in the near future we are going to start shifting to a micro-service architecture. In this process, we are going to most likely have a separate Db for each service. For a number of reasons that I wont go into, this is beneficial. But i get hung up, and I know many others do too, when thinking about the foreign key relationships developed between tables at the moment.

People have solved this by denormalizing their db's ending up with duplicated tables in another service's DB.

Im curious what the users of pony think of this solution and if its feasible.

And what have others using PonyORM, or any other ORM for that matter, come up with when using a micro service architecture?

Edit:

Our database right now is simplistically:

Main DB
User
|-id
|-name
|-role = Required("Role")
Role
|-id
|-name
|-set("User")

Now this is all in one Db but the logic is within two different services. User service and role service. The role service controls authorizations and views allowed that the user is allowed to access.

Ideally, I would like to split these into separate Db's, but still be able to keep the relationship between the two. I don't think that it can be done through a natural sql query/index (or can it?).

1 Answers
Related