1

Me and my team are implementing a product based on microservices architecture(every microservice has it's own data storage). We already have a couple of services deployed on AWS and we need to add an ability to save user preferences like:

  1. Saved filters to query data
  2. UI widget settings
  3. Columns order
  4. etc

I think that we have the following options to implement saving user-preferences in my case:

  1. Extend user profile(it is used to store companies and users, roles) service and add new items there
  2. Create new microservice for keeping only user preferences
  3. Use some of AWS services for that(I am still checking what is the best)

What we use for security:

  • AWS Cognito
  • SAML IDP
  • JWT tokens

We also have user-profile microservice(I mentioned earlier). It contains data received from other products like admin service.

What do you think? What is the best option for my case?

Anuar Nurmakanov
  • 369
  • 8
  • 18
  • 1
    What is the nature of your application, is it multi-tenant or single tenant? When you say user profile, where do you store it currently? Also the configurations you have mentioned in points, it seems like they will have a finite size of data right? – Ashan Oct 17 '17 at 03:59
  • In addition to Ashan's questions, what are you using for authentication and authorization? For your user specific data, look into DynamoDB. Cognito User Pools for authentication. Cognito Federated Identities for authorization and Cognito Sync to store and synchronize user data across devices. – John Hanley Oct 17 '17 at 04:13
  • I edited the post and added information about security. – Anuar Nurmakanov Oct 17 '17 at 05:00
  • You can store custom attributes per user in Cognito. This is a convenient place to put them because you have to read the Cognito user record at auth time so you can cache and use the attributes. Alternatively, save them to DynamoDB. – jarmod Oct 17 '17 at 12:43

1 Answers1

1

You can use custom attributes (as suggested by @jarmod) if you only use Cognito userpools. But if you use other providers like Microsoft ADFS, Google, Facebook etc., you could look into Cognito Sync. Although Cognito Userpools now support some external providers, it may not be suited for your use case. So, you could integrate various Auth providers (including Userpool) in an Identity pool and use Cognito sync datasets to store preferences. In fact, that is the whole point of Sync, to provide cross device access to small datasets like user-preferences. This way if a user logs in with Userpool & later with Facebook, you could give an option to link both accounts in your application & merge the user preferences. It all depends on your use-case.

agent420
  • 3,291
  • 20
  • 27