Skip to content
This repository has been archived by the owner on Nov 18, 2019. It is now read-only.

Decide on how to handle persistent state #8

Closed
DanielFroehlich opened this issue Apr 4, 2019 · 3 comments
Closed

Decide on how to handle persistent state #8

DanielFroehlich opened this issue Apr 4, 2019 · 3 comments

Comments

@DanielFroehlich
Copy link
Collaborator

In the long term, we will need to decide on how/where we persist states (Playlists, Auth Tokens).

@DanielFroehlich
Copy link
Collaborator Author

DanielFroehlich commented Apr 4, 2019

I know by theory every microservice can decide on its own. But for the sake of maintainability, I suggest we agree on a preferred idea.

Options I see:
#1: JSON File on RWX PersistentVolume

  • easy to implement
  • changes can be easily propagted between pods by obersving the file and re-loading it.
  • easy to debug / fix / change schema (simply look into the file)
  • requires RWX PVC which is not always available (esp. in pub cloud)

#2: In Memory DataBase
Use some in memory databases like redis, datagrid etc.

  • no disk needed
  • lightnig fast
  • changes can be subscribed to
  • complex to deploy / monitor /operate/debug - skills required

#3: Use Database on Platform
Use a database like mongo/psql with corresponding operator

  • can work with RWO Storage
  • more familiar stuff
  • if singleton database (PSQL) could be a single point of failure
    (would we use one central or each service with state its own isntance?)

#4: Use external Database as a Service
(I have no expierence with that and cant assess)

#5: Use Event Stream Database
Deploy AMQ Streams. Each service can emit events on it own topic to store data

  • Real Cloud Native Design
  • new red hat technology (AMQ Streams)
  • works with rwo (probably, need to verify)
  • new technology for most hackers

Please comment!

@wrichter
Copy link
Contributor

wrichter commented Apr 4, 2019

Maybe once we have the user stories more fleshed out we have a better common understanding what the actual technical requirements could be. That being said:

#1 feels too low level for me (or: why stop at a file system? Can't we write sectors to a raw device? ;-)
#2 I would think we still need to be able to persist state to non-volatile memory. Also databases like MongoDB allow to subscribe to changes, so that isn't exclusive to in-memory caches.
#3 is most familiar and at this point not identified to be the bottleneck. Also a nice showcase to show the greatness of Operators, etc... to set this up in an HA fashion.
#4 I don't like, since any managed service is outside of the technology domain we offer (but we aspire to offer the same quality, see #3)
#5 I do like, but primarily as an pub/sub for events. For persistence, it seems like overkill to go full CQRS for such a simple app - this would probably drag us down in development.

@DanielFroehlich
Copy link
Collaborator Author

I vote for a combination of Option 5 (Kafka) and Option 3 (database):

  1. We use Kafka Event as persitence layer as long as possible.
  2. If Kafka is not suited we use a MongoDB deployed. The deployment is shared by all services, but each service has it's on service. This simplifiies deployment a bit. MongoDB instead of PSQL, because it horizontally scales and does exhibit a single point of failure.

DanielFroehlich added a commit that referenced this issue Jun 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants