Best way to store a blog post in DynamoDB? - database

I'm creating a blog section for a website with Amazon Web Services. I'm comparing database solutions, and I came across DynamoDB. I'd like to know if it'd be a good idea to use DynamoDB for storing a blog post of more than 1500 words (6KB approximately). Should I save the article as a file onto the S3 instead, and store its link on my DynamoDB database? What is the right way of implementation?
Thanks in advance

DynamoDB is a key-value, NoSQL database that delivers single-digit millisecond performance at scale. It is a fully managed durable database with built-in security, backup and restore, and in-memory caching for internet-scale applications. More information here.
You can certainly use DynamoDB to build a blog application. You would need to model your data and depending upon the language that you use, you can use a DynamoDB mapper. For example, if you built you application by using the Spring Framework, you can use the Enchanced Client.
Assuming you did build with Spring Framework - you could build it very similar to this tutorial and by replacing the relational database with DynamoDB. Using DynamoDB as opposed to reading a file stored in Amazon S3 in my view is the better way to proceed here.

Related

Pros/Cons of incorporating multiple database types into same project

I'm beginning to pursue my first online project that I am planning will need to scale as such I have opted for a NoSQL DB. Some reading into this and modeling of what my queries would look like and there are two databases I am considering. Cassandra seems like the right choice for item lookups by keyword but MongoDB sounds like the right choice for initially entering the data in as it can retain the account structure in document form.
This split decision has left me wondering: Are there any major companies that use multiple database types for storage of different items as in using both Cassandra and Mongo together?
I would think scaling up would be more difficult but are the added benefits (if there are any) worth the trouble? I'm not the expert on this. I'm hoping you are. Thanks in advance for sharing your experience.
Cassandra can handle both use cases so you can use the same database for your purposes.
Stargate (https://stargate.io/) is an open-source API platform which provides a data gateway to Cassandra with REST API, GraphQL API, Document API and even native CQL access.
The Document API lets you save and search schemaless JSON documents to/from Cassandra directly from your app.
You can try it out for free on Astra with no credit card required. In just a few clicks, you'll be able to launch a Cassandra cluster with Stargate pre-configured so you can use the Document API straight out-of-the box and build a proof-of-concept app immediately without having to worry about downloading/installing/configuring a Cassandra cluster.
There are even sample apps you can access straight from the Astra dashboard so you can see Stargate in action. For more info, see Using the Document API on Astra. Cheers!
Using multiple database technologies in the same project is somewhat common nowadays and it is called "Polyglot persistence".
Many people use this method to take advantage of multiple systems - and as you mentioned Cassandra is right for somethings and something else (maybe MongoDB) is best for something else, so using a combination can give the advantage of both worlds.
Scaling, Replication, Support can be more costly when you use multiple technologies because you need expertise in both to support.
So if you really have use cases where Cassandra wont be a good choice and you have some primary use cases where Cassandra is the best choice then yes, going with two databases can be the best option provided you are ready to take the trouble of supporting two systems.

Using Amazon S3 for image storage. Where should I store my Metadata?

Background:
I am new to cloud computing and large scale DB design. I have to find a storage facility for a large number of images that have a lot of metadata associated with each image. I am going to use Amazon S3 to store my image files and I need a cloud based database solution to store metadata and reference to each image. I need this so I can query a DB for customer request and pull images and their metadata and insert new data as well via some web and mobile application interface I will create.
Research done:
I found the S3 is a raw data storage solution. I found many good discussions here on bucket naming conventions and I see many people use S3 as binary storage and use a DB for metadata. I've done some research on mongoDB, dynamoDB, and other database solutions.
Question:
I need a direction of where I can find an inexpensive and reliable Database that will work well with Amazon S3, that is ideal for large amount of metadata storage.
Well if you are not looking for a relational DB, why not try http://aws.amazon.com/simpledb/
and if you want RDMS how about http://aws.amazon.com/rds/

How are databases used to implement document collaboration?

How are document collaboration tools such as Google Docs and Sharepoint implemented in the backend? What kind of database architecture in the backend is used to implement features such as multiple people editting the document simultaneously. How is this done efficiently efficiently for large documents without having each edit update an entire database entry?
And how do they maintain the complete version history of every single edit while not using up tons of disk space?
Do Google Docs and Sharepoint have degrading performance for very very large documents?

Should GAE Bloblstore be used in place of traditional Database

I am writing a web application that requires a database which will have entities like user, friends etc. Since Cloud SQL service is not free so i am looking for alternatives. Amazon RDS is one option, since they have a free tier which would suit my needs in the short term but before I get into it I would like to know more about blobstores.
Is it ideal to use blobstore to store such kind of information?
There are questions like:
how will the read/write latency be compared to a traditional db ?
if i start with blobstore and later i want to move to relational db, what are the problems that i could face ?
The most important of all is, if it is ideal to use blobstore in my scenario.
After looking at the documentation on google dev site I have found that blobstores are used to store large/medium files like images and videos.
You can't and shouldn't try to use the blobstore for structured data. That's what the datastore is for. Blobstore is for unstructured data such as files.

Google AppEngine DB Management best practice?

Google app engine offer a data store (some kind of DB wrapper) to hold your data.
It does not supply an editor to this data store - only a viewer.
When developing a web application with other DB - MSSQL, MySql etc. - I change the DB structure in the development process many times.
In AE data store you should edit it's structure and data by using code - Java in my case.
Do you - AE developers - have any best practice to manage this DB updates and save them in some smart way for deployment?
I don't know about "best practice", but I have a Servlet that I use during development which can upload and download all entity data as JSON.
I can then use a regular text editor to make changes or I use a hacked version of JSONpad to edit data live in the system.
Since, I use JSON through out my application this works best for me. One could also do the sample thing with XML and use any one of the many XML editors.
Also, I do use the low-level API for all my applications, so my data models tends to be fairly simple.
There are plenty of JSON/XML editors that could be adapter for your purposes, with a little bit of work.

Resources