1

We're building a database of cars and their properties, supposed to be stored in a DynamoDB.

Creating a cars table and filling it with objects that has properties like brand, model, year etc is easy.

But we also want a few other features en the admin interface:

Suggestions when typing

When creating a car, it should suggest brand and model from existing cars, when typing in the field.

Should we then maintain a list of brands and models in another table, and make a query to that table, when the user types?

Or is it good enough to query the "rich" table of car definitions, and get all values for brand, all model values where brand has a certain value, etc? My first thought is that it would be a heavy operation and we'd want a separate index of cars and models. But I'm not a NoSQL expert...

Best matches

When enrolling a new car in our system we want to use use an existing defined car as a reference if possible.

So when the user has typed in a brand, model, year etc we want to show a few options of the best matches - we can accept that they year etc. is different, but want the best matches first.

What is the best way to do matches like this on data in a NoSQL database? Any links to tools, concepts etc. will be appreciated :)

Thanks in advance

Esben von Buchwald
  • 2,772
  • 1
  • 29
  • 37

1 Answers1

2

In dynamodb (all nosql), the less you create tables the best is your architecture (this is one of the main reason we use nosql), so no need of a new table, just add a new attribute and fill it with the searchable data you want, just have in mind that querying by dynamodb is case sensitive and you only can use the begins_with or the contains function to query data

The cons are :

  1. You will use lot of reading capacity unit
  2. You have to manage the capital letters
  3. You have to fabric at each creation the searchable attribute

The solution I suggest is using aws cloudsearch, which gives an out of the boxes suggester, you will will have better results and give a better user experience, the indexation in cloudsearch is automatic each time you have a new item, but be aware of the pricing, however they will give you 30 day for free

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Sid Ali
  • 1,779
  • 4
  • 17
  • 38
  • Yes I can see that cloudsearch use an EC2 instance - we wanted to avoid having servers at all, and have done well so far. But it's only 5$/month... Anyway, the mentioned system will only be used by administrative staff, and will (in the beginning) have only a few lookups etc. a day, so the extended usage of dynamo shouldn't be a problem, I think? But I don't want to waste a lot of time implementing an inefficient solution if it's faster/easier to implement with cloudsearch or elasticsearch. I wonder why AWS don't offer this as a "pay per use" service instead of EC2? – Esben von Buchwald Jul 19 '18 at 19:12
  • Yep, as you said, more efficient faster, and cost less time to deploy, but a little bit expensive, so it's up to you – Sid Ali Jul 19 '18 at 20:31